Skip to content

[pull] next from storybookjs:next#810

Merged
pull[bot] merged 36 commits into
code:nextfrom
storybookjs:next
Jun 3, 2026
Merged

[pull] next from storybookjs:next#810
pull[bot] merged 36 commits into
code:nextfrom
storybookjs:next

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Jun 3, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Copilot AI and others added 30 commits May 28, 2026 09:36
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>
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>
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>
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>
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>
…oundFunctions from testing-library. This improves integration with user interactions in tests.
Resolve conflict in code/renderers/react/src/docs/jsxDecorator.test.tsx by
keeping both independently-added test cases (subcomponent display-name
resolution + #27127 boolean-false prop regression).
…ck-react-route-group

# Conflicts:
#	code/frameworks/tanstack-react/vitest.config.ts

Co-authored-by: huang-julien <63512348+huang-julien@users.noreply.github.com>
Co-authored-by: huang-julien <63512348+huang-julien@users.noreply.github.com>
CSF: Fix Canvas and userEvent types under Yarn PnP
@pull pull Bot locked and limited conversation to collaborators Jun 3, 2026
@pull pull Bot added the ⤵️ pull label Jun 3, 2026
@pull pull Bot merged commit 9040e16 into code:next Jun 3, 2026
5 of 6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants