Uyghurs
Rian Thum explored the concepts of identity among the ancestors of the modern Uyghurs in Altishahr (the native Uyghur name for eastern Turkestan or southern Xinjiang) before the adoption of the name "Uyghur" in the 1930s, referring to them by the name "Altishahri" in his article "Modular History: Identity Maintenance before Uyghur Nationalism". Thum indicated that Altishahri Turkis did have a sense that they were a distinctive group separate from the Turkic Andijanis to their west, the nomadic Turkic Kirghiz, the nomadic Mongol Qalmaq, and the Han Chinese Khitay before they became known as Uyghurs. There was no single name used by them to refer to themselves, the various native names Altishahris used to refer to themselves were Altishahrlik (Altishahr person), yerlik (local), Turki, and Musulmān (Muslim), the term Musulmān in this situation did not signify religious connotations, because the Altishahris would exclude other Muslim peoples like the Kirghiz when referring to themselves as Musulmān. Dr. Laura J Newby has also noted that the sedentary Altishahri Turkic people felt themselves as a separate group from other Turkic Muslims since at least the 19th century.
History of Mongolia
The Uyghurs, who were subjects to the Göktürks, revolted in 745 and founded the Uyghur Khaganate which replaced the Eastern Turkic Khaganate. The Uyghur kagan Bayanchur established Ordu-Baliq City on the Orkhon river in 751. The Tang Empire invited the Uyghurs to subdue the An Lushan rebellion in 755. Successful campaigns of the Uyghur Khaganate led to a peace with the Tang dynasty of China which paid compensation for the suppression of An in silk and grain for 12 years after 766.
Though a faction of the Uyghurs were Buddhists, the Manichaeism became the official religion of the Khaganate in the 8th century. Nevertheless, the majority of the Uyghurs remained shamanists. The culture and economy of the Uyghur Kaganate were more advanced than those of its predecessors. The Uyghurs used a 12-month calendar and calculated the dates of solar and lunar eclipses. The Uyghurs developed their own writing system based on the Sogdian script. The Tang dynasty surreptitiously encouraged the Yenisei Kirghiz and the Karluks to attack the Uyghurs and the Uyghur Khaganate fell under an invasion of the Yenisei Kirghiz in 840.