-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix: Temporarily disable save from UI feature #285
Conversation
I wonder if we should also create a separate issue to restore this feature in the future. Whenever it is feasible to do so. I mean, the part where Storybook addons are able to control/override what is being inserted into the original code of the stories file(s). This would need exploration on the Storybook core internals. |
Nice! I think we can simplify it. Parameters don't have to be statically analysable (and they can't be, because they're very dynamic), so maybe we should be able to get away with this by just setting the parameter at runtime here: https://github.com/storybookjs/addon-svelte-csf/blob/next/src/runtime/create-runtime-stories.ts#L51 Which seems a lot simpler to me than the current AST-based approach? (I know this context is a little late to give now, sorry 🙇) I'm fine with the refactor you did to the AST parsing for the parameters/description though, if you still want to keep that around.
Yes we can do that. |
Hm, I haven't though of that 🤔.
No worries ❤️! |
I'm a little puzzled by what you meant that By parameters I mean My point is, that there is no need to set the parameter directly in the source using AST, it's totally fine to do it at runtime, which I'd expect to be simpler here. The problem with the description is that to get the description from the comments, you have to do static analysis with the AST, but when you have that information you don't need to set Am I making any sense? 😅 |
Yes, thank you! I've pushed the latest commit, with mutating I also tried manually adding I'm missing something, do you see it? |
Haha, it's really subtle in the docs, but it's actually https://storybook.js.org/docs/essentials/controls#parameters-1 |
Resolves #240