nteract / vdom

🎄 Virtual DOM for Python
https://github.com/nteract/vdom/blob/master/docs/mimetype-spec.md
BSD 3-Clause "New" or "Revised" License
221 stars 34 forks source link

Move event handlers out of attributes #76

Closed gnestor closed 5 years ago

gnestor commented 5 years ago

Closes https://github.com/nteract/vdom/issues/70

This leaves the UX the same:

my_button = button('Click me', onClick=handle_click)

However, it moves event handlers out of VDOM.attributes so that they can be handled separately from regular attributes.

This also modifies the message spec to make eventHandlers a top-level property.

A couple point to discuss:

rgbkrk commented 5 years ago

Thank you Grant!

@yuvipanda if you get a chance I'd love for you to look over this PR as we work on getting the next VDOM release out. We're in a bit of a standstill with some good changes both for using vdom as templates and for interactive notebookiness. Now the event handlers are being moved to a new top level key (that we can ignore for HTML out) and I'd love to get your feedback.

rgbkrk commented 5 years ago

Ready to ship this @gnestor?