Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consul UI pre 1.9 used a mainly ES5 style of javascript, this meant that the majority of the code did not need any ES6 to ES5 babel transpilation or shim code, and our javascript payload was roughly:
Consul UI: 116KB gzipped
Dependencies: 374KB gzipped
As of 1.9 we started moving towards using Ember's new Octane edition, which felt much more ES6-y. So as well as beginning to update all of our components to use glimmer components, we also updated the style of how we write the UI to use ES6 javascript rather than ES5. This meant that (with our existing browser targets file), much of this was being transpiled using babel into ES5 javascript, giving a rough javascript payload of:
Consul UI: 229KB gzipped
Dependencies: 460KB gzipped
That's roughly 200KB gzipped of payload difference between Consul UI 1.8 and 1.9 split roughly 50/50 between app and dependencies, mainly due to moving to a ES6 style of writing javascript.
This PR alters our browser targets file to target newer browsers and transpile less.
We took a good while looking into this, basing the following on the fact that we generally use these ES6 features:
We found the newest feature here (surprisingly) was async/await, which landed in Chrome 55, FF 53, Safari 10, Edge 15, which "release date wise" takes us to around the end of 2016 for all of these 'evergreen' browsers, probably a reasonable date.
The slight caveat here is a garbage collection bug for tagged Template Literals in Safari 12, which considering our current usage of template literals wouldn't affect us.
This brings us to a browserlist of: (bumped Safari version to get non-transpiled template literals)
This brings us back down to:
Consul UI: 184KB gzipped
Dependencies: 431KB gzipped
A ~71KB reduction on 1.9, not close to the 200KB between 1.8 and 1.9 but a good reduction (although I'm still confused as to where we gained 130KB 🤷 )
We also took the opportunity to remove
ember-cli-autoprefixer
here as the above browserlist supports all the things that autoprefixer was prefixing for us (mainly MS flavoured grid and flexbox).There's probably a little more we can do here but nothing quite like a 70KB reduction, so we'll probably leave that for future PRs.
Overall this frees us up to make use of some other nice JS dependencies for upcoming features with a clear conscience 😄
Consul UI 1.8
Consul UI 1.9
Consul UI this PR