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.
Turpan
The Uyghurs established a Kingdom in the Turpan region with its capital in Gaochang or Kara-Khoja. The kingdom was known as the Uyghuria Idikut state or Kara-Khoja Kingdom that lasted from 856 to 1389 AD. The Uyghurs were Manichaean but later converted to Buddhism and funded the construction the cave temples in the Bezeklik Caves. The Uyghurs formed an alliance with the rulers of Dunhuang. The Uyghur state later became a vassal state of the Kara-Khitans, and then as a vassal of the Mongol Empire. This Kingdom was led by the Idikuts, or Saint Spiritual Rulers. The last Idikut left Turpan area in 1284 for Kumul, and then Gansu to seek protection of Yuan Dynasty, but local Uyghur Buddhist rulers still held power until the invasion by the Moghul Khizr Khoja in 1389. The conversion of the local Buddhist population to Islam was completed nevertheless only in the second half of the 15th century.