This also extends past tech. Forcing physical companies to set up a local subsidiary/do JVs has done the same. Examples abound, Starbucks being a big one. Forcing them to do a JV means a huge portion of the revenue of the biggest coffee chain in the country stays inside the country, as well as plenty of office jobs. Otherwise everything but the actual in-store jobs would have once again flowed to the US.
China of course has done the same, to similar success. Imagine if they hadn't, and just let e.g. Meta be their social media platform of choice, Google their search engine, Amazon their shopping platform. It'd be nothing but a massive net loss to everyone involved but those tech firms; including the Chinese public as the state would impose the exact same censorship and rules on those companies, as they currently do with the remaining ones.
That other countries haven't done so and just let SV walk over them in order to appease the US - who has now turned out not to be their friend after all, surprise surprise! - is very unfortunate.
This incredible imbalance is what has let the average HN FAANG employee make absolute bank at the cost of the rest of the world, so I'm not expecting this to be particularly popular here :)