optimizer: pre-translate jsx event handlers onClick$ => on:click
#319
wmertens
started this conversation in
Proposals For Qwik
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is it about?
onClick$ => on:click
What's the motivation for this proposal?
We translate
onX$toon:xin jsxNode, but for string tags without spread props we can do the translation in the optimizer.Proposed Solution / Feature
Where it matches the jsx handler names, it should check for string tags and not having spread props following, and then it can translate according to these rules:
The prefix
window:onbecomeson-window:,document:onbecomeson-documentand otherwiseon:. Then the rest of the name without the final$is lowercased, except:-=> strip the-instead of lowercasing.Finally, the name is kebabcased,
[A-Z-]are replaced with-+the lowercase letter.Links / References
No response
Beta Was this translation helpful? Give feedback.
All reactions