Skip to content
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

Bump minimum target to es2015 #3992

Merged
merged 2 commits into from Sep 2, 2022
Merged

Bump minimum target to es2015 #3992

merged 2 commits into from Sep 2, 2022

Conversation

SvanT
Copy link
Contributor

@SvanT SvanT commented Aug 1, 2022

Now that we no longer support IE we can raise the minimum ES target a
bit. Changing to es2015 shaves off ~17% from the main bundle size, also
it prevents generators from being transpiled into regular functions etc.
so I would guess it has the potential to give some general performance
improvements too.

For fun I also tried to raise it to es2022, this gave a slightly bigger
bundle than es2015 so I think es2015 could be an ok target unless we
need something newer for some reason.

Now that we no longer support IE we can raise the minimum ES target a
bit. Changing to es2015 shaves off ~17% from the main bundle size, also
it prevents generators from being transpiled into regular functions etc.
so I would guess it has the potential to give some general performance
improvements too.

For fun I also tried to raise it to es2022, this gave a slightly bigger
bundle than es2015 so I think es2015 could be an ok target unless we
need something newer for some reason.
@Tyriar Tyriar added this to the 5.0.0 milestone Aug 3, 2022
@Tyriar Tyriar self-assigned this Aug 3, 2022
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17% is a pretty awesome win, I'll merge in and try update it in vscode soon to see if anything goes wrong 🤞

@Tyriar Tyriar merged commit 1b38a00 into xtermjs:master Sep 2, 2022
@jerch
Copy link
Member

jerch commented Sep 2, 2022

Yes the savings are awesome 👍

On a sidenote: I wonder if ts compiler/webpack could be instructed to mangle private names as well (with the help of a skip list in case we really do ugly private access from outside of a module/class). When looking at the generated output it really seems, that most of the package size results from chatty property names, that dont get mangled. (Rough estimate from a python script extracting chatty names sees this at 60%, lol)

@Tyriar
Copy link
Member

Tyriar commented Sep 2, 2022

I don't think the TS compiler can do it, but I'd love to minify some of those long names without compromising readability/sourcemaps.

Before:

npm notice 323.4kB lib/xterm.js 
npm notice 102.5kB lib/xterm-addon-webgl.js 

After:

npm notice 268.6kB lib/xterm.js
npm notice 85.2kB  lib/xterm-addon-webgl.js

Tyriar added a commit to microsoft/vscode that referenced this pull request Sep 2, 2022
lemanschik pushed a commit to code-oss-dev/code that referenced this pull request Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants