-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[all] Size regression when emitting ES2021 #3777
Comments
Isn’t it a bit early to switch to ES2021? |
We published ES2019 in 2021. Publishing ES2021 in 2023 is pretty in line with that. We're somewhat more aggressive here than other libraries, but this matches our past language support going back to lit-html 1.0 and Polymer 3.0. ES2021 has excellent support across browsers. Logical assignment support goes back to Chrome 85 / Firefox 79 / Safari 14. Nullish coalescing (ES2020) goes to 80 / 71 / 13.1. And all syntax is compilable to older language levels without polyfills for applications that need to do that. |
Steve tracked this down, dead code elimination of the debugEventLog statements wasn't triggering, I guess the version of terser we're using can't dead code eliminate code like: const foo = undefined;
foo?.(); |
With that fixed, lit-html.js minifies down to 7,220B, down from a bit over eight thousand |
This is fixed |
In #3775 we're advancing our output to ES2021, but we're seeing a size regression in our built output.
We're probably going to move forward for now with ES2021 in the pre-releases, just to get early signal about whether that breaks anything, but before we launch we need to reevaluate this because it's probably not worth it to advance the language version at the cost of size.
The text was updated successfully, but these errors were encountered: