Open mikelambert opened 7 years ago
I have split the jquery dependencies out to a separate "bundle", which can be imported/not-imported on a page-by-page basis. Currently it is imported on every page.
The last two items above (app-install, smart-banner) are jQuery dependencies that trigger on every page on the site. I will focus on eliminating those two, at which point we can conditionally import jquery on the remaining pages where it is necessary (admin, classes, add, promote, homepage), and tackle them independently.
We continue to use jQuery, and pull in ~100kb (pre-gzip) JS on our site. Ideally we would rewrite these dependencies in React (which we've fully committed to).
The current users of jQuery, in need of React rewrites/equivalents.
These are easier because they exist in React templates already:
js/classResults.js
templates/results.html
These are a bit more complex, since it involves convert this page over to a React template (some small templates/ and python changes, to mirror what is done in our results, event, and class pages...populate a JSON dict in the python code, I can help with this bit)
templates/add.html
. (needs to set up a new react template, so some python and templates/ changes)templates/promote.html
. (needs to set up a new react template, so some python and templates/ changes)js/homepage.js
. I think this functionality (dynamically load images as we scroll through the backgrounds, without preloading them all up front) might require a bit of custom work, not sure if there's an off-the-shelf npm package for this.Misc changes:
<script src="jquery"></script>
on these admin pages thoughThese are a bit harder, in that they exist in the base html templates, and so require a much larger (ie more infrastructural) migration to React JS to pull these off.
js/app-install-promo.js
js/common.js