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 hangs viewing Doggo source #232

Open
ahacking opened this issue Feb 14, 2024 · 4 comments
Open

Storybook hangs viewing Doggo source #232

ahacking opened this issue Feb 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ahacking
Copy link

Describe the bug
When using storybook and viewing there source of a Doggo component the file is so large that the browser hangs mand becomes unresponsive processing the mark up.

To Reproduce
Steps to reproduce the behavior:

  1. Using Doggo 0.5.0, setup storybook as per the docs.
  2. Click the source button in the top right when viewing a component.
  3. Wait, .. wait some more, browser is unresponsive.

Expected behavior

  1. Just display the minimal and relevant code.
  2. Code is organised into component module files rather than a single huge file.

Whilst this seems like the root cause may be a storybook issue, a single large file with all components is not ideal.

Please consider breaking out components into separate module files such as accordion.ex, button.ex etc

@ahacking ahacking added the bug Something isn't working label Feb 14, 2024
@woylie
Copy link
Owner

woylie commented Feb 14, 2024

Which browser are you using? It works just fine for me in Firefox (browser is responsive).

@woylie
Copy link
Owner

woylie commented Feb 14, 2024

Safari doesn't have an issue with this either, but Chrome is weak.

@woylie
Copy link
Owner

woylie commented Feb 14, 2024

Anyway, I don't think putting each function component into its own module is reasonable. Maybe phoenix_storybook could be updated to extract the relevant lines from the source code.

I'm planning to make the components customizable in a future version, which would have an impact on the source code display, though, so I don't think it's worth it to think about the module structure of doggo at this point.

@ahacking
Copy link
Author

Which browser are you using? It works just fine for me in Firefox (browser is responsive).

Sorry I intended to provide that in the original report. I was just testing it with Brave which is chromium based.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants