Repository navigation
Svelte: Fix real-world server docgen and snippet regressions - #36845
Draft
valentinpalkovic wants to merge 4 commits into
Draft
valentinpalkovic wants to merge 4 commits into
valentinpalkovic wants to merge 4 commits into
Conversation
Contributor
2 of 9 tasks
1 of 9 tasks
valentinpalkovic
changed the base branch from
svelte-server-story-snippets
to
svelte-docgen-sweep-comparator
October 16, 2026 22:18
This branch has not been deployed
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.
Stacked on #36847 at
b406e21f5e073b43fac584015ec625689395b3d7, above #36773. Server docgen remains opt-in. This draft retains one unwaived comparison; CI and review remain required.What I did
Summary
Preserve inherited native attributes, legacy events and slots, SCSS component documentation, namespace component resolution, wrapped story indexing, unevaluated expression bindings, snippet fallback templates, spread precedence and unsafe string values. Callable props expose
type.name: functionwith their exact signature intype.raw; snippet props retain their existing type representation.Evidence
css_expected_identifierfor SCSS interpolation; native event aliases reporttype.name: otherdespite a callable TypeScript type.After: the SCSS fixture succeeds through the legacy engine without preprocessing, and the native alias fixture reports
functionwhile preservingMouseEventHandler<HTMLButtonElement>in bothrawand the display summary.Real-world captures retain the original repository revisions. Pink and addon use disclosed compatibility story migrations, identical sources and installs for the head legacy/server pair, and a source manifest recorded before each build. The migrations repair snippet scope without changing component implementations or dependency versions. Their old Storybook 10 comparisons remain informational.
c7074b5b9dea70e92aaa8a9cb8a1fd08c059f4dd526c24340024dfae9c9a7709aad552382ed99f86f2b232996e6c6357d3b88388409e72b8123ee989491cf4b26577bd8f9e345de528c591586f621f4fBoth Pink and addon head legacy/server pairs now build and capture successfully, with identical pre-build source manifests and zero timeouts. All 218 component groups remain. Pink has 450 stories in each head capture; the old Storybook 10 capture has 449. The old Storybook 10 comparisons are informational: Pink has 978 differences, addon has 1.
One unwaived finding remains in addon-svelte-csf,
tests-addons-actions--default:invalid-comparisonbecause the baseline snippet has no parsable root element. Its native button handler lacks component type evidence. No waiver is applied and the zero-unwaived gate is unmet.Accepted rule counts are default omissions 100, event omissions 9, snippet children 1, text equivalences 21, callable classifications 6, and binding representations 3. Zero-count root-defect and union-order rules were removed in #36847.
The published head includes the seven server snapshots. Previous-head CI passed type checking, build, format, lint, internal Storybook and Svelte/SvelteKit jobs, but its aggregate failed. New-head CI must complete; there are no approving reviews.
ons
accepted: text-equivalent 0
accepted: snippet-child 0
accepted: default-omitted 20
accepted: event-omitted 0
accepted: binding-represented 0
accepted: callable-classification 0
Gained components: none.
gradio
accepted: text-equivalent 2
accepted: snippet-child 0
accepted: default-omitted 1
accepted: event-omitted 0
accepted: binding-represented 0
accepted: callable-classification 0
Gained components: none.
addon-svelte-csf
accepted: text-equivalent 19
accepted: snippet-child 1
accepted: default-omitted 6
accepted: event-omitted 9
accepted: binding-represented 0
accepted: callable-classification 0
Gained components: none.
pink
accepted: text-equivalent 0
accepted: snippet-child 0
accepted: default-omitted 73
accepted: event-omitted 0
accepted: binding-represented 3
accepted: callable-classification 6
Gained components: none.
Merge Danger
Door: two-way
Set
features.docgenServer: falseto use legacy metadata and snippets.Blast Radius: Svelte
Changes server metadata and source snippets. The legacy path only skips the server-specific description parse.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
yarn test server-metadata.test.tsandyarn vitest run code/renderers/svelte/src/docgen code/renderers/svelte/src/svelte-csf/indexer --testTimeout 30000. Expect the SCSS and callable alias fixtures to pass.yarn nx check svelte. Expect zero errors and warnings.svelte-vite/default-tssandbox withfeatures: { componentsManifest: true, docgenServer: true }, then runyarn workspace @storybook/docgen-harness baselines:sandbox --template svelte-vite/default-ts --sandbox /absolute/path/to/svelte-vite-default-ts. Expect all 16 documented components to match.type.raw, and its displayed type summary must be unchanged. Run the legacy mode SCSS fixture without supplyingdocumentationSource; it must still returnlabel.Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary Release - 🚫 Not run
This PR does not have a canary release associated.
In-repo PRs: add the
ci:canarylabel. Later pushes republish while the label remains.Fork PRs: the label does nothing (a later push must not auto-publish). A maintainer publishes from this repository with Run workflow and the
prinput.branchandshaare optional; if more than one is set, they must be the same commit. The fork author does not need to do anything.