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

Storybook: Enable single command hot reloading #584

Open
michael-iden opened this issue Aug 17, 2023 · 3 comments
Open

Storybook: Enable single command hot reloading #584

michael-iden opened this issue Aug 17, 2023 · 3 comments

Comments

@michael-iden
Copy link
Contributor

michael-iden commented Aug 17, 2023

Expected behavior
Hot reloading of storybook works with a single command

Actual behavior
We need to run two commands to get hot reloading to work

Steps to reproduce the issue

  1. Start storybook
  2. Make a change in the pharos component code
  3. See that the changes are not reflected in storybook

Additional information

See description in #582 and #579

@satya-achanta-venkata
Copy link
Contributor

satya-achanta-venkata commented Oct 6, 2023

@daneah @michael-iden I would like to fix this and spent some time looking into this. I almost fell in rabbit hole when I started looking into vite HMR feature (because we use vite builder, so I thoughts its builder's job to perform hot reload). But realized the fix could be as simple as adding yarn workspace @ithaka/pharos build:tsc:watch to list of commands currently running in yarn storybook:wc:dev

@daneah
Copy link
Member

daneah commented Oct 6, 2023

@satya-achanta-venkata I have tried that but it creates a conflict somewhere that interferes with icons in particular, likely because they're dynamic modules. It needs deeper investigation.

@satya-achanta-venkata
Copy link
Contributor

@daneah After your comments, I realized that icons were not loading and I believe dynamic import statement in icons is causing the issue and I found these docs. I am seeing some interesting Note in the docs saying that Note that variables only represent file names one level deep. If file is 'foo/bar', the import would fail. For more advanced usage, you can use the [glob import](https://vitejs.dev/guide/features.html#glob-import) feature. I will look into it sooner as I got two other issues I assigned myself for. Thanks for the quick response earlier, @daneah . I just wanted to make sure I was not going deep in rabbit hole.

@daneah daneah changed the title Enable single command hot reloading for storybook Storybook: Enable single command hot reloading Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants