-
-
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
[Hosted RN Storybook] Added addon for pairing device (with qr code). #1639
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1639 +/- ##
===========================================
- Coverage 92.5% 21.18% -71.32%
===========================================
Files 6 263 +257
Lines 40 5777 +5737
Branches 2 689 +687
===========================================
+ Hits 37 1224 +1187
- Misses 2 4029 +4027
- Partials 1 524 +523
Continue to review full report at Codecov.
|
@Gongreg is this still something you're working on? |
@ndelangen, yes. I am working with it internally, trying it out, before moving forward here. |
Hey, I still want to do some cleanup. But here is an example project: https://expo.io/@gongreg/rn-storybook-hosted-client-example Server: https://vast-eyrie-45947.herokuapp.com/ (takes ~30s to load because heroku shuts it down). |
@Gongreg What's the next step for this? After 3.3 is merged and released, what's you plan? |
addons/rn-pair/README.md
Outdated
@@ -0,0 +1,28 @@ | |||
# Storybook Addon Actions |
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.
Title is incorrect
addons/rn-pair/README.md
Outdated
|
||
Then, add following content to `.storybook/addons.js` | ||
|
||
import '@storybook/addon-rn-pair/register'; |
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.
Please provide a fenced code format with a language
addons/rn-pair/package.json
Outdated
@@ -0,0 +1,37 @@ | |||
{ | |||
"name": "@storybook/rn-pair", |
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.
If this is an addon, it's package should be named accordingly: @storybook/addon-<name>
I'd say maybe QR-Pair is a better name for this addon, what do you think?
@storybook/addon-qrpair
addons/rn-pair/package.json
Outdated
"scripts": { | ||
"deploy-storybook": "storybook-to-ghpages", | ||
"prepublish": "node ../../scripts/prepublish.js", | ||
"storybook": "start-storybook -p 9001" |
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.
Please do not include a 'embedded' storybook example. Place storybook examples, in the <root>/examples/
.
@@ -0,0 +1,8 @@ | |||
export default { |
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.
Please use glamorous
for styling components.
you can use now for publishing instead of Heroku, it's much better |
@ndelangen is there anything else to do here? |
Hey, I've thought about this for quite some time. The more I think about it the more I realise that there is almost no need for this functionality. So instead I am going to close this PR and update the medium blogpost into something more of "Trying to create static React Native Storybook and steps forward" where I will share experience in creating this and look into what we can actually achieve with onDeviceUI instead of this. Sorry that I kept this open for so long, but I will try to be more useful while working onDeviceUI part. |
@Gongreg I imagine a feature that shows a full screen on-device navigator (with hierarchy) when you some gesture or hold the phone a certain way. I do think the web UI makes sense for documentation purposes also for RN. And i also would ask how to make use of things like addon-knobs for RN if there's no web UI connected to it. Hoping to see some PR's improving the on-device navigator from you ;) |
Issue: If user has hosted react native storybook version, it needs to manually enter code to the phone to connect it to server.
This addon solves the issue by displaying qr code, so user can simply point the phone to it to pair.
What I did
Added new event when new channel is created. This addon listens to it and uses the pairedId code for qr component.
Example
https://expo.io/@gongreg/rn-storybook-hosted-client-example
Server: https://vast-eyrie-45947.herokuapp.com/ (takes ~30s to load because heroku shuts it down).
This change is