Skip to content

feat(react): enable sideEffects#4376

Merged
mimarz merged 9 commits intomainfrom
react/side-effects
Jan 20, 2026
Merged

feat(react): enable sideEffects#4376
mimarz merged 9 commits intomainfrom
react/side-effects

Conversation

@Barsnes
Copy link
Member

@Barsnes Barsnes commented Jan 8, 2026

Summary

resolves #4367

This PR just sets it to true, but to be safer we can add an array of files.

Checks

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

🦋 Changeset detected

Latest commit: d05cbb6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@digdir/designsystemet-react Patch
@digdir/designsystemet Patch
@digdir/designsystemet-css Patch
@digdir/designsystemet-theme Patch
@digdir/designsystemet-types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Barsnes
Copy link
Member Author

Barsnes commented Jan 8, 2026

We should do a snapshot release of this before merging

@Barsnes Barsnes changed the title feat(reac): enable sideEffects feat(react): enable sideEffects Jan 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Preview deployments for this pull request:

storybook - 20. Jan 2026 - 11:59

@Barsnes
Copy link
Member Author

Barsnes commented Jan 13, 2026

This can be tested under the test tag or version 0.0.0-react-side-effects-20260113071010

@oddvernes
Copy link
Collaborator

oddvernes commented Jan 15, 2026

Tested downstream in in demo app:

  • npm install all packages @test
  • npm run tokens:create && npm run tokens:build (not really relevant since the change is only to react)
  • npm run dev
  • npm run build

I cant really see any difference in the node_modules designsystemet-react/dist cjs and esm output code vs @latest release at a quick glance

@Barsnes
Copy link
Member Author

Barsnes commented Jan 16, 2026

Tested downstream in in demo app:

  • npm install all packages @test
  • npm run tokens:create && npm run tokens:build (not really relevant since the change is only to react)
  • npm run dev
  • npm run build

I cant really see any difference in the node_modules designsystemet-react/dist cjs and esm output code vs @latest release at a quick glance

I have tested a bit as well and have not run into any issues

@Barsnes Barsnes marked this pull request as ready for review January 16, 2026 08:50
Copy link
Collaborator

@mimarz mimarz left a comment

Choose a reason for hiding this comment

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

Tested using Nextjs 16. Worked fine

This may impact people still running old bundlers, we'll have to see :)

Suggest we clarify that this is a configuration that is webpack specific.

Co-authored-by: Michael Marszalek <mimarz@gmail.com>
@mimarz mimarz merged commit 2329f98 into main Jan 20, 2026
11 checks passed
@mimarz mimarz deleted the react/side-effects branch January 20, 2026 11:22
@github-actions github-actions bot mentioned this pull request Jan 20, 2026
Barsnes added a commit that referenced this pull request Jan 20, 2026
Co-authored-by: Michael Marszalek <mimarz@gmail.com>
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.

Remove sideEffects: true so tree-shaking is only done in ESM

4 participants