-
-
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
RN Disables websockets when using onDeviceUI #3278
Conversation
Breaking this would basically disable all addons by default right? Since our addons don’t run inside the device UI? I’m definitely in support of just removing it permanently instead of keeping it as an option. It will make maintaining a lot easier. Wondering if we can get some usage data. |
You are correct, if we implement is and user is using onDeviceUI the addons would be disabled (unless he specifically says useWebsockets in options. Nonetheless the current implementation I've done in our app is to simply check whether storybook is running with simple fetch. Something like
So if server is running onDeviceUI is disabled and addons work, if server is down, it simply displays stories without any addons. And one of the next steps I think we should try to achieve is running addons on the device. It is definitely possible, we just need to think about the way to do it. |
Maybe we can put that fetch test as a default in the getstorybook cli template? |
It could be added I guess, just need to think what about port/host? Should we do separate PR for it? |
That’s probably a better idea |
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 change makes sense to me, and I like that it's still possible to use plugins if you depend on them.
Can we document the useWebsockets
option as part of this PR, and also document the fact that after this PR, onDeviceUI
will make the native storybook standalone unless you specify useWebsockets
? Since it's a big breaking change, it needs a documentation update, both in the normal docs and also in the migration guide (assuming this is a 4.0 feature)
I was able to get a standalone build working without changing anything in the storybook source. I'm assuming not having a server running throws errors but they are silently consumed? I'm using haul packager though |
Codecov Report
@@ Coverage Diff @@
## master #3278 +/- ##
==========================================
- Coverage 36.82% 36.81% -0.02%
==========================================
Files 458 458
Lines 10033 10036 +3
Branches 892 896 +4
==========================================
Hits 3695 3695
- Misses 5782 5794 +12
+ Partials 556 547 -9
Continue to review full report at Codecov.
|
Allows to set events beforehand.
@f0rr0 do you have a public repo somewhere where you are running Storybook RN without the web UI? |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
@f0rr0 It depends on platform too. I think on iOS if the websocket connection fails it just silently eats that error but Android makes a lot of noise (red boxes) if it fails. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Still relevant. |
This change will by default disable websockets when using onDeviceUI.
I've also added option enable websockets back.
Issue is #3271
There are few questions that I have:
Do we need the option in the first place. Is there anybody using onDeviceUI with websockets. Can we brake it for them? Should we brake it?
If we keep the option where it should be documented.
There is an increasing need to add tests for RN part.
Where is resetStorybook option used at all? What does it bring. Why would we want to reset channel if it already exists?