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
Writing stories for this one example component will create arg table like this:
As you can notice, there are some duplicates. Because svelte/elements provides deprecated event handlers types for v4 - for the backwards compatibility support.
In Svelte v5 there's been a breaking change by removing the : from event handlers.
So for example on:click becomes onclick.
Describe the solution you'd like
We can improve the DX by filtering out those deprecated event handlers starting with on:*.
Use detection if Svelte v5 is being used and filter out argType names that start with on:.
Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is your feature request related to a problem? Please describe.
The automatic argTypes extraction for Svelte since
v8.4
is 🔥 🔥 🔥 🩷 🧡 !There's one gotcha that makes it a little too verbose and annoying. And this is for Svelte
v5
.Is it a common practice to extend types from
svelte/elements
where you can get types for event handlers.Example component code:
Writing stories for this one example component will create arg table like this:
As you can notice, there are some duplicates. Because
svelte/elements
provides deprecated event handlers types forv4
- for the backwards compatibility support.In Svelte
v5
there's been a breaking change by removing the:
from event handlers.So for example
on:click
becomesonclick
.Describe the solution you'd like
We can improve the DX by filtering out those deprecated event handlers starting with
on:*
.Use detection if Svelte v5 is being used and filter out argType names that start with
on:
.Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
yes, I can
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions