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
First cut at documentation of project arg/argTypes for discussion #16992
Conversation
☁️ Nx Cloud ReportCI ran the following commands for commit 03279e0. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent 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.
I think the preview.js
example should be in snippets/common
. Otherwise LGTM!
Also we should fix the implementation so that it works in both storyStoreV7
and legacy modes
Looks good to me! And indeed the snippet should be placed in the |
docs/writing-stories/args.md
Outdated
@@ -76,6 +76,20 @@ You can also define args at the component level; they will apply to all the comp | |||
|
|||
<!-- prettier-ignore-end --> | |||
|
|||
## Project 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.
I personally like the clarity of "project" rather than "global" here, but we currently use the term "global" for parameters and decorators.
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.
Yes! We changed this internally in 6.4, as it was super confusing to have "global args" and "globals" (which once upon a time were actually called globalArgs
haha).
We should transition to using project everywhere I think. What's your recommendation in the meantime?
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.
I think this PR should use "global". Then we can make another PR to update it to "project" everywhere, possibly only including that change in 6.5
+.
@@ -10,7 +10,7 @@ Learn how and why to write stories in [the introduction](./introduction.md#using | |||
|
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.
Perhaps we should add similar docs for argTypes
to https://storybook.js.org/docs/react/api/argtypes?
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.
@kylegach sounds reasonable to me!
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.
Yeah, I got a bit hung up on the fact that we don't actually document story-level argTypes
there (I guess argTypes
at the story level generally speaking don't make a heap of sense, although it can be done). But I'll add something.
OK, thanks all, I think this is ready now, perhaps pending #17043 |
Looks like #17043 was merged. Is this good-to-go now, then? |
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.
Codecov Report
@@ Coverage Diff @@
## next #16992 +/- ##
=======================================
Coverage 32.23% 32.23%
=======================================
Files 939 939
Lines 18405 18405
Branches 3836 3836
=======================================
Hits 5932 5932
Misses 11997 11997
Partials 476 476 Continue to review full report at Codecov.
|
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.
Issue: #11697
What I did
args
to theargs
pageWhat we need to figure out:
arg
?argTypes
? Should we be talking about story-levelargTypes
also?