Skip to content

feat(web): individual exports#4565

Merged
mimarz merged 8 commits intomainfrom
feat/export-all
Mar 13, 2026
Merged

feat(web): individual exports#4565
mimarz merged 8 commits intomainfrom
feat/export-all

Conversation

@Barsnes
Copy link
Member

@Barsnes Barsnes commented Mar 4, 2026

Summary

resolves #4558

Checks

@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2026

🦋 Changeset detected

Latest commit: 7b8386c

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-web Minor
@digdir/designsystemet-react Minor
@digdir/designsystemet Minor
@digdir/designsystemet-css Minor
@digdir/designsystemet-types Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Preview deployments for this pull request:

storybook - 13. Mar 2026 - 09:35

@Barsnes Barsnes marked this pull request as ready for review March 4, 2026 07:40
@mimarz
Copy link
Collaborator

mimarz commented Mar 4, 2026

This should be tested downstream, ive pushed a new snapshot release for testing.

@mimarz
Copy link
Collaborator

mimarz commented Mar 4, 2026

As far as I understand esm tree-shaking, with sub-path exports/import, the invokers polyfill won't be run (since its invoked in index)? so will dialog and popover work?

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.

Seems the exports don't work as they have the wrong path.
The built files have the same names as source so the have the same name as "component" ieg;

"./ds-field": {
    "types": "./dist/index.d.ts",
    "import": "./dist/esm/field/index.js",
    "require": "./dist/cjs/field/index.cjs"
  },

should be

"./ds-field": {
    "types": "./dist/index.d.ts",
    "import": "./dist/esm/field/field.js",
    "require": "./dist/cjs/field/field.cjs"
  },

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.

Fixed paths, added missing readonly export and updated README.

Tested downstream using demo-html

Seems to work fine now :)

Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

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

LGTM!

@mimarz mimarz merged commit 4bd54bd into main Mar 13, 2026
7 of 8 checks passed
@mimarz mimarz deleted the feat/export-all branch March 13, 2026 08:46
@github-actions github-actions bot mentioned this pull request Mar 13, 2026
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.

Subpath exports in web package

3 participants