Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review. WalkthroughChangesUnion Prop Serialization
Possibly related PRs
Merge Risk: ⚪ Minimal · up to This localized fix preserves all literal values for discriminated-union props during metadata extraction and includes a regression test; no actionable merge-blocking risk remains beyond normal checks and review. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Check the diff here: storybookjs/storybook@f96ed20...add38a0 List of included PRs since previous version: - storybookjs/storybook#35922 (valentin/sb-1766-angular-docgen-documentation-pass) - storybookjs/storybook#35844 (s-robertson/u/srobertson/fix-react-component-meta-union-props) - storybookjs/storybook#35931 (valentin/sb-1847-componentid-collision-warning) - storybookjs/storybook#35923 (valentin/sb-1789-server-side-code-snippets-resolve-spreads-and-identifier) - storybookjs/storybook#35940 (valentin/sb-1789-review-fixes) - storybookjs/storybook#35900 (julien/vue-api-description) - storybookjs/storybook#35938 (fix-publish-ansi-parsing) - storybookjs/storybook#35929 (valentin/sb-1821-pin-oxc-resolver) - storybookjs/storybook#35936 (chore/changelog-v10.5.9) - storybookjs/storybook#35930 (valentin/sb-1789-review-fixes) - storybookjs/storybook#35921 (valentin/sb-1809-bug-angular-constructor-and-generic-function-inputs-lose-the) - storybookjs/storybook#35917 (norbert/fix-publish-staged-retries) - storybookjs/storybook#35896 (valentin/sb-1776-angular-docs-end-to-end) - storybookjs/storybook#35920 (julien/vue_server_docgen_options) - storybookjs/storybook#35907 (valentin/docgen-server-arg-types) - storybookjs/storybook#35886 (valentin/sb-1799-default-docgen-server-angular-vite) - storybookjs/storybook#35902 (fix/vue-snippet-runtimeoverride) - storybookjs/storybook#35825 (norbert/module-graph-skip-noop-mirror) - storybookjs/storybook#35629 (reuben/fix-pseudo-states-cssom-rewrites) - storybookjs/storybook#35915 (next-merge-prerelease) - storybookjs/storybook#35906 (valentin/angular-docs-decorator-gate) - storybookjs/storybook#35830 (version-non-patch-from-10.6.0-alpha.5) - storybookjs/storybook#35899 (valentin/angular-required-input-with-default) - storybookjs/storybook#35831 (norbert/spike-module-graph-hot-cold-split)
…x-react-component-meta-union-props React: Preserve discriminated union prop values in metadata extraction (cherry picked from commit 50f703d)
What I did
Fix
react-component-metaprop extraction for discriminated unions where the same prop has different types across union members.Previously, the extractor retained the first prop symbol while deduplicating union members, causing later literal values to be omitted. It now uses TypeScript's merged property type for serialization while preserving the original symbol for documentation, defaults, declarations, and source filtering.
Added a regression test confirming an optional discriminant with
"a"and"b"variants includes both values.AI assistance: OpenAI Codex was used to investigate, implement, and test this change. I reviewed and submitted the result.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
No browser-based manual testing is necessary. This change only affects TypeScript component metadata extraction and is covered by the regression test.
A maintainer can verify it by running:
cd code/renderers/reactnode ../../../node_modules/vitest/vitest.mjs run --config vitest.config.ts src/componentManifest/componentMeta/componentMetaExtractor.props.test.tsmerges same-named prop types across union members.Documentation
MIGRATION.MD
Documentation updates are not applicable because this fixes existing experimental extraction behavior without changing its API or configuration.
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
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>