-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add test case for sub components (demonstrates invalid syntax in output) #60
Add test case for sub components (demonstrates invalid syntax in output) #60
Conversation
It looks like webpack can expect this method to be defined in certain cases. Related to storybookjs/storybook#15221.
This change adds the needed check for webpack 5 to avoid extra processing. Ported from #45.
fix: Fix rebuild performance for webpack 5
pull_request: | ||
branches: | ||
- master | ||
- main | ||
- next |
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.
Sorry, I think I cloned Storybook's fork of this project. Some of these changes are unrelated. But check out the snapshot below :)
default.Sub.displayName = \\"default.Sub\\"; | ||
// @ts-ignore | ||
default.Sub.__docgenInfo = { \\"description\\": \\"\\", \\"displayName\\": \\"default.Sub\\", \\"props\\": { \\"name\\": { \\"defaultValue\\": null, \\"description\\": \\"\\", \\"name\\": \\"name\\", \\"required\\": true, \\"type\\": { \\"name\\": \\"string\\" } } } }; |
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.
Syntax errors here (so even the defensive try/catch
doesn't help :(
@@ -143,6 +143,18 @@ export default class DocgenPlugin implements webpack.WebpackPluginInstance { | |||
} |
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.
Irrelevant file, sorry again!
Just gonna close this, too messy. Fixing my fork. |
This PR is meant to demonstrate/add a test case for the invalid output described in #57. It stems from a bug in
react-docgen-typescript
where components that are assigned to properties of other components are given a name ofdefault.Name
.The snapshot that gets generated by the test suite for this (valid) file contains a syntax error.