qwik
qwik copied to clipboard
feat: Improve Event Map and Manifest
What is it?
- [x] Feature / enhancement
- [ ] Bug
- [ ] Docs / tests
Description
Circling back to a previous PR, It seems like unnecessary maintainence overhead to have a map of pascal case events and their DOM Event types.
Typescript already has an Event Map that we can use and will ensure that Qwik's Pascal Cased event names are always in sync with their DOM equivalents. If new events are needed, maintainers will just need to add a new Event Name to the union, and everything else will automatically be correct.
Also fixes the naming of Focusin and Focusout to be proper pascal case (FocusIn, FocusOut), first mentioned in #508. Further, manifest.ts is modified to ensure a type error if it becomes out of sync with Event types.
Note: I haven't checked it this change resolves the above mentioned issue. However, the naming change is still desirable for consistency.
Checklist:
- [x] My code follows the developer guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] Added new tests to cover the fix / functionality
@manucorporat Not sure if the *Capture variants of events are still necessary (I don't see any mention in the docs), but if they are not, this can be simplified further.
Yeah! i dont think Capture works, not sure why it's there, tomorrow going to check with Misko and Adam and get back to you
Thanks again for the PR!
I already removed them, but I'll add them back if needed. I should probably add an e2e test to see if this closes that issue.
This is a very old PR. it's stale and I close it. @nnelgxorz feel free to reopen it if you would like to continue with it.