mikelambert / dancedeets-monorepo

DanceDeets Codebase: The python server (with React.JS rendering), as well as the React Native mobile app (and their shared code)
http://www.dancedeets.com
21 stars 2 forks source link

[Web] Migrate off jQuery to React equivalents #3

Open mikelambert opened 7 years ago

mikelambert commented 7 years ago

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:

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)

Misc changes:

These 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.

mikelambert commented 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.