3 ms·
Well, leaving aside the React vs Web Components debate, the only issue is that some folks add technologies like React but forget to remove the old ones as they
by lstamour 6y ago
Well, leaving aside the React vs Web Components debate, the only issue is that some folks add technologies like React but forget to remove the old ones as they go. They half-finish the job. Then they do that up to 5 times more...
My advice would be to try to refactor the jQuery app to reduce global state first. For example, use ASTs and other techniques to programmatically determine what global state is used where. Think of it not as “porting” to React, but more as ‘re-writing in React” — the sooner you can finish the rewrite, the better. Take it in smaller, thin, but global (across the whole app) steps, and work to break the app dependencies back down to separate components — this is especially true for CSS, which historically has been global by design for much of its life...
If shipping during a rewrite, make sure you have some very basic tests running. Try to implementation-agnostically look for and click text or otherwise use the web app in your tests, then run the tests before and after making widespread changes... Use screenshots from the tests to quickly visually scan for errors. Pay attention to errors in browser consoles also, if not using TypeScript to its fullest yet.