Tsai Ing-wen may be the one democratic leader thanking her lucky stars for the U.S.-China trade war.
Taiwan's president took office in May 2016 with an ambitious goal: diversifying the economy away from the mainland and restoring its reputation as a high-tech center.
She rolled out a "New Southbound Policy" of stronger links with Southeast Asia, South Asia, Australia and New Zealand.
Tsai also launched a project for an Asian Silicon Valley. It aims to support key high-tech industries, including biomedicine, defense, green energy, recycling and smart machinery.
Then U.S. President Donald Trump burst on to the scene and unwittingly gave Tsai's plans new impetus. The uncertainty generated by his trade war has Taiwanese companies shifting operations back home. It also is fueling hopes that big multinationals will switch out of China and boost Taiwan's prospects.
Eddie Han, analyst at Taipei-based Market Research & Consulting Institute, notes that there is a growing sense that "the trade war is going to last for a while." He argues that the focus is on how to "alleviate the impact of the trade war instead of relocating supply chains to the U.S."
Foxconn Technology Group, formally known as Hon Hai Precision Industry, tells the story. Chairman Terry Gou is making Tsai's year by considering moving some server production from the mainland to Taiwan. The company that assembles most of Apple's iPhones might also hire some 3,000 high-end software engineers for a giant data-processing center in the southern city of Kaohsiung.
It is not the specific number of jobs that matters, but the trend. Gou is the vanguard of global executives actively responding to the trade war. The damage to supply chains from the conflict and rising uncertainty may increasingly outweigh lower mainland labor costs.
It also puts Foxconn stands companies betting Trump's brawl with China's Xi Jinping will not end soon.
Gou is hedging his bets for the next battle: over data security. Washington's assault against Chinese tech giants like Huawei Technologies has fueled worries about security and commercial secrets on the mainland. Tech giants simply cannot discern where the Chinese state ends and the private sector begins.
"We don't know how the U.S.-China trade war is going to develop," Gou said in Kaohsiung on March 17. "Some sensitive data has to be stored in a third-party location and Taiwan is a neutral location between China and the U.S."
Along with churning out iPhones, Foxconn builds equipment for Cisco, Dell EMC, and Ericsson -- all operators fearful of technology flowing to Beijing.
But with Huawei also among its clients, Foxconn must navigate a minefield in which both sides have hidden explosive devices.
That makes its problems a microcosm of the tensions faced by Taipei as it seeks to lessen economic dependence on the mainland just when Beijing has become more assertive.
Tsai was elected to create more breathing space between Taiwan and China, which views her democracy as a breakaway province that must return to the motherland.
She has enraged Xi's Communist Party by playing political footsie with Trump. The U.S. president accepted a phone call from Tsai in December 2016, just after his election win, and later allowed her to make unusually long stops in Houston and Los Angeles. A negotiating tactic, perhaps, meant to upset Xi's team. But Trump has also questioned the logic of the "One China" policy.
Yet the dust-up is also a reminder of Taiwan's precariousness -- and the limits to Tsai's ability to limit China's role in its affairs.
If Tsai is considered a pro-independence agitator in Beijing, predecessor Ma Ying-jeou almost seemed part of Xi's inner circle. On his watch, from 2008 to 2016, the percentage of mainland-bound exports surged from 24% to more than 40%. This exposure complicates efforts to pivot away from Asia's biggest economy.
Buttressing the point: Taiwan's exports suffered their steepest decline in nearly three years in February. The 8.8% drop from a year earlier highlighted waning Chinese demand. Last month, Taipei cut its 2019 gross domestic product growth estimate to 2.3% from 2.4%. There are worries that Taiwan, as analyst Richard Bush of the Brookings Institution puts it, "might become a victim of friendly fire" from Washington.
Shots may come from Beijing, too, which is apt to see the island as a political target. "In the immediate sense, Taiwan might gain as some industries relocate back, but Beijing's 'One China' policy is the ultimate red line in the current Sino-U. S. confrontation which is about much more than just trade," says Diana Choyleva of Enodo Economics. "So, over the medium-term Taiwan is likely to be in a very difficult position."
But, until Beijing reasserts itself, Taiwan can secure some clear gains from the trade conflict.
As Gou has correctly diagnosed, the U.S. and China are really engaged in a "tech war," one aimed at derailing Xi "Made in China 2025" scheme to dominate everything from semiconductors and aerospace to robots and pharmaceutics.
Foxconn is helping revive "Made in Taiwan." It is playing a key role in morphing Kaohsiung into a hub for research and development, big data and artificial intelligence.
Gou's "technology buffer" strategy is resonating elsewhere in Taiwan. Take Quanta Computer, a data-center client of Google, Facebook and other household names. It is moving some server assembly jobs back home. The catalysts -- tariffs on China and security concerns -- also have Lite-On Technology building a $324 million plant to make power products in Kaohsiung. With clients including Dell EMC, HP and IBM, this, too, is sure to turn heads.
Taipei needs to act boldly to maximize the investment benefits. Tsai is still left with challenges that predate the trade war. Lin Po-feng, chairman of the Taipei-based Chinese National Association of Industry and Commerce, lists five: pricey land, inefficient access to water, expensive power, an aging workforce and a need to attract talent.
Tsai's government should be mulling sweeteners, including tax incentives, to woo tech giants. You can bet Xi's government will introduce measures to dissuade others from re-shoring to Taiwan.
But, for now, Tsai is catching a timely tailwind, blowing with unlikely help from Trump. She should make the best of the political weather before it turns again. Taiwan's tech industry is showing the government how.
William Pesek is an award-winning Tokyo-based journalist and author of "Japanization: What the World Can Learn from Japan's Lost Decades." He was given the 2018 prize for excellence in opinion writing by the Society of Publishers in Asia for his Nikkei Asian Review work.