2 ms·
We had a separate jQuery-like lib that we wrote in Dart for a while before we figured, "why not just make the main DOM API better"? So this stuff: document
by munificent 15y ago
We had a separate jQuery-like lib that we wrote in Dart for a while before we figured, "why not just make the main DOM API better"? So this stuff:
document.query('#menu').nodes.add(sliderMenu.node);
Is a reflection of that. The ".node" part after sliderMenu will go away at some point. Our DOM lib doesn't currently work like jQuery's "collection-that-acts-like-an-object" style because we're worried about performance.
Keep in mind that you can always ditch jQuery and go straight to the DOM if jQuery is too slow. If jQuery was the only way, you'd lose your fast path.
So we've tried to come up with a DOM API that's easier to use, but still performant. If you've got ideas for how we can improve it, we'd definitely like to hear them.
- radagaisus 15y agohow about literal DOM elements? #menu.add(.sliderMenu) e.g. #,., maybe % or _ before elements, and you have a much more fluent syntax.