Skip to content

Stop publishing Storybook arg fixtures in the library bundle - #2442

Merged
spaceninja merged 1 commit into
mainfrom
exclude-story-args-from-bundle
Aug 24, 2026
Merged

Stop publishing Storybook arg fixtures in the library bundle#2442
spaceninja merged 1 commit into
mainfrom
exclude-story-args-from-bundle

Conversation

@spaceninja

@spaceninjaspaceninja commented Aug 24, 2026

Copy link
Copy Markdown
Member

Overview

The published bundle has been exposing three symbols we never meant to ship: defaultArgs, defaultArgTypes and generateGroundNavProps. They come from ground-nav-args.js, a fixture only the Ground Nav stories import. They reached dist because the build has no explicit entry list — it globs everything in src/{objects,components}/*/ and re-exports it, filtering out only .stories. and .test. files. Adding -args. to that filter closes the gap.

Because these were never documented, never intended as API, and useless outside Storybook, we are treating this as a bug fix rather than a breaking change. The changeset names all three explicitly so it is discoverable if someone turns out to have imported them. The four real exports come out byte-for-byte identical, and dist/standalone.css and dist/standalone.min.css are untouched — the minified JS bundle drops from 7.8KB to 4.1KB.

Screenshots

Testing

The fixture we stopped publishing is still imported by stories, so the thing worth confirming is that Storybook is unaffected:

  • Open the deploy preview and go to the Ground Nav component page. Every variation should render with its full set of navigation links, exactly as on the production library.
  • Use the Controls panel on a Ground Nav story to change a value — the preview should update as usual.
  • Check the Icon, Embed, Hype Group and Spacing pages, which use the same shared arg definitions, and confirm their controls still appear and work.
  • Optionally, run npm run build and open dist/cloudfour-patterns.d.ts. It should declare exactly four things — createElasticTextArea, createSubscribe, initCommentReplyForm and initSkyNav — with no Ground Nav argument objects.

The build's entry glob re-exports every file in src/{objects,components}/*/,
filtering out only .stories. and .test. files. That let ground-nav-args.js
through, publishing defaultArgs, defaultArgTypes and generateGroundNavProps
as API. Extend the filter to -args. files.
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cbac808

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

This PR includes changesets to release 1 package
NameType
@cloudfour/patternsPatch

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

@netlify

netlifyBot commented Aug 24, 2026

Copy link
Copy Markdown

Deploy Preview for cloudfour-patterns ready!

NameLink
🔨 Latest commitcbac808
🔍 Latest deploy loghttps://app.netlify.com/projects/cloudfour-patterns/deploys/6a8c74c19ed4e60008ebfe3e
😎 Deploy Previewhttps://deploy-preview-2442--cloudfour-patterns.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@spaceninja
spaceninja merged commit 3d8554e into mainAug 24, 2026
8 checks passed
@spaceninja
spaceninja deleted the exclude-story-args-from-bundle branch August 24, 2026 16:52
@github-actionsgithub-actionsBot mentioned this pull request Aug 24, 2026
Sign up for freeto 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.

Storybook demo args are published as part of the public API

1 participant

@spaceninja