The present application discloses a novel class of heterocycles as class I PI3Ks inhibitors. The compounds claimed herein could be used alone or in combination therapies for the treatment of a wide range of disorders such as autoimmune, inflammatory and allergic diseases, asthma, COPD, parasitic infections, diabetes, and cancer.