3 ms·
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 + querySele
by overcast 11y ago
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.
- krat0sprakhar 11y agoHave you checked out Lea Verou's Bliss.js? http://blissfuljs.com/ http://blissfuljs.com/ It's super minimal and basically relies on querySelector. Give it a whirl and see if it fits your needs.
- overcast 11y agoCool! I'll check it out thanks. Deep Clone is required though, I'll poke around.
- pygy_ 11y agolodash.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.
- cubano 11y agoVery cool...been looking for something like that for a project I am working on right now, as a matter of fact.
- _RPM 11y agoI'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
- overcast 11y agoIt'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.
- jeresig 11y agoIt does! https://github.com/jquery/sizzle/blob/master/dist/sizzle.js https://github.com/jquery/sizzle/blob/master/dist/sizzle.js
- overcast 11y agoI 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.
- kyriakos 11y agoI mostly use it because it's a dependency in so many other stuff that I end up using in my projects.
- leeoniya 11y agolook at https://github.com/finom/bala https://github.com/finom/bala (or balalaika by same author) also sprint.js and cash.js
- nsonnad 11y agoNot 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 https://github.com/d3/d3-selection
- epidemian 11y agoAt 4.4KB (gzipped), it seems like a really good alternative to jQuery. Thanks for the suggestion!
- deleted 11y ago[deleted]