Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom event type facades #2

Open
buntec opened this issue Feb 19, 2024 · 2 comments
Open

Custom event type facades #2

buntec opened this issue Feb 19, 2024 · 2 comments

Comments

@buntec
Copy link

buntec commented Feb 19, 2024

First of all, I wanted to say thank you for this library (and domtypes, of course, which made writing my own UI lib possible in the first place)!

I've been trying to adapt it to a UI lib I've been working on. Everything works great so far except for one little thing: I think the facades for custom event types don't quite work b/c custom fields should be nested inside a detail field. See here. There is a nice solution for this here. I've managed to work around it by changing the source generator ever so slightly. (I also really like the EventWithPreciseTarget idea from that project, which I've also adopted).

In the long run, it would be really great to see the codegen factored out into a lib. I'd be happy to help!

@raquo
Copy link
Owner

raquo commented Feb 19, 2024

Yeah that would be nice to have. I didn't realize the detail field was an actual standard, I thought it was just a UI5 thing. But looks like even Shoelace uses it for some events...

If you can point me to the changes you made to support this use case, maybe I'll be able to incorporate them eventually, but just to set the expectations – no promises, especially in terms of timeline. My focus is just elsewhere right now, I don't know when I'll be able to get back to Shoelace.

@buntec
Copy link
Author

buntec commented Feb 19, 2024

All relevant changes are in this commit. The naming of the custom event types should probably be changed to something like CopyEventDetail, ErrorEventDetail, etc. to reflect the new usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants