-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
React: Add react-docgen-typescript to component manifest #33818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
06604d3
Add react-docgen-typescript to component manifest
kasperpeulen 94d53dc
Fix positional doc-to-export mapping with name-based lookup
kasperpeulen 596eb6b
Fix matchComponentDoc returning wrong component for barrel files
kasperpeulen 25128ae
Filter DOM built-in props from Web Component types
kasperpeulen 9d69201
Filter bulk CSS-in-JS system props from component manifest
kasperpeulen 2329686
Add react-docgen-typescript as explicit dependency
kasperpeulen 346d484
Remove overly aggressive displayName filter from RDT parser
kasperpeulen b6e1582
Filter system props from in-project generated .d.ts files
kasperpeulen 9378a2a
Simplify prop filtering to single >30 threshold heuristic
kasperpeulen 734f791
Fix lint errors and reset tsconfig on parser invalidation
kasperpeulen c0d26aa
Switch manifest to single docgen engine based on main.ts reactDocgen …
kasperpeulen c33c7ea
Clean up type cast and add docs link to manifest debugger
kasperpeulen bb93492
Fix review issues: surface RDT errors, remove dead code and casts, ty…
kasperpeulen 4204040
Safe-access manifest.meta to prevent crash when manifest is undefined
kasperpeulen f090172
Conditionally spread reactDocgenTypescriptError (consistent with othe…
kasperpeulen 318fe1f
Treat reactDocgen: false as react-docgen for manifest (never skip doc…
kasperpeulen 9a0287b
Make DtsComponent test resilient to @types/react version changes
kasperpeulen 673b98f
Revert "Make DtsComponent test resilient to @types/react version chan…
kasperpeulen 47e714f
Fix CI: make meta optional, fix lint, rename variables
kasperpeulen bc885bc
Rerun CI
kasperpeulen 679aac1
Make DtsComponent test resilient to @types/react version changes
kasperpeulen c094ea4
Fix CI: template name typo, reset previousProgram, remove flaky Style…
kasperpeulen 8339724
Increase Button test timeout to 30s for slower CI machines
kasperpeulen db861eb
Merge branch 'next' into kasper/react-docgen-typescript
kasperpeulen 923c2d2
Remove styled-components devDependency and test fixture
kasperpeulen 3353c7b
Preserve previousProgram across parser invalidations and narrow meta …
kasperpeulen 6d555c8
Rename meta.reactDocgen to meta.docgen for framework-agnostic extensi…
kasperpeulen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
4 changes: 4 additions & 0 deletions
4
code/renderers/react/src/componentManifest/__testfixtures__/Arrow.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| interface CardProps { | ||
| title: string; | ||
| } | ||
| export const Card = (props: CardProps) => null; |
7 changes: 7 additions & 0 deletions
7
code/renderers/react/src/componentManifest/__testfixtures__/Button.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| interface ButtonProps { | ||
| label: string; | ||
| disabled?: boolean; | ||
| } | ||
| export function Button(props: ButtonProps) { | ||
| return null; | ||
| } |
8 changes: 8 additions & 0 deletions
8
code/renderers/react/src/componentManifest/__testfixtures__/DefaultExport.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| interface IconProps { | ||
| name: string; | ||
| size?: number; | ||
| } | ||
| function Icon(props: IconProps) { | ||
| return null; | ||
| } | ||
|
kasperpeulen marked this conversation as resolved.
|
||
| export default Icon; | ||
7 changes: 7 additions & 0 deletions
7
code/renderers/react/src/componentManifest/__testfixtures__/DefaultValues.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| interface AlertProps { | ||
| message: string; | ||
| severity?: string; | ||
| } | ||
| export function Alert({ message, severity = 'info' }: AlertProps) { | ||
| return null; | ||
| } |
12 changes: 12 additions & 0 deletions
12
code/renderers/react/src/componentManifest/__testfixtures__/DisplayNameOverride.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type { FC } from 'react'; | ||
|
|
||
| interface ModalProps { | ||
| title: string; | ||
| open?: boolean; | ||
| } | ||
|
|
||
| // Component has an explicit displayName that differs from the variable name | ||
| const InternalModal: FC<ModalProps> = (props) => null as any; | ||
| InternalModal.displayName = 'FancyModal'; | ||
|
|
||
| export { InternalModal as Modal }; |
8 changes: 8 additions & 0 deletions
8
code/renderers/react/src/componentManifest/__testfixtures__/Documented.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| interface TooltipProps { | ||
| /** The content to display */ | ||
| content: string; | ||
| } | ||
| /** A tooltip component. */ | ||
| export function Tooltip(props: TooltipProps) { | ||
| return null; | ||
| } |
10 changes: 10 additions & 0 deletions
10
code/renderers/react/src/componentManifest/__testfixtures__/DtsComponent.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import type { ButtonHTMLAttributes } from 'react'; | ||
|
|
||
| interface HtmlButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
| /** The button variant */ | ||
| variant?: 'solid' | 'outline'; | ||
| } | ||
|
|
||
| export function HtmlButton(props: HtmlButtonProps) { | ||
| return null; | ||
| } |
16 changes: 16 additions & 0 deletions
16
code/renderers/react/src/componentManifest/__testfixtures__/ForwardRef.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { forwardRef } from 'react'; | ||
|
|
||
| interface TextInputProps { | ||
| /** Input label */ | ||
| label: string; | ||
| /** Placeholder text */ | ||
| placeholder?: string; | ||
| /** Change handler */ | ||
| onChange?: (value: string) => void; | ||
| } | ||
|
|
||
| export const TextInput = forwardRef<HTMLInputElement, TextInputProps>( | ||
| function TextInput(props, ref) { | ||
| return null; | ||
| } | ||
| ); |
7 changes: 7 additions & 0 deletions
7
code/renderers/react/src/componentManifest/__testfixtures__/FunctionProps.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| interface CallbackProps { | ||
| onClick?: (id: string) => void; | ||
| onSubmit: () => boolean; | ||
| } | ||
| export function Callback(props: CallbackProps) { | ||
| return null; | ||
| } |
13 changes: 13 additions & 0 deletions
13
code/renderers/react/src/componentManifest/__testfixtures__/Generic.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| interface ListProps<T> { | ||
| items: T[]; | ||
| renderItem: (item: T) => string; | ||
| emptyMessage?: string; | ||
| } | ||
|
|
||
| export function StringList(props: ListProps<string>) { | ||
| return null; | ||
| } | ||
|
|
||
| export function NumberList(props: ListProps<number>) { | ||
| return null; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.