playcanvas / engine

Powerful web graphics runtime built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.73k stars 1.36k forks source link

Adds `deprecated.js` to `sideEffects` #7114

Closed marklundin closed 6 days ago

marklundin commented 1 week ago

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.