You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi again, @cblavier! For a few weeks, I've been playing with the idea of allowing almost-arbitrary Elixir code to be used as an attribute value in the Playground. It's seems a pity to me that only a subset of attributes can be modified in the Playground, often times the attributes I would like to edit are locked.
What do you think about evaluating the value in case its type is not a string? For example, that it would be possible to pass [%{id: "john", name: "John"}, %{id: "jane", name: "Jane"}] to the rows attribute of the table/1 component from CoreComponents. Or passing %{name: "my-input", disabled: true} to the global rest attribute of an input.
It might be not safe to execute arbitrary code though, because in case the Storybook was running on a public server, this would give a random Storybook visitor full control over the server. Therefore, I suggest keeping this feature opt-in, disabled by default. Additionally, it might be useful to use dune or something like that.
The text was updated successfully, but these errors were encountered:
Hi again, @cblavier! For a few weeks, I've been playing with the idea of allowing almost-arbitrary Elixir code to be used as an attribute value in the Playground. It's seems a pity to me that only a subset of attributes can be modified in the Playground, often times the attributes I would like to edit are locked.
What do you think about evaluating the value in case its type is not a string? For example, that it would be possible to pass
[%{id: "john", name: "John"}, %{id: "jane", name: "Jane"}]
to therows
attribute of thetable/1
component fromCoreComponents
. Or passing%{name: "my-input", disabled: true}
to the globalrest
attribute of an input.It might be not safe to execute arbitrary code though, because in case the Storybook was running on a public server, this would give a random Storybook visitor full control over the server. Therefore, I suggest keeping this feature opt-in, disabled by default. Additionally, it might be useful to use dune or something like that.
The text was updated successfully, but these errors were encountered: