A Chinese invasion of Taiwan would look nothing like Russia’s invasion of Ukraine. China could attack Taiwan with fires from the mainland, there isn’t a deep depth of terrain within which to hide. It would be more about resisting an occupying force than trying to meet them on the battlefield.
The deterrence here isn’t in stopping an invasion, but from making the fallout so costly that it wouldn’t be worth it. Just rigging the TSMC plants with explosives and blowing them up when an invasion starts would accomplish deterrence more effectively than having soldiers shoot at each other. The unified economic sanctions of Russia after the invasion of Ukraine has been extremely costly and acts as a major message of deterrence against China trying to take Taiwan and risking reduction to the foreign trade that’s so vital to their stability (which is why they’re to develop their domestic market to reduce economic dependence).
Taiwan should stay independent, but it doesn’t make sense to have a lot of people bleed for it.
I also hugely doubt China’s blustering is as severe as Russia’s. I know all militaries overstate their capabilities but I think one of the biggest factors in Ukraine’s successful defense so far was that Russia was spouting all stars and then it turned out they had more like a junior varsity high school team. I think the delta between the perception and reality of China’s military capabilities is much lower.
Helpful to remember that while Taiwan is certainly much, much smaller, it is also mountainous and urban, with few good beaches. Some very unfavorable terrain to attack into, no matter how much you blast it first.
Their population is also quite high, that island has half the population of Ukraine, and they have money coming out of their ears.
They can make a conventional invasion extremely costly, even the old fashioned way. They wouldn’t win unaided, but they could draw it out. Just due to the defensible geography.