Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



how about literal DOM elements?

    #menu.add(.sliderMenu)
e.g. #,., maybe % or _ before elements, and you have a much more fluent syntax.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: