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

Story files as .exs #2

Closed
LostKobrakai opened this issue Aug 1, 2022 · 6 comments · Fixed by #10
Closed

Story files as .exs #2

LostKobrakai opened this issue Aug 1, 2022 · 6 comments · Fixed by #10

Comments

@LostKobrakai
Copy link
Contributor

I just looked through the README and noticed that the story files are .ex files, but one also needs to supply a path for where those files are. I'm wondering if those files should rather be .exs files, so they're not compiled by default, but only used by the storybook. I feel like this is a similar setup to test files, which also are .exs files.

@cblavier
Copy link
Contributor

cblavier commented Aug 1, 2022

Since all the storybook content is pre-compiled through macros, all stories would be executed at compile time to fetch their content.

We wouldn't benefit much from this change. Would we?

@LostKobrakai
Copy link
Contributor Author

This is less about changing how those modules are used, if they're meant to be used, but more about that one probably doesn't really want those modules to continue to exist after compilation, in production, outside of the storybook, …. Just like test files are only compiled to run tests and only the ones which are actually executed.

@cblavier
Copy link
Contributor

cblavier commented Aug 1, 2022

I think I got your point.
But do you think they would still belong to /lib folder?

@LostKobrakai
Copy link
Contributor Author

LostKobrakai commented Aug 1, 2022

I personally would probably keep them outside, but also it's not a clear cut picture. Phoenix templates (can be .exs files as well) are also not really to-be-compiled elixir files and within /lib.

@cblavier
Copy link
Contributor

cblavier commented Aug 1, 2022

Thanks for your insight. I'll try it with exs files and let you know how it goes!

(and you also deserve a special 🥇 for being the first issue opened here ;-)

@LostKobrakai
Copy link
Contributor Author

I'm really interested in this, so happy to help. I've been a big fan of fractal, but it's not really a great fit for elixir and I've also tried to build similar projects before, but never got them anywhere usable.

@cblavier cblavier linked a pull request Aug 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants