-
Notifications
You must be signed in to change notification settings - Fork 892
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
Add early experiments for tree-shakable ES5 output. #3407
base: main
Are you sure you want to change the base?
Conversation
💥 No ChangesetLatest commit: 7827f89 Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs
|
From a technical standup, this LGTM. I still don't think that this fixes a problem worth fixing though, and adding 22.3% to the SDK build that most people will consume seems like a non-starter. |
I think ultimately it's up to you and Fei and others to decide, but I'd love to list all of our options here. I think we can do either ES2017-only, or ES5-only, or both. I'd say if we go ES5-only (or ES5 by default), this is almost a must-have. If we do both, having tree-shakable ES5 would be still quite nice, but we can also just say "use ES2017 build if you want even better tree-shaking". |
eef18ba
to
7827f89
Compare
Unfortunately, ES5 by default doesn't address my size concern since almost all users will just pull in the default SDK version (evidence being that our ES2017 build was broken for years). |
Thanks for exploring this option! I think the solution is quite neat (very short and clean to apply). Regarding the build targets for next, I'm leaning toward using es2015+ for files that are in esm format, that includes |
DO NOT MERGE! This is early experiment results.
See my test script and test results at https://gist.github.com/yuchenshi/78ded5074e1e281306a17782d010c0e5
BEFORE
After:
Note the huge 1M -> 92K size reduction due to tree shaking.