Taiwan is functionally independent, with its own Constitution, military, democratic elections, currency and customs regime. Republic of China passports carried by Taiwanese are accepted by immigration authorities around the world.

On the surface, the Taiwan Travel Act does not appear to change much. It offers only a “sense of Congress that the United States government should encourage visits between officials from the United States and Taiwan at all levels.”

But despite a highly polarized climate in Washington, the bill received remarkable bipartisan support, passing unanimously in both the House and the Senate in the face of a vigorous campaign by the Chinese ambassador to the United States, Cui Tiankai.

Mr. Cui took the extraordinary step of sending letters to members of Congress threatening “severe consequences” for the relationship between China and the United States if the measure passed, The Washington Post reported in October.

Relations between the world’s two largest economies were shaken in the first days of the Trump era, in December 2016, when Mr. Trump, then the president-elect, accepted a congratulatory phone call from Ms. Tsai. After becoming president, though, Mr. Trump reiterated America’s “one China policy,” which acknowledges but does not recognize Beijing’s claim on Taiwan, and sought Mr. Xi’s help in pressing North Korea over its nuclear weapons program.

But Mr. Trump has nominated Mike Pompeo, the director of the Central Intelligence Agency, who is widely viewed as pro-Taiwan and tough on China, to succeed Rex W. Tillerson as secretary of state. And the confirmation of Randall Schriver, who is also seen as pro-Taiwanese, as assistant secretary of defense for Asian and Pacific security affairs also suggested a closer and more open relationship with Taiwan.

Ms. Tsai said Wednesday night that she was “grateful to the Trump administration” for pushing ahead with the Taiwan Travel Act.