Mae Ngai teaches history at Columbia University and is the author of " Impossible Subjects: Illegal Aliens and the Making of Modern America ." The opinions expressed in this commentary are solely hers.

(CNN) The Chinese have the dubious distinction of being the only group to be excluded from the United States explicitly by name.

Sixty years of Chinese Exclusion , which lasted from 1882 to 1943, imposed myriad harms on Chinese people. Chinese laborers could not immigrate and no Chinese could obtain naturalized citizenship. Chinese who sought entry into the United States, such as citizens and merchants exempted from the exclusion laws, faced extreme interrogation upon arrival, mostly aimed at detecting fraudulent identity claims. Americans now consider Chinese Exclusion to be a blight on the nation's history and believe that we are -- or should be -- past such blatant racial discrimination.

And yet, President Trump's executive order "Protecting the Nation from Foreign Terrorist Entry into the United States," the so-called Muslim ban, eerily recalls Chinese exclusion. The comparison is apt not just in the palpable animus it displays toward an entire group, but also because much of the legal basis of Chinese Exclusion still stands.

To preserve its independence, and give security against foreign aggression and encroachment, is the highest duty of every nation, and to attain these ends nearly all other considerations are to be subordinated. It matters not in what form such aggression and encroachment come, whether from the foreign nation acting in its national character, or from vast hordes of its people crowding in upon us. ... If, therefore, the government of the United States, through its legislative department, considers the presence of foreigners of a different race in this country, who will not assimilate with us, to be dangerous to its peace and security, their exclusion is not to be stayed because at the time there are no actual hostilities with the nation of which the foreigners are subjects.

Accordingly, the court pronounced the regulation of immigration to be a part of the Congress's conducting of its foreign policy, in the same basket as declaring war and ratifying treaties and outside the purview of the Constitution. This view underwrites the basic principle of Congress' "plenary power," or absolute authority, over immigration, and with it, the use of broad discretion by the executive in its enforcement.

Those Chinese immigrants who did attempt to enter the US during exclusion were commonly detained at the Angel Island immigration station in San Francisco Bay for days, weeks, even months. Hundreds of poems carved into the wooden walls and posts in the barracks at Angel Island attest to their plight. Reads one (in English translation)

America has power, but not justice.

In prison, we were victimized as if we were guilty.

Given no opportunity to explain, it was really brutal

For Chinese already living in the US, exclusion meant decades of family separation, legal insults (like anti-miscegenation laws), and violence. Chinese born in America and hence citizens also suffered occupational exclusions, residential and school segregation, and social ostracism. These discriminations were extended to South Asians and Japanese in subsequent exclusion laws.

President Trump's anti-Muslim bias is reminiscent of the racism against Chinese in the 19th century. He believes "Islam hates us" and considers all Muslims to be potential terrorists, just as Chinese Exclusion was built on the assumption that Chinese were racially incapable of assimilation and were a danger to the nation's peace and security.

Taking another page from Chinese Exclusion, Trump's executive order may yet serve to exclude all or nearly all Muslims beyond those from the seven banned countries. The order not only calls for "extreme vetting" of all refugee applicants (who are already subject to four to five rounds of rigorous screening) but also for enhanced "standards" for scrutinizing all persons seeking admission, whether as immigrants or visitors. These mechanisms will include personal interviews to determine fraud and an "applicant's likelihood of becoming a positively contributing member of society."

Follow CNN Opinion Join us on Twitter and Facebook

In Trump's words, "We only want to admit those into our country who will support our country and love deeply our people." The administration's default position is that Muslims do not "love deeply" America. It doesn't take much to imagine Europeans and Christians sailing through their interviews and Muslims facing interrogations like those of the Angel Island era. Like the Chinese, Muslims will be severely challenged to overcome subjective, religious-racial assumptions about their fitness for inclusion.

In some respects we have come a long way from Chinese Exclusion. Congress repealed it in 1943, when China was a wartime ally. Since 1965, immigration law has prohibited discrimination in the issuing of visas on grounds of national origin, race, and religion. But the Chinese exclusion laws also put into place the national security and plenary principles that give vast powers to the executive in immigration matters, principles that underwrite our entire immigration system and justify discriminatory measures.

Notwithstanding public outcry against the Muslim ban, it is hard to predict whether the federal courts will uphold the ban on grounds that the President acted in the national security interest or strike it down as invidious religious discrimination. In other words, it remains to be seen how far we have really come from the odious era of Chinese Exclusion.