-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 parameters to stories in the story store, and render them in app layers #2679
Conversation
</div> | ||
), | ||
{ myOption: 'value' } | ||
); |
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.
See this example for insight into how this feature works. More importantly, decorators and addons get passed the context
also.
This is quite cool, it would remove the need for the special abstraction around stories in cc @timhaines |
@@ -3,9 +3,9 @@ import { | |||
enableProdMode, | |||
NgModule, | |||
Component, | |||
NgModuleRef | |||
NgModuleRef, |
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.
Not quite sure why prettier is reformatting this file. Any insights @igor-dv?
Yes! Keen to get insight from such use cases. |
@alterx @tmeasday @ndelangen @igor-dv Any idea why prettier was not applied to the original |
Looks like tslint is not configured to run on precommit at all. And eslint handles only js files. Maybe it's your IDE refactored it ? Will take a look on it soon. |
After resolving the conflicts, the noisy diff should be gone |
4ee31ea
to
bcbc87a
Compare
Ok, angular guff sorted. |
Looks legit. What if we have a few decorators, that need different options? Will it be like this :
By convention ? |
@igor-dv I suspect it might but I think that is the next question to answer after merging this one. There are some other related things, like special options: .add(..., () => ..., { decorators: ... }); |
9d9aaab
to
8fc09c7
Compare
Codecov Report
@@ Coverage Diff @@
## master #2679 +/- ##
=========================================
+ Coverage 35.83% 35.9% +0.07%
=========================================
Files 440 440
Lines 9636 9669 +33
Branches 907 905 -2
=========================================
+ Hits 3453 3472 +19
- Misses 5634 5643 +9
- Partials 549 554 +5
Continue to review full report at Codecov.
|
This is now ready to merge, barring any docs changes we want to make. I don't think we currently document what the I think maybe if we are OK with merging this as is, we could follow it up with an PR that uses the options instead of the more awkward |
Just to be clear: those are not the same options which are set via addon-options? |
No, but this is a good point, we should have a way to set options per-app and per-chapter. |
Let me know what you think about the global and chapter I also remembered that react-native isn't yet using the |
The latter sounds better to me =) |
Yep, on it (slowly)
…On Sun, 18 Feb 2018 at 2:52 am, Filipp Riabchun ***@***.***> wrote:
I'll either need to reimplement the API there or change it to do so before
we merge this
The latter sounds better to me =)
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#2679 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIFylYA14aOs1j175RSFEt2X0gBaw0Vks5tVvW4gaJpZM4RV9_3>
.
|
8942d79
to
9795fa6
Compare
Ok, renamed to |
1ad8532
to
6c68af0
Compare
Well except for the Angular snapshot changes, which are a bit baffling. Should I just accept them @igor-dv? |
Yeah. I don't know yet how to get rid of those ng-💩 things... |
97b5af3
to
f654b4b
Compare
🎉 going to start working on the next phase of my master plan now ;) |
Issue: #993
What I did
Added support for
.add(name, fn, { parameters })
, and similarly passing the options parameters as part of the storycontext
.Notes
This PR is incomplete, I have another one with some tests for the storystore that I will augment this with. I am interested in feedback on the feature and the approach.Note that the various app layers no longer call
.getStory()
(now deprecated I think) and instead call the wrapped.getStoryWithContext()
that handles the (generic) task of setting a context for the story. I think I caught all the places where we do this but let me know if not.Also need to test properly for all 4 app layers.TODO