The present disclosure provides compounds and pharmaceutically acceptable salts thereof that are tyrosine kinase inhibitors, in particular BLK, BMX, EGFR, HER2, HER4, ITK, TEC, BTK, and TXK and are therefore useful for the treatment of diseases treatable by inhibition of tyrosine kinases such as autoimmune diseases, cancer and inflammatory diseases. Also provided are pharmaceutical compositions containing such compounds and pharmaceutically acceptable salts thereof and processes for preparing such compounds and pharmaceutically acceptable salts thereof.