-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
React: Upgrade react-docgen to 6.0.x and improve argTypes
#23825
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8c5354b
update react-docgen to 6.0.0-rc.9
danez 0d5b7fd
Merge branch 'next' into pr/danez/22324
ndelangen a26c431
fix type issues
ndelangen f9b9e76
fix: update to 6.0 final
danez 056719f
Merge branch 'next' into pr/danez/22324
ndelangen 1f0fc81
Merge branch 'next' into react-docgen
ndelangen d174979
Upgrade to react-docgen 6.0.2
shilman e874745
Merge branch 'next' into pr/22324
shilman c6ab522
Docs-tools: Fix react-docgen enum handling
shilman 7875282
Merge branch 'next' into shilman/fix-react-docgen-enum
shilman 79bc783
React-vite: TS strict mode
shilman 33e677c
Merge branch 'next' into shilman/fix-react-docgen-enum
shilman 796f4a5
Merge branch 'next' into shilman/fix-react-docgen-enum
shilman d620a34
Update snapshots for improved react-docgen enum handling
shilman 31704fc
Merge branch 'next' into shilman/fix-react-docgen-enum
shilman c78890f
React: Fix react-docgen handling for arrays, records, functions
shilman 617666d
Fix types
shilman 60748de
Fix snapshots
shilman ac738ec
Restore chromatic ignore
shilman 9fe358f
Merge branch 'next' into shilman/fix-react-docgen-enum
shilman 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| const QUOTE_REGEX = /^['"]|['"]$/g; | ||
| export const trimQuotes = (str: string) => str.replace(QUOTE_REGEX, ''); | ||
| export const includesQuotes = (str: string) => QUOTE_REGEX.test(str); | ||
| export const parseLiteral = (str: string) => { | ||
| const trimmedValue = trimQuotes(str); | ||
|
|
||
| return includesQuotes(str) || Number.isNaN(Number(trimmedValue)) | ||
| ? trimmedValue | ||
| : Number(trimmedValue); | ||
| }; |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what was this change necessary for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. This PR is mostly changes from #22324 and I guess this is one of those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A @ndelangen special, here:
a26c431(#22324)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems wrong, indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done, because the TS compiler options here are different than the settings in the react-docgen repo. This lead to one of the CI jobs to fail, because the it was validating react-docgen types with the different options (mostly strict stuff). I fixed a lot of it and enabled some more strict options in react-docgen, so maybe it works now.