Release: Prerelease 10.3.0-alpha.9#33904
Merged
Merged
Conversation
Integrate react-docgen-typescript alongside existing react-docgen to provide TypeScript-aware prop extraction in the component manifest. This gives more accurate type information for components using TypeScript features like generics, Pick/Omit, intersection types, and re-exports. Key changes: - New reactDocgenTypescript.ts module with TS program management, prop filtering (strips React built-in Attributes), and export name resolution - Wire rdt into getComponentImports alongside existing react-docgen - Add invalidateParser() for fresh TS program on each manifest request - Extract findTsconfigPath to shared utils (removed dead empathic/find import) - Type render-components-manifest.ts with rdt types, add rdt debug panel - Add styled-components as devDependency for test fixtures - 18 new test cases covering Button, Arrow, DefaultExport, MultipleExports, UnionProps, FunctionProps, DefaultValues, Documented, NoComponents, ImportedProps, PickOmit, Generic, ReExport, Intersection, DtsComponent, StyledComponent, ForwardRef, and Barrel exports
Replace the fragile positional mapping (exportNames[i]) with a name-based
approach using getExportNameMap. This correctly handles:
- Aliased re-exports: `export { Card as RenamedCard }`
- Default exports: displayName derived from filename
- displayName overrides: `Foo.displayName = 'Bar'`
Add test fixtures and tests for RenamedExport and DisplayNameOverride.
When no matching doc was found in a multi-export file, the fallback `?? docs[0]` would silently return the first component (e.g. BaseStyles from src/index.ts). Return undefined instead so wrong data is never shown in the manifest.
Expand the prop filter to also exclude props inherited from DOM built-in interfaces (HTMLElement, Node, Element, GlobalEventHandlers, etc.) via lib.dom.d.ts. These leak through when wrapping Web Components like @github/relative-time-element, reducing RelativeTime from 331 to 27 props. Also tighten the React filter: check both Attributes name AND node_modules fileName to catch third-party augmentations (e.g. Next.js adding `tw` to HTMLAttributes via @vercel/og).
The filter rejected any component whose displayName didn't start with an uppercase letter. This silently dropped all Mantine factory components (displayName like @mantine/core/Button) and potentially others. react-docgen-typescript already only returns component-like symbols, so this filter was redundant.
The system props filter only checked node_modules sources, missing CSS-in-JS libraries like Panda CSS that generate type definitions in-project (e.g. styled-system/types/style-props.d.ts with 700+ props). Expand the check to also filter .d.ts files exceeding the threshold, while preserving user-authored .ts files.
Replace the two-layer filter (isBuiltinProp + getSystemPropSources) with a single heuristic: any source file in node_modules or ending in .d.ts that contributes >30 props is filtered out entirely. This naturally catches React built-ins (HTMLAttributes, DOMAttributes), DOM interfaces (lib.dom.d.ts), and CSS-in-JS system props (Panda CSS, styled-system). Small interfaces like RefAttributes (just ref) now pass through, which is an improvement. Also removes performance instrumentation code and unused logger import.
…config Instead of running both react-docgen and react-docgen-typescript in parallel, the manifest now reads typescript.reactDocgen from main.ts presets and runs only the selected engine. User's reactDocgenTypescriptOptions are passed through.
…pe meta - Surface react-docgen-typescript parse errors in manifest (not silently swallowed) - Remove dead esc() call in render-components-manifest - Remove unnecessary `as FileParser` cast - Add `meta` to ComponentsManifest type (required, not cast) - Simplify durationMs null checks now that meta is required Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
…r optional fields)
…ges" This reverts commit 9a0287b.
- Make ComponentsManifest.meta optional for backward compatibility - Remove extra blank line in getComponentImports (prettier) - Rename rdtDoc → reactDocgenTypescriptDoc in generator.ts - Rename activeEngine → cardEngine for per-card scope in debugger Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
…type Keep previousProgram so ts.createProgram can reuse unchanged source files across manifest passes. Narrow ComponentsManifest.meta.reactDocgen from string to the actual union type.
Co-authored-by: valentinpalkovic <5889929+valentinpalkovic@users.noreply.github.com>
…test Disable highly flakey test
…tructions Set up Copilot coding agent instructions
…ript React: Add react-docgen-typescript to component manifest
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 2 | 2 | 0 |
| Self size | 391 KB | 402 KB | 🚨 +11 KB 🚨 |
| Dependency size | 338 KB | 338 KB | 0 B |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 535 | 535 | 0 |
| Self size | 648 KB | 648 KB | 🚨 +120 B 🚨 |
| Dependency size | 59.91 MB | 59.87 MB | 🎉 -37 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 92 | 92 | 0 |
| Self size | 1.12 MB | 1.12 MB | 🚨 +36 B 🚨 |
| Dependency size | 22.43 MB | 22.39 MB | 🎉 -33 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 124 | 124 | 0 |
| Self size | 30 KB | 30 KB | 0 B |
| Dependency size | 23.71 MB | 23.68 MB | 🎉 -33 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 82 | 82 | 0 |
| Self size | 35 KB | 35 KB | 0 B |
| Dependency size | 20.21 MB | 20.18 MB | 🎉 -33 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 274 | 274 | 0 |
| Self size | 24 KB | 24 KB | 🎉 -24 B 🎉 |
| Dependency size | 44.57 MB | 44.54 MB | 🎉 -37 KB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 57 | 58 | 🚨 +1 🚨 |
| Self size | 1.23 MB | 1.19 MB | 🎉 -37 KB 🎉 |
| Dependency size | 12.94 MB | 13.20 MB | 🚨 +264 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
Build: Fix and improve mcp addon e2e test
ee290e9 to
8d80ccd
Compare
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.3.0-alpha.8to10.3.0-alpha.9.Once this pull request is merged, it will trigger a new release of version
10.3.0-alpha.9.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.3.0-alpha.9