Skip to content

feat: added functional Storybook implementation#921

Merged
davedbase merged 27 commits into
solidjs-community:nextfrom
davedbase:v2/add-storybook
May 26, 2026
Merged

feat: added functional Storybook implementation#921
davedbase merged 27 commits into
solidjs-community:nextfrom
davedbase:v2/add-storybook

Conversation

@davedbase
Copy link
Copy Markdown
Member

Summary

  • Sets up Storybook 10 (storybook-solidjs-vite@10.1.0) at the repo root as a development and documentation tool for Solid 2.0-migrated primitives
  • Stories live colocated with each package at packages/[name]/stories/*.stories.tsx, discovered via a single root glob
  • Uses the storybook-solidjs-vite/next typed API (definePreview / meta.story) for type-safe stories
  • Resolves workspace packages via the @solid-primitives/source custom condition (same approach as the site/ playground), so stories always run against TypeScript source
  • Includes two compatibility shims in viteFinal for Solid 2.0 beta: a solid-js/web → @solidjs/web alias and a transform that patches addEventListener → addEvent generated by an older babel-preset-solid nested inside storybook-solidjs-vite's bundled vite-plugin-solid

First package: @solid-primitives/audio

Four stories covering the full API surface:

  • createAudio — reactive player: track switching via a reactive source signal, <Loading> integration for duration
  • createAudio — reactive source swap: demonstrates automatic reconnect when the source accessor changes
  • makeAudio — non-reactive: raw HTMLAudioElement with manual lifecycle
  • makeAudioPlayer — controls: imperative play/pause/seek/setVolume without signals

Audio samples live in packages/audio/stories/assets/ and are served by Storybook at /audio/*.

Scaffolding

  • template/stories/index.stories.tsx stub added so every new package generated by new-package ships with the stories pattern
  • storybook-static/ added to .gitignore

Usage

pnpm storybook        # dev server at localhost:6006
pnpm build-storybook  # static build

@davedbase davedbase added this to the Solid 2.0 Migration milestone May 25, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 25, 2026

⚠️ No Changeset found

Latest commit: 91dfd4a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ed1466f-7ac6-4f04-a19c-475454a6c081

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@davedbase davedbase marked this pull request as ready for review May 25, 2026 02:13
@davedbase davedbase added the enhancement New feature or request label May 25, 2026
@atk atk changed the base branch from main to next May 26, 2026 07:02
Comment thread packages/audio/stories/_helpers.tsx Outdated
Comment thread packages/autofocus/stories/_helpers.tsx Outdated
Comment thread .storybook/ui/primitives.tsx Outdated
@davedbase davedbase merged commit 0b6c67a into solidjs-community:next May 26, 2026
1 check passed
@davedbase davedbase deleted the v2/add-storybook branch May 26, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request solid-2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants