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
feat: add JSON control #319
Conversation
✅ Deploy Preview for histoire-examples-vue3 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for histoire-site ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for histoire-examples-svelte3 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for histoire-controls ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
You sure? Bundling Ace editor looks to be less than 400kB(minified)/106kB.gzip. For the Vue Repl, we use codemirror which is lighter, weighting around 170kB/57kB.gzip for the usage we have in the Repl. Anyway the code editor lib should be code-split with a dynamic import. |
You're right, I looked at the unpacked size 😅... Still, I think that those packages were quite heavy only to write JSON, but I can still use it if you prefer (be it ace or codemirror)
It will likely be loaded for a lot of stories with a somewhat complex props (with the auto-detect props) So, what do you want me to do? I have no preference, it's really up to you 🙂 !
|
A dynamic import will ensure it's only loaded when necessary, having it multiple times it not a problem.
I think codemirror would be a good choice. |
#30
Description
I spent a fair amount of time trying different implementations, tell me what you think...
Anyway, I believe that we really just need color highlight, no-one's going to use Histoire as a real code editor.
Also, I auto indent only on load, but not after (because it can mess up the content during edition if I do it at each update).
Note: The lite/dark mode is not reactive, you must refresh the page. I'm not quite sure how to do that, if you have any idea.
Additional context
What is the purpose of this pull request?