tenants2
tenants2 copied to clipboard
Our web JS bundles are bigger due to supporting ES5
Right now the JS bundles we build use ES5 and include a bunch of polyfills, like regenerator-runtime, to ensure that they work on really old browsers.
All this support bloats our JS bundles by some unknown amount (we should measure how much).
We have a few options:
-
Drop client-side JS support for ES5-based browsers. It should also be noted that since our site is progressively enhanced, doing this won't mean that such browsers can't access the site--it will just mean that they will get our baseline experience, and effectively be treated like browsers that have JS disabled.
-
Deliver separate bundles for ES5-based browsers. This would add complexity to our build pipeline, but we could essentially build a separate bundle for ES5-based browsers. The user's browser could decide which bundle to load if we load new modules as ES modules and load the old bundles via a
<script nomodule>
fallback.