Live data from Hacker News

Google open-sources JsAction, a JavaScript event delegation library

github.com

1–10 of 48 posts

Re: Google open-sources JsAction, a JavaScript event delegation library

#4
post #2

Interesting. This might have come from the Google+ development team, as this and something called "jsmodel" are part of that product. You can see traces of both of these in the DOM of plus.google.com

Actually you can also see traces of the jsaction attribute in the G+ product. G+ isn't using this from the group up though. It has a pretty long history at Google, so I'm not even sure where it came from. Should have been either Maps or Search.

Re: Google open-sources JsAction, a JavaScript event delegation library

#5
Is it just me, or does this not seem "tiny" at all? It seems to require a bunch of Closure modules, and on top of that the source itself is hundreds of lines (albeit with comments).

Nitpicking aside, it looks like an interesting approach to decoupling the DOM from your event handlers. Personally I'm happy sticking with the standard on{event} attributes for really simple stuff.

Re: Google open-sources JsAction, a JavaScript event delegation library

#7

Is it just me, or does this not seem "tiny" at all? It seems to require a bunch of Closure modules, and on top of that the source itself is hundreds of lines (albeit with comments). Nitpicking aside, it looks like an interesting approach to decoupling the DOM from your event handlers. Personally I'm happy sticking with the standard on{event} attributes for really simple stuff.

It is 2.5KB to 6KB (depending on enabled flags) gzipped which is still in the realm on inlining into the HTML – thus avoiding a roundtrip for enabling event handling (even if all the handlers do is download the modules that have the actual implementation).
Post reply on HN