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

I think it's time to check out a jquery alternative. My recent projects are basically only using deep copies and some semi-complex selectors. lodash + querySelector should cover pretty much everything at this point.


Have you checked out Lea Verou's Bliss.js? http://blissfuljs.com/ It's super minimal and basically relies on querySelector. Give it a whirl and see if it fits your needs.


Very cool...been looking for something like that for a project I am working on right now, as a matter of fact.


Cool! I'll check it out thanks. Deep Clone is required though, I'll poke around.


lodash.cloneDeep is available as a standalone npm module (as are all lodash functions).

It clocks at 2.5KB mingzipped, after browserification.

There are probably lighter implementations.


Not to be forgotten is d3, which in addition to selectors allows you to very easily bind data to the DOM. And with the big 4.0 refactor that is underway, you can very easily pull in the selection[1] stuff only.

[1] https://github.com/d3/d3-selection


At 4.4KB (gzipped), it seems like a really good alternative to jQuery. Thanks for the suggestion!


I've seen projects that use jQuery just for the selector part, nothing else is used. Selectors are a core strength of jQuery. With document.querySelector, I wouldn't even include jQuery in a new project. `window.addEventListener` isn't much different than .on


It's used out of convenience, and avoiding errors. jQuery selectors are stupidly simple to do complex stuff with. I just wish they had a jQuery.selector distribution.



I looked at sizzle, but is it just me, or is the syntax not anywhere near as convenient as jQuery? Doesn't seem like it's making anything easier.


I mostly use it because it's a dependency in so many other stuff that I end up using in my projects.


look at

https://github.com/finom/bala

(or balalaika by same author)

also sprint.js and cash.js




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

Search: