Tips for incremental migration from jquery to react?

I have a medium-large web app that was written in php and jquery. It's a nightmare and needs to be overhauled. Ideally rather than have two projects going simultaneously, I was hoping to stand up a react front end that can incrementally migrate to, and implement new features in. Any tips or ideas from the masters here?
8 Replies
sen.py
sen.py16mo ago
If time is concern you can do screen by screen migration. Where you start with one screen and all of its components and mount it when you navigate to that page. Once you get all screen now you just switch to your proffered router. While this is going on you also dont make anything new in php/jquery. Initial setup might take lil time but then every screen is pretty easy. But if you have time and engineers you can pause features and just do one whole rehaul
limeey
limeeyOP16mo ago
Once you get all screen now you just switch to your proffered router.
any tips or resources on doing that when the php app is just serving raw php files (no laravel router) i figure it's just going to be rewrite rules in my htaccess
sen.py
sen.py16mo ago
Even if you return all pure php files it's still just html. Just do reactDom.Render to your indivual screen in each php file
No description
limeey
limeeyOP16mo ago
oooo
sen.py
sen.py16mo ago
Once you're done you will have all react screens with php skeleton serving it. And at that moment you finally use some kind of router to bring them all toghether There is also two application method where you start writing totally different app ex. Nextjs one and just redirect user when they access part that has been rewritten in next.js <-- this is more preffered as you get to basically do complete rewrite one by one but managing state between both will be nightmare
limeey
limeeyOP16mo ago
ya that was was I was figuring at first, but wasn't able to see a clear path that won't just make the entire process more difficult than a full rewrite but the idea of rendering the html after the php generation is interesting...
sen.py
sen.py16mo ago
We pretty much succesfully rewrote our entire dashboard into react from backbone jquery, I was the one who did last part of combining using React Router It's still shitshow pure react, but better than backbonejs. There is still one backbone screen that now mounts inside react screen which is funny considering that's how rewrite started using react inside backbone router. Hope this helps, I you need help on this feel free to tag me
limeey
limeeyOP16mo ago
ya i appreciate your insight thanks
Want results from more Discord servers?
Add your server