-
-
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
CLI option for start-storybook to not open the browser #6201
Comments
Hi @simbo. AFAIK the Are you proposing:
|
It seems so... :) |
Alias. I'm fine with adding a Default value. As for changing the default to |
It may not be the same. I think CRA handles this in a graceful way and could be adopted. Key differences are:
Relevant CRA documentation For me, start-storybook opens a tab in a backgrounded window of a different browser everytime I restart it. |
One example of such prompt is about running Storybook an alternative port when the requested one is busy. That can be quite useful sometimes. So I think, |
Yeah, that's why I didn't copy that approach as-is |
personally i would prefer |
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! |
Does anybody prefer the current behavior? If not, I think we can make the change |
I do. Actually I'm kinda relying on it as an indication that storybook has finished building |
maybe we just provide both cli flags: |
I would prefer a --no-open flag as well. Do everything that is currently default, just skip opening a new browser. I VERY often have an existing window open but must close and re-start the storybook process (due to configuration changes, etc), so I cannot rely on the auto-restart. In those cases, I just don't want a new browser. |
@kutenai Can you just run with |
It appears to work fine for me. Maybe the option is just misleading, as it kind of implies that it does "more" than I want, but in practice, it seems to work fine. |
FWIW, create-react-app lets you set a |
You actually liked my comment that says that it should be a separate option |
Yeah I'm absolutely on board with making |
The For now: |
It should, and does on most changes, but not all changes. I'm currently setting up a new Storybook and fiddling around with it, so yes I ended up with 10 tabs in a few minutes.
I could still open the browser, it'll just tell me 'Connection refused'. I think it's more annoying that after a minute or 2 suddenly a browser is popping up while I'm doing something else. Note I'm seeing this pattern across the industry, and where used, issues, & (stackoverflow) questions pop up everywhere how to disable it. I heavily dislike the pattern as a default, especially since targeting the same tab isn't solid technology. Meanwhile, once opened, a disconnect to the 'server' could start polling and reload once it comes back up again. |
* install & configure storybook (via magic npx script) * fix indentation in storybook generated files * eslint ignore generated storybook files (for now at least) * unhide storybook folder, consistent with Gutenberg project * demo story for one of our components (with no css/styles) * hack in scss webpack config & add story for button: - fixes scss imports breaking storybook build - note scss / styling doesn't work yet + organise our component stories into folder * git ignore storybook-static build folder * pin dependencies for storybook * piggy-back off main webpack config for storybook module.rules (for scss) * use gutenberg (wp-components) styles in storybook * use system font for storybook, consistent with wp-admin/gberg and reasonable default for components in front end * add --ci flag to prevent storybook opening new browser tab… - see also storybookjs/storybook#6201 * rename default stories to Default (following Gutenberg pattern) * add story for ErrorPlaceholder * failing ProductPreview story (committing to PR as an example for discussion) * storybook for components/icons * fix aliased dependencies in components for storybook: append our webpack aliases to storybook webpack config * basic story for PriceSlider (looks right but interaction broken) * fix PriceSlider user interaction: - PriceSlider expects client to handle onChange and pass in new min/max * add comment about priceslider max/min (todoish) * remove default stories from storybook scaffolding * organise stories by module (aka folder in codebase) * package-lock update after rebase * remove unnecessary ignores (default stories are gone) * delete experimental/risky/broken stories: - icons components are changing in #1644 - we need to refactor/do more work to get ProductPreview working (settings globals) * remove unnecessary import * clarify PriceSlider component intended usage comment in story * remove redundant wrapper divs from stories * add common storybook addons (used by Gutenberg storybook) * rebuild package.lock after rebase * remove unnecessary wrapper div * package fixes after rebase * add configuration for storybook source loader * add decorators for a11y and knobs plugins * remove unnecessary react import & import useState from WP Co-authored-by: Darren Ethier <[email protected]>
* install & configure storybook (via magic npx script) * fix indentation in storybook generated files * eslint ignore generated storybook files (for now at least) * unhide storybook folder, consistent with Gutenberg project * demo story for one of our components (with no css/styles) * hack in scss webpack config & add story for button: - fixes scss imports breaking storybook build - note scss / styling doesn't work yet + organise our component stories into folder * git ignore storybook-static build folder * pin dependencies for storybook * piggy-back off main webpack config for storybook module.rules (for scss) * use gutenberg (wp-components) styles in storybook * use system font for storybook, consistent with wp-admin/gberg and reasonable default for components in front end * add --ci flag to prevent storybook opening new browser tab… - see also storybookjs/storybook#6201 * rename default stories to Default (following Gutenberg pattern) * add story for ErrorPlaceholder * failing ProductPreview story (committing to PR as an example for discussion) * storybook for components/icons * fix aliased dependencies in components for storybook: append our webpack aliases to storybook webpack config * basic story for PriceSlider (looks right but interaction broken) * fix PriceSlider user interaction: - PriceSlider expects client to handle onChange and pass in new min/max * add comment about priceslider max/min (todoish) * remove default stories from storybook scaffolding * organise stories by module (aka folder in codebase) * package-lock update after rebase * remove unnecessary ignores (default stories are gone) * delete experimental/risky/broken stories: - icons components are changing in #1644 - we need to refactor/do more work to get ProductPreview working (settings globals) * remove unnecessary import * clarify PriceSlider component intended usage comment in story * remove redundant wrapper divs from stories * add common storybook addons (used by Gutenberg storybook) * rebuild package.lock after rebase * remove unnecessary wrapper div * package fixes after rebase * add configuration for storybook source loader * add decorators for a11y and knobs plugins * remove unnecessary react import & import useState from WP Co-authored-by: Darren Ethier <[email protected]>
Proposal: Instead of doing all this, can we just add a message to CLI output notifying the user of |
Where can we see these improvements? |
Available in 6.0-beta. #10329 |
I am not sure how this is related to continuous integration. In fact I am developing and it is annoying that storybook opens the browser on start. I am not doing ci so imo the naming is not correct. I would like to have a |
I landed here trying to stop the browser window from opening. If it could detect an existing open tab and reuse it I think 99% of people would be fine with that. But the concern with this issue (which has 47 upvotes at current) is that they simply don't want to have the browser window open and |
Hi everyone! I've take a look at the code of the library used to open the browser (beter-opn) and I've found these lines case Actions.NONE:
// Special case: BROWSER="none" will prevent opening completely.
return false; I've tried to add the environment variable Here's what I have in my
A simple mention of the environment variable in the documentation could do the job. No code would need to be changed for it to work 🎉 🙂 |
cc @jonniebigodes ☝️ |
Proposal: create a |
Yee-haw!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-alpha.23 containing PR #15739 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Opening an entire browser window by default is heavily opinionated and obtrusive. |
Yeah can we please make Focusing the browser and opening a new tab when Storybook is ready is disorienting and really annoying |
Is your feature request related to a problem? Please describe.
I restart
start-storybook
from time to time for different reasons from changed config to working on other things. Nevertheless, I do not close my storybook browser tab. And asstart-storybook
opens a new browser tab every time it starts, my tab bar gets filled up with multiple storybook tabs between other tabs. It's annoying and leads to confusion and tab cleanup time...I also noticed my colleagues doing the same things resulting in the same problems...
And I was a bit surprised, that I couldn't find an option to not open the browser...
I know, there is
--ci
to skip interactive prompts and not open the browser, but it also skips interactive prompts. Although I didn't see any interactive prompts yet, using ci mode for daily usage just doesn't feel right...Describe the solution you'd like
start-server --no-open
should build and serve as usual but not open the browser window.Describe alternatives you've considered
Opening the browser with
start-storybook
should be disabled by default and can be enabled by using--open
.Webpack supports the
--open
/--no-open
flags which are also mirrored by other CLIs which use webpack internally.angular cli and vue cli offer the same flags and - like webpack-dev-server - don't open the browser by default.
From my personal perspective, opening the browser by default is an opinionated bad-practice.
But I know, there are different opinions about this out there... :)
Are you able to assist bring the feature to reality?
Yes, I could dig into this and make a PR.
Additional context
Anybody want a screenshot of my browser tab bar filled with storybook tabs? ;)
The text was updated successfully, but these errors were encountered: