Skip to content
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

Allow IDE plugin server to run without preview tab #1142

Open
kevinbarabash opened this issue Oct 26, 2022 · 5 comments
Open

Allow IDE plugin server to run without preview tab #1142

kevinbarabash opened this issue Oct 26, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@kevinbarabash
Copy link

Is your feature request related to a problem? Please describe.
I like viewing the component in the browser b/c I'm able to use the full power of the browser's dev tools. I tried using the CLI version, but I had to save changes to the file before they showed up. If I used the IDE plugin and opened the preview in the browser changes show up immediately, but... I had to keep the preview open inside the IDE as well which seems a little silly.

Describe the solution you'd like
I'd like to be able to run preview.js using the IDE plugin, but not have to keep the preview.js tab open in the IDE while I'm viewing components in my browser.

Describe alternatives you've considered
I tried using the CLI version, but I had to save changes to the file before they showed up.

@kevinbarabash kevinbarabash added the enhancement New feature or request label Oct 26, 2022
@kevinbarabash
Copy link
Author

This appears to be working now. I'm not sure what I was doing differently before, but it wasn't. I'll re-open if it happens again with more info.

@kevinbarabash
Copy link
Author

It looks like it works for a bit and then the server dies after a while.

@kevinbarabash kevinbarabash reopened this Oct 26, 2022
@fwouts
Copy link
Owner

fwouts commented Oct 26, 2022

Hey @kevinbarabash, the way it works right now is that the server keeps running while it's getting regular pings, but it stops after a little while otherwise.

What I'm guessing is happening in your case is that you're perhaps switching to a different browser tab so the Preview.js browser tab is put to sleep and no longer pinging, and Preview.js thinks the tab is now closed so it shuts itself down.

I'll admit this is a bit of a design flaw on my part! Any ideas how else we could make sure that the server does stop at some stage when it's no longer needed, but not too early?

@kevinbarabash
Copy link
Author

Having the option to manually start/stop the server could work. I'm guessing the server uses less resources than starting up Storybook. It would be nice to have a config option to auto-start the server when opening project in your IDE.

@fwouts
Copy link
Owner

fwouts commented Jul 18, 2023

Hey @kevinbarabash, since v1.24 released a couple of weeks ago, the Preview.js server will stay open until you explicitly stop it, so you can close the panel and not have to worry about the server stopping automatically.

Next step will be to add a setting to skip opening a panel altogether and directly open a browser, then your feature request will be fully supported!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants