Commit d8e968e
authored
feat: add "sideEffects": false to package.json files for all packages (#1343)
Fixes #1136
Added sideEffects: false to enable tree-shaking
I have added the "sideEffects": false property to the
package.json
files of the OpenFeature JS SDK packages. This signals to bundlers (like
Webpack) that the files in these packages do not contain side effects
and can be safely tree-shaken if unused.
Changes
I updated the
package.json
for the following packages:
packages/nest
packages/react
packages/server
packages/shared
packages/web
The packages/angular package already had this flag.
Example Change
```diff
"devDependencies": {
"@openfeature/core": "^1.9.0"
- }
+ },
+ "sideEffects": false
}
```
Verification
1. Codebase Audit
I performed a search of the codebase for potential side effects,
including:
Modifications to `window` or `global` objects.
Immediate code execution on import.
Polyfills or monkey-patching.
CSS/asset imports.
No side effects were found in the source code of the SDKs. The only
occurrences of window/global were in test files or within
functions/methods, which is safe.
2. Build Verification
I ran `npm run build` to ensure the packages still build correctly with
the new flag.
Result: Build successful.
3. Test Verification
I run `npm run test` (including Jest and Angular tests) to ensure no
functionality was broken.
Result: All 35 Jest test suites and 32 Angular tests passed.
4. Additional Verification
To ensure no negative impact:
Linting: Ran `npm run lint` across all packages. All files passed.
Artifact Inspection: Visually verified the `dist` directories to ensure
build output is complete and structured correctly.
Signed-off-by: Mridul Tailor <mtailor729@gmail.com>
Signed-off-by: Mridul Tailor <71081929+MridulTailor@users.noreply.github.com>1 parent 07693eb commit d8e968e
File tree
5 files changed
+10
-5
lines changed- packages
- nest
- react
- server
- web
5 files changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
58 | 59 | | |
0 commit comments