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

feat: add sideeffects to addons; #29841

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: axe-core and accessibility testing setup often requires initialization side effects - verify that tree-shaking doesn't break the accessibility testing functionality

"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider setting sideEffects to ['./dist/manager.js'] since manager entries often have initialization side effects

"react-native": "dist/index.mjs",
"types": "dist/index.d.ts",
"typesVersions": {
Expand Down
1 change: 1 addition & 0 deletions code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider setting sideEffects to an array of framework-specific files that do have side effects instead of false

"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Consider checking if any of the bundled addons (actions, backgrounds, controls etc.) have initialization side effects that need to be preserved. May need to be sideEffects: ["./dist/*/preview.js"] instead of false.

"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/gfm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/highlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"typesVersions": {
"*": {
Expand Down
1 change: 1 addition & 0 deletions code/addons/measure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"typesVersions": {
"*": {
Expand Down
1 change: 1 addition & 0 deletions code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: react-confetti, framer-motion, and react-joyride may have side effects. Consider checking if these dependencies require side effects to function properly before marking the entire package as side-effect free.

"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/outline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/storysource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Setting sideEffects to false here may be problematic since this addon has setup files, global setup, and postinstall scripts that likely have side effects. Consider reviewing the actual side effects in the codebase before marking as side-effect free.

"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/toolbars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
1 change: 1 addition & 0 deletions code/addons/viewport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"sideEffects": false,
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
Expand Down
Loading