This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch side-effects-false in repository https://gitbox.apache.org/repos/asf/superset.git
commit 800e80688d4faa470763bade78ee4b28b4a7a3a6 Author: Maxime Beauchemin <[email protected]> AuthorDate: Wed Apr 16 14:19:46 2025 -0700 fix: set sideEffect:false in package.json Was reading recently about how modern tree-shaking 💨🌳🍂 works in modern web apps, and the `sideEffect` property in `package.json` was mentionned so I checked to see our settings. Apparently we don't have it set right - unless I'm missing something - so I decided to open a DRAFT PR to test things and have the conversation. Apparently the `sideEffect` we have in `webpack.config.js` is probably an artifact/legacy from a previous era. Nowadays npm packages should define weather/which sideEffect they contain as a hint for the bundler to tree-shake the right things. Anyhow, let's see if this builds and passes CI. --- superset-frontend/package.json | 1 + superset-frontend/webpack.config.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/package.json b/superset-frontend/package.json index bb05703032..e2a82f68c1 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -36,6 +36,7 @@ "plugins/*", "src/setup/*" ], + "sideEffects": false, "scripts": { "_prettier": "prettier './({src,spec,cypress-base,plugins,packages,.storybook}/**/*{.js,.jsx,.ts,.tsx,.css,.less,.scss,.sass}|package.json)'", "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV=\"${BABEL_ENV:=production}\" webpack --color --mode production", diff --git a/superset-frontend/webpack.config.js b/superset-frontend/webpack.config.js index 94d33a3723..5d42f0a7d5 100644 --- a/superset-frontend/webpack.config.js +++ b/superset-frontend/webpack.config.js @@ -246,7 +246,6 @@ const config = { }, }, optimization: { - sideEffects: true, splitChunks: { chunks: 'all', // increase minSize for devMode to 1000kb because of sourcemap
