Skip to content

sideEffects: false (or as close as we can get)#21456

Open
NullVoxPopuli wants to merge 1 commit into
mainfrom
nvp/sideEffects-false
Open

sideEffects: false (or as close as we can get)#21456
NullVoxPopuli wants to merge 1 commit into
mainfrom
nvp/sideEffects-false

Conversation

@NullVoxPopuli

@NullVoxPopuli NullVoxPopuli commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

declare all modules as not causing sideEffects that would cause other modules to break -- if it's imported (and most of our stuff is imported right now)

I don't think we have any side-effects, but here is a burn-down list of things to look at:


Route is not present is the hello-world app


Where we started before other refactors landed:

smoke-tests/v2-app-hello-world-template/dist   -35.3%↓

File Before (Size / Brotli) After (Size / Brotli)
./assets/main-{hash}.js 234.9 kB / 64.3 kB -35.3%↓151.9 kB / -34.4%↓42.2 kB
Total (Includes all files) 235.2 kB / 64.5 kB -35.3%↓152.3 kB / -34.3%↓42.4 kB

setting sideEffects: false with no refactors takes the hello-world app from 64.5 kB to 42.4 kB

PRs that landed that bring this down from the initial 64.5 kB:

Note

Prior spikes with both sideEffects declaration and refactorings brought us down to ~30 kB

Other information

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

📊 Size report

Tarball size1.2 MB1.2 MB

dist/dev   No changes

File Before (Size / Brotli) After (Size / Brotli)
./packages/shared-chunks/api-{hash}.js 25.9 kB / 5.7 kB -61.2%↓10 kB / -62.9%↓2.1 kB
Total (Includes all files) 2.1 MB / 492.6 kB 2.1 MB / 492.6 kB

dist/prod   No changes

File Before (Size / Brotli) After (Size / Brotli)
Total (Includes all files) 1.9 MB / 450.7 kB 1.9 MB / 450.7 kB

smoke-tests/v2-app-template/dist   0.09%↑

File Before (Size / Brotli) After (Size / Brotli)
./assets/main-{hash}.js 312.7 kB / 83.7 kB -1.89%↓306.8 kB / -1.69%↓82.3 kB
./assets/modules-{hash}.js 33.9 kB / 10.2 kB 18%↑40.1 kB / 18%↑12 kB
Total (Includes all files) 348.1 kB / 94.6 kB 0.09%↑348.4 kB / 0.4%↑95 kB

smoke-tests/v2-app-hello-world-template/dist   -8.03%↓

File Before (Size / Brotli) After (Size / Brotli)
./assets/main-{hash}.js 159.1 kB / 43.8 kB -8.05%↓146.3 kB / -7.34%↓40.6 kB
Total (Includes all files) 159.4 kB / 44 kB -8.03%↓146.6 kB / -7.32%↓40.7 kB

🤖 This report was automatically generated by wyvox/pkg-size

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/sideEffects-false branch from 210acf1 to 629d04e Compare June 16, 2026 16:17
@NullVoxPopuli NullVoxPopuli changed the title sideEffects: false sideEffects: false (or as close as we can get) Jun 18, 2026
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.

1 participant