Skip to content

feat: experimental tree shaking support#1664

Draft
bacarybruno wants to merge 1 commit intofacebook:mainfrom
bacarybruno:tree-shaking
Draft

feat: experimental tree shaking support#1664
bacarybruno wants to merge 1 commit intofacebook:mainfrom
bacarybruno:tree-shaking

Conversation

@bacarybruno
Copy link

@bacarybruno bacarybruno commented Mar 5, 2026

Summary

Note

Sharing this draft early to get initial feedback and iterate.

Early benchmarking is promising:

  • Baseline: 12,983,961 bytes 115s
  • Tree-shake: 11,939,372 bytes, 107s
  • Delta: -1,044,589 bytes (-8.05%), time -8s
    Validation so far is based on repeated bundle runs (tree-shake off vs on).

Todo:

  • Add unstable_treeShake flag
  • sideEffects support
  • Bench before / after
  • Manual tests
  • Run broader before/after benchmarks (multiple apps/configs)
  • Ensure no regression when unstable_treeShake is disabled / not set
  • Documentation

Test plan

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant