-
-
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
Use client api in react native #3036
Conversation
2bcb29c
to
7a70d5c
Compare
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.
makes sense to me.
} = {}) { | ||
// channel can be null when running in node | ||
// always check whether channel is available | ||
this._channel = channel; |
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.
channel here is only used by RN?
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.
This code (client_api
) wasn't previously used by RN.
_channel
is always there in existing code that uses the client API, but not used by the client API, so given the way I was going to initialize this code in the RN context (without passing the channel as it doesn't exist yet), I figured we get rid of if from this code, so no-one would try and use it in the future.
Codecov Report
@@ Coverage Diff @@
## master #3036 +/- ##
==========================================
+ Coverage 37.29% 37.48% +0.18%
==========================================
Files 435 434 -1
Lines 9435 9389 -46
Branches 923 894 -29
==========================================
Hits 3519 3519
+ Misses 5333 5318 -15
+ Partials 583 552 -31
Continue to review full report at Codecov.
|
Issue: RN used the
StoryStore
from@storybook/core
but not the fullClientApi
, making things like #2679 difficultWhat I did
Refactored a little to use
ClientApi
How to test
Test with built-in examples (seems to work). Also try any other apps you can.
Notes
I didn't refactor the
ConfigApi
out as:a) it's a pretty small surface area.
b) RN works differently as it doesn't have a redux store or use the same kind of channel logic.
I think we'll be fine leaving that as is.