Release: Prerelease 10.5.0-alpha.5#35038
Merged
Merged
Conversation
…DX pages PR #32712 changed usePrimaryStory to only return stories with the 'autodocs' tag, inadvertently breaking custom MDX docs pages where component stories don't carry that tag. Users cannot work around this because adding 'autodocs' to stories that already have a custom MDX page triggers a separate error in StoryIndexGenerator. Fix: add a fallback that selects the first story without an explicit '!autodocs' tag when no story has 'autodocs'. This preserves the #32712 fix for autodocs pages while restoring custom MDX page behavior. Closes #33829 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: valentinpalkovic <5889929+valentinpalkovic@users.noreply.github.com>
First concrete open-service consumer: a per-component docgen service backed by an `experimental_docgen` middleware-style preset. Renderers and addons can register extractors that wrap the previous accumulated extractor and merge results. Phase 1 ships the service definition, registration, static-snapshot wiring under `docgen/<componentId>.json`, and a mock extractor in the React renderer. Phase 2 will teach RCM per-component extraction; phase 3 replaces the mock with the real RCM-backed extractor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rovider Rename DocgenExtractor → DocgenProvider (and matching field/variable names) to better reflect that registrants supply data rather than extract it from a single source. Adds a second docgen provider in addon-docs that enriches description and appends a synthetic prop. With the React mock provider also registered, this exercises the middleware-merge path end-to-end across two packages, validating that the chosen preset chaining pattern composes correctly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…er; drop per-provider identity fallback The preset slot, type re-exports, Presets.apply overload, and every preset file's named export now use `experimental_docgenProvider` — keeps the preset name consistent with the DocgenProvider type. Each provider file no longer carries its own identity-provider seed. Providers call `nextDocgen?.(input)` and treat the downstream payload as optional, falling back to literals where needed. Core still seeds the chain with an identity provider so the composed result is always a defined function, but individual provider files no longer need to know about that detail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds ComponentMetaManager.extractDocForComponent(storyRefs) — a thin wrapper around batchExtract that returns the first resolved ComponentDoc. The docgen open service will call this once per componentId in phase 3; keeping the helper on ComponentMetaManager means successive calls share the file-snapshot cache, TS program, and watcher already maintained there. Three new tests cover the surface that matters for the docgen use case: returning a doc for a single-component subset, sharing fsFileSnapshots across separate per-component calls, and producing fresh docs after an onFilesChanged-driven invalidation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The open-service registration API recently moved from a single
`static: { path, inputs }` block to a definition-time `filePath`
plus a registration-time `staticInputs`. Snapshot paths now also
auto-prefix by service id, so the docgen `filePath` only needs to
produce `<componentId>.json` (the runtime turns it into
`core/docgen/<componentId>.json`).
Updates server.ts, the definition, and the matching static-build
test to the new shape. Phase-1 tests all pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-2-rcm-per-component
Replaces the mock React provider with a real RCM-backed implementation. The provider receives an IndexEntry[] for one componentId, picks the authoritative entry (story over docs), parses the CSF file, resolves the component reference plus any declared subcomponents via the existing getComponents flow, batch-extracts ComponentDoc data through the process-wide ComponentMetaManager singleton, and maps the result into a DocgenPayload — including props, JSDoc tags, subcomponent docs, and per-story snippets with errors surfaced inline. Schemas tighten alongside: DocgenPayload now expresses real props, subcomponents, stories[], jsDocTags, and an optional error field. The new types are re-exported through storybook/internal/types so renderers and addon authors can build conforming providers. The addon-docs provider follows the new shape — it still appends a '(docs enabled)' marker to description but now forwards subcomponents, stories, and jsDocTags from downstream unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d as properties of a parent component
Matches the existing "Loading presets" / "Building manager.." / "Building preview.." CLI breadcrumbs so users can see when the open-service snapshot step is running. Only emits the log (and only schedules the work) when at least one service is registered, so installations without any service consumers stay quiet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…perimentalDocgenServer
Three changes to the phase-1 docgen surface:
1. DocgenProvider input is now { importPath } instead of { componentId, entries }.
The service resolves an entry for the requested componentId and hands the
raw importPath to the provider chain — providers that don't know how to
handle a given path (e.g. the React mock provider seeing an .mdx attached
docs file) bail to nextDocgen.
2. DocgenProvider can return undefined. The identity seed in core's services
preset now returns undefined so a chain with no real providers signals
"no docgen here" instead of producing an empty payload. The addon-docs
enricher mirrors this — it returns undefined when nothing downstream
produced a payload, rather than fabricating one.
3. The whole docgen-service registration is gated behind a new
`experimentalDocgenServer` feature flag (sibling of
experimentalReactComponentMeta). When the flag is off, no service is
registered, no preset chain is built, and the static-build log step
already correctly skips itself via the existing registered-services
length check.
Also picks up an upstream rename: query `filePath` → `staticPath`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The command's output schema was `void`, so callers had to follow up with a separate `getDocgen` read to see what was extracted. The work was already in scope — return the payload (or undefined) directly so a single extractDocgen call gives consumers the data alongside the state write. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ttern Captures a lesson from building the docgen service: when query.load and a command both look plausible for the same work, the work belongs in the command. The load body should be a one-line passthrough that calls it. Extends the Load concept section with the rationale (reusability, testability, clarity) and adds a matching bullet to the Design Rules. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-3-rcm-provider # Conflicts: # code/addons/docs/src/docgen.ts # code/core/src/shared/open-service/services/docgen/definition.ts # code/core/src/shared/open-service/services/docgen/server.test.ts # code/renderers/react/src/docgen/preset.ts
Four review nits, addressed together because they overlap: H2 — Docgen static build wasn't gated by ignorePreview, so a manager-only build forced full story-index generation (staticInputs calls getIndex()). Mirror the !options.ignorePreview gate around index.json / writeManifests at the registration boundary: don't register the service at all when previewing is off. L1 — `nextDocgen?.(input)` defended an impossible state (core always seeds the chain). New `defineDocgenProvider` helper from `storybook/internal/common` types `next` as required and throws a clear error if the seed is ever missing, instead of silently degrading to empty payloads. M3 + M5 — The two phase-1 mocks merged downstream inconsistently (React rebuilt the payload field-by-field; addon-docs used spread). A future provider adding a `DocgenPayload` field would be silently dropped by the React mock. Document the spread + `??` convention on the DocgenProvider type's JSDoc and on `defineDocgenProvider`, and update the React mock to match. The convention preserves both unknown fields and explicit downstream values. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-3-rcm-provider # Conflicts: # code/addons/docs/src/docgen.ts # code/renderers/react/src/docgen/preset.ts
Lets us dogfood the docgen service against real components in storybook:ui:build and storybook:ui dev runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per the review on this PR, the rendering context (autodocs page vs MDX or custom page) is the right axis for deciding whether Primary/Controls filter the CSF file's stories to autodocs-tagged ones, rather than the data-layer fallback the original fix used. DocsContextProps gains an optional filterByAutodocs flag. Docs.tsx sets it from !docsParameter.page: the default DocsPage keeps filtering (true), while a user-supplied custom page opts out (false) and Primary/Controls pick the first story by CSF sort order. usePrimaryStory reads the flag; consumers that do not set it fall through to the autodocs path. Closes #33829
…-3-rcm-provider # Conflicts: # code/core/src/types/modules/core-common.ts # code/renderers/react/src/docgen/preset.ts
…on re-emit Co-authored-by: Jeppe Reinhold <JReinhold@users.noreply.github.com>
Re-engage alien-signals' identity-based dedup in subscribeToQuery by memoizing the computed: return the previous reference when the new handler output is deeply equal. Output-schema validation and Immer both mint fresh references for unchanged data, which previously re-fired subscribers on every state write (including writes to unrelated keys and loads that rewrite a deeply-equal payload). Co-authored-by: Jeppe Reinhold <JReinhold@users.noreply.github.com>
…te-only Replace the single alien-signals state atom + Immer with a deepsignal deep reactive proxy (backed by @preact/signals-core). State mutates in place inside a batch; subscriptions track per-field reads so an unrelated key/field write never re-runs a subscriber's handler. Schemas now validate shape only and never convert: validation output is discarded and the original reference is returned. A dev-only check throws OpenServiceSchemaConversionError when a schema transforms/strips/coerces. subscribe() gains an optional selector (universal-store pattern): the callback receives the selected slice and fires only when it changes by value. Emissions are deduped by value via es-toolkit isEqual; query results and emissions are detached plain snapshots so the proxy never escapes the runtime.
a677c1d to
94fdbf7
Compare
Docs: Fix Controls losing focus when subcomponents are defined
…c-subpath Core: Expose backgrounds types from public subpath
94fdbf7 to
0a602af
Compare
Use top-level testDir in sandbox playwright.config.ts again now that internal e2e has its own config. List e2e-internal in CONTRIBUTING.md repo overview. Co-authored-by: Norbert de Langen <norbert@chromatic.com>
CI: Add internal Storybook E2E job
0a602af to
415a927
Compare
…mbinators Pseudo States: Keep combinator broad pseudo selectors valid
415a927 to
1c6ecf0
Compare
extractDocgen now resolves a componentId via selectComponentEntriesByComponentId (last-wins), matching the manifest. Update the server test to expect the later story entry when multiple stories share the same componentId. Co-authored-by: Cursor <cursoragent@cursor.com>
…r-33743 Preview: Use width/height instead of min-* in CanvasWrap
1c6ecf0 to
ee0cbe2
Compare
Addon Docs: Fix Primary and Controls blocks not rendering in custom MDX pages
ee0cbe2 to
b6f2fcd
Compare
toReactComponentManifest was always setting subcomponents: undefined when there were none, which broke generator.test.ts inline snapshots and diverged from buildReactComponentDocgenFromResolved (which omits the key). Also clarify preset comments to use componentMetaManager naming. Co-authored-by: Cursor <cursoragent@cursor.com>
…provider Docgen: Wire up react-component-meta with DocgenService
b6f2fcd to
743850a
Compare
743850a to
e28303a
Compare
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 72 | 74 | 🚨 +2 🚨 |
| Self size | 20.41 MB | 20.43 MB | 🚨 +20 KB 🚨 |
| Dependency size | 36.11 MB | 36.65 MB | 🚨 +539 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 534 | 534 | 0 |
| Self size | 662 KB | 662 KB | 0 B |
| Dependency size | 62.07 MB | 62.08 MB | 🚨 +11 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 271 | 271 | 0 |
| Self size | 23 KB | 23 KB | 🚨 +12 B 🚨 |
| Dependency size | 46.60 MB | 46.62 MB | 🚨 +11 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 203 | 205 | 🚨 +2 🚨 |
| Self size | 908 KB | 908 KB | 🎉 -144 B 🎉 |
| Dependency size | 88.60 MB | 89.16 MB | 🚨 +559 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 196 | 198 | 🚨 +2 🚨 |
| Self size | 32 KB | 32 KB | 0 B |
| Dependency size | 87.09 MB | 87.65 MB | 🚨 +559 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 73 | 75 | 🚨 +2 🚨 |
| Self size | 1.08 MB | 1.08 MB | 0 B |
| Dependency size | 56.52 MB | 57.07 MB | 🚨 +558 KB 🚨 |
| Bundle Size Analyzer | node | node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an automated pull request that bumps the version from `10.5.0-alpha.4` to `10.5.0-alpha.5`.
Once this pull request is merged, it will trigger a new release of version `10.5.0-alpha.5`.
If you're not a core maintainer with permissions to release you can ignore this pull request.
To do
Before merging the PR, there are a few QA steps to go through:
And for each change below:
This is a list of all the PRs merged and commits pushed directly to `next`, that will be part of this release:
If you've made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with this workflow and wait for it to finish. It will wipe your progress in this to do, which is expected.
Feel free to manually commit any changes necessary to this branch after you've done the last re-generation, following the Make Manual Changes section in the docs, especially if you're making changes to the changelog.
When everything above is done:
Generated changelog
10.5.0-alpha.5