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

Adds deprecated.js to sideEffects #7114

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Adds deprecated.js to sideEffects #7114

merged 1 commit into from
Nov 19, 2024

Conversation

marklundin
Copy link
Member

@marklundin marklundin commented Nov 14, 2024

The engine is marked as not having sideEffects, however deprecated.js contains numerous side effects.

This has important consequences, as most bundlers will tree-shake/remove deprecated.js in a production build, meaning code can behave differently in production. You can see a repro here https://stackblitz.com/edit/vitejs-vite-t6vvne?file=main.js,vite.config.js,index.html

This PR marks deprecated.js as a sideEffect which is a common indicator to most bundlers not to tree-shake that file.

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@marklundin marklundin merged commit ce5ea35 into main Nov 19, 2024
8 checks passed
@marklundin marklundin deleted the fix-side-effects branch November 19, 2024 15:43
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.

2 participants