The invention is compounds of formula (I), and salts thereof, compositions thereof, and methods of use therefor. In particular, disclosed herein are certain compounds that can be useful for inhibiting protein kinase, including Brutons tyrosine kinase (Btk), and for treating disorders mediated thereby.