Add plugin that declares side-effects#21449
Open
NullVoxPopuli wants to merge 2 commits into
Open
Conversation
Contributor
📊 Size reportTarball size — dist/dev -0%↓
dist/prod -0%↓
smoke-tests/v2-app-template/dist 0.06%↑
smoke-tests/v2-app-hello-world-template/dist -8.08%↓
🤖 This report was automatically generated by wyvox/pkg-size |
6db88ae to
3b9abe5
Compare
NullVoxPopuli
commented
Jun 8, 2026
| async function hasNoSideEffects(file) { | ||
| let bundle; | ||
| try { | ||
| bundle = await rollup({ |
Contributor
Author
There was a problem hiding this comment.
running rollup in rollup is a little silly, but it turns out that this is ultimately what agadoo does -- I don't want to remove that yet -- but if this rollup plugin proves reliable and changes to the sideEffects output in package.json match that in the agadoo, I'll remove the agadoo stuff
This was referenced Jun 9, 2026
3b9abe5 to
fc804e5
Compare
19dfe99 to
d2b1111
Compare
Update sideEffects list Declare that we don't do propertyReadSideEffects
47c4a67 to
52e1155
Compare
NullVoxPopuli
commented
Jun 11, 2026
| ////////// | ||
|
|
||
| export const COMPUTE: TagComputeSymbol = Symbol('TAG_COMPUTE') as TagComputeSymbol; | ||
| Reflect.set(globalThis, 'COMPUTE_SYMBOL', COMPUTE); |
Contributor
Author
There was a problem hiding this comment.
this is a side-effect, but is never read by anything
…ing the sideEffects list More Automatically annotate things we think are probably safe when generating the sideEffects list Automatically annotate things we think are probably safe when generating the sideEffects list Automatically annotate things we think are probably safe when generating the sideEffects list Automatically annotate things we think are probably safe when generating the sideEffects list
0bcc758 to
4a06c42
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
explicit side-effect listing is a pain in the butt to manage by hand, so let's do it automatically!
This list of side-effects will get smaller as my further PRs do refactoring to fix how many files end up with side-effects -- I want to try to refactor side-effecting modules to as few things as possible so we get better tree-shake-ability
the way I've been thinking about this is:
what gave the hello-world app the biggest gains in this PR was declaring @ember/component as side-effect free