Skip to content

Adds deprecated.js to sideEffects#7114

Merged
marklundin merged 1 commit intomainfrom
fix-side-effects
Nov 19, 2024
Merged

Adds deprecated.js to sideEffects#7114
marklundin merged 1 commit intomainfrom
fix-side-effects

Conversation

@marklundin
Copy link
Copy Markdown
Contributor

@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
@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