A Chinese invasion of Taiwan would suck for the whole globe economically but would be especially disastrous for China - even if they 'succeeded' in their attempt at reunification. If Xi Jinping is a rational actor the consequences should be enough to deter him from acting, but is he and will he remain rational?
This Center for Strategic and International Studies report describes potential pre, active, and post conflict global impacts of China invading Taiwan.
https://www.csis.org/analysis/reunification-taiwan-through-force-would-be-pyrrhic-victory-china
“Reunification” with Taiwan through Force Would Be a Pyrrhic Victory for China
This brief explores the economic, financial, technological, and diplomatic implications of a Chinese attack on Taiwan, building a more holistic picture of the stakes for Beijing and reaffirming the importance of deterring China from such an attempt.