kenoxa / svelte-jsx

jsx for svelte to simplify testing
MIT License
35 stars 2 forks source link

request: remove implicit "onMyHandler" => "on:myhandler" replacement on prop names #68

Closed larrybotha closed 3 years ago

larrybotha commented 3 years ago

It looks as though this may have been added as a convenience, but it prevents tests from being run on components that have a legitimate onHandler prop.

e.g.

<Form onSubmit={...}>
  {...}
</Form>

With the replacement at https://github.com/kenoxa/svelte-jsx/blob/main/src/jsx-runtime.js#L49 one can't pass onSubmit down to Form - it'll always be replaced with on:submit.

Ideally only the underscored events, as per the docs, would be replaced with Svelte's internal directives and handlers. Everything else would be treated as a legitimate property to the component.

sastan commented 3 years ago

Could you provide a PR for this change?

larrybotha commented 3 years ago

@sastan will do over the weekend - thanks for considering :)

This will likely need a major version bump once merged.

sastan commented 3 years ago

Published as svelte-jsx@2.0.0