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

Features to speed development #274

Open
debugwand opened this issue Apr 24, 2019 · 5 comments
Open

Features to speed development #274

debugwand opened this issue Apr 24, 2019 · 5 comments
Labels
enhancement New feature or request housekeeping Cleaning things up

Comments

@debugwand
Copy link
Contributor

Right now, if I make changes to a component I have to stop storybook, rebuild with athloi and then restart storybook (athloi run build --filter 'keywords:"x-audio"' && npm run start-storybook)

This could be speeded up by adding watch and hot reloading

@debugwand debugwand added the enhancement New feature or request label Apr 24, 2019
@apaleslimghost
Copy link
Member

apaleslimghost commented Apr 24, 2019

Yeah, it's not a good experience right now. It used to be better, and I don't know what happened (maybe something we lost in the move to Athloi?).

FWIW, Storybook does hot reload, but the components don't build. Some components (e.g. x-teaser) have a watch or start script, but you have to run it separately, manually, and it's not done in a standardised way, and it's not documented anywhere.

@i-like-robots
Copy link
Contributor

i-like-robots commented Apr 24, 2019

Unfortunately this is a symptom of Storybook not being installed at the repository root, details in #177.

Storybook can only watch files which are descendants of the working directory

We "fixed" this in Anvil by moving Storybook to the top-level and ensuring stories load component source files rather than the package for distribution.

We will hopefully port what learned with Anvil into x-dash in the near future.

@apaleslimghost
Copy link
Member

apaleslimghost commented Apr 24, 2019

See also #198. At one point we had watching/hot reloading working without toplevel Storybook by having a single command to start Storybook and the watch builds of every component; I'm not sure when we lost that. I tried toplevel Storybook in #203 and it worked, but slowly, using require.context. I see you've taken a different approach in Anvil.

Now that the docs are using Storybook's generated iframe.html files (#155) I think we can step away from the abstract story format which was only there so Gatsby could generically consume stories without using Storybook's API.

Given that, it's likely feasible to use storiesOf directly in stories and use them as multiple Webpack entry points instead of using require.context or templates.

@i-like-robots
Copy link
Contributor

Yes, I definitely agree. The details are lost to me now, but as you say we are no longer attempting to do what we originally tried to do with Storybook.

Moving away from the custom config sounds like a good plan.

@i-like-robots
Copy link
Contributor

I've made some further changes in #336 which enable component stories to be authored in the regular manner documented by Storybook and import components directly from source.

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

No branches or pull requests

3 participants