-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Args: Add ability to specific argType "targets" #16333
Conversation
Nx Cloud ReportCI ran the following commands for commit c7912a8. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
Nx Cloud ReportWe didn't find any information for the current pull request with the commit 8103861. Check the Nx Cloud Github Integration documentation for more information. Sent with 💌 from NxCloud. |
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.
Looks great. Do we want to feature flag this?
Yep! What do you think about the other frameworks? Should I do them too? |
@tmeasday yes please! sorry I missed that comment in your PR description 👍 |
Ok, done. I haven't added stories for angular or server (or really tested them). |
if (!Component) { | ||
throw new Error( | ||
`Unable to render story ${id} as the component annotation is missing from the default export` | ||
); | ||
} | ||
return <Component {...args} />; | ||
|
||
const renderedArgs = FEATURES.argTypeTarget ? noTargetArgs(context) : args; |
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.
WDYT about adding argsByTarget
to the context?
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.
Done
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.
@shilman I reworked this, as discussed.
Now:
- It is a parameter (similar to
passArgsFirst
) rather than aFEATURE
. This was just more convenient, I am open to turning it back into a feature if you prefer that. - We filter
args
by default if the feature is on, also addingargsByTarget
andfullArgs
for convenience.
@shilman I made the changes you requested. |
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.
Love it! 😻
Issue: #16239
What I did
Still todo
How to test
Yes we have both.