4 ms·
We did this with Vue.js, not sure if it applies to React (I haven't used React). The way we did it was to start with a few parts of the page that really benefit
by nickserv 6y ago
We did this with Vue.js, not sure if it applies to React (I haven't used React).
The way we did it was to start with a few parts of the page that really benefited from having Vue.js, using a simple `script src=`. So no components or anything fancy. For this we just put the JS stuff using Django's template system.
Once we had proved that this improved the site, we went all in and started to use the "proper" way, building the JS and deploying to a CDN.
In parallel to this we set up Django Rest Framework and set up alternate routes to fetch the view data as JSON.
In retrospect I would probably skip the hybrid system and just start building view components, but it was done this way so we could more easily revert if it didn't work out.