-
-
Notifications
You must be signed in to change notification settings - Fork 414
feat(app): display inputsignals as inputs rather than properties #1439
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
Conversation
Did you know why tests are failing ? |
No, I'll have a look on Thursday |
@vogloblinsky I fixed it, forgot a condition for |
@vogloblinsky do you take it from here? The time I got from my company for Compodoc is used up now, but feel free to contact me if there are any questions |
Thanks for the PR |
Storybook core maintainer here π Do you have a rough estimate of when the input/output signal work will be released? We have made the necessary adjustments in Storybook to support both signal types type-wise. We await a Compodoc release to announce full signal support in Storybook. |
This week or beggining of next week. |
public getInputSignals(props) { | ||
let inputSignals = []; | ||
props?.forEach((prop, i) => { | ||
const regexp = /input(?:\.(required))?(?:<([\w-]+)>)?\(([\w-]+)?\)/; |
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.
@astrutz This regex has quite some limitations. I will list the most obvious ones and potentially we can adjust the regex to cover the cases:
input("helloworld")
-> strings are not supported as default valuesinput(false, { transform: booleanAttribute });
-> as soon as a transformation option is used, the regex doesn't match
I am thinking of potentially rather use some babel parsing here instead of relying on a regex, since the expression might also have some new line characters, especially if the options object is used to provide a transform function
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.
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.
@vogloblinsky thank you so much for this if you can support the cases @valentinpalkovic mentioned, thank you so much in advance.
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.
@valentinpalkovic I agree with you, although I can't really do much, as I don't have the capacity atm. I'll check with company and can come back to you in about 3 weeks
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.
@astrutz Is there a Github issue ticket for that? This issue in relation to Storybook is quite important to me currently as it unfortunately makes it kind of unusable currently :(
Closes #1434.
I didn't find a better way to extract the input signals than with a regex inside the properties