3 ms·
Cash's maintainer here. I don't think this is true actually. Zepto supports some methods that Cash doesn't, but you probably shouldn't use them to begin with,
by fabiospampinato 5y ago
Cash's maintainer here. I don't think this is true actually.
Zepto supports some methods that Cash doesn't, but you probably shouldn't use them to begin with, like $.ajax, $.isArray, $.fn.animate etc. In 2022 either better built-in solutions exist or better specialized tiny libraries exist.
Everything that is supported by both Zepto and Cash should either work identically or Cash's implementation should be closer to jQuery's. Just to mention one thing in this regard you can run jQuery's test suite with Cash, and Cash's test suite with jQuery, easily [0]. I've done so and looked at every single failed test manually a few times, I doubt nearly the same level of attention went into Zepto. Just to mention one difference: Cash supports jQuery-style event namespacing, Zepto just doesn't support this, it is implementing something that looks similar but that works differently in pretty important aspects, that's worse than not supporting obsolete methods IMO, but I guess it depends on your use case for a library like this.
[0]: https://github.com/fabiospampinato/cash/blob/272132a6dc1d885bc25d2874b5740da208698e00/package.json#L29-L35 https://github.com/fabiospampinato/cash/blob/272132a6dc1d885...
- franciscop 5y agoUmbrella JS maintainer here (the library this HN thread is supposed to be about). At 2.8kb gzipped UmbrellaJS doesn't support partial builds because that'd be a bit funny. Also, and it seems to be something the author of the article likes a lot, Umbrella JS is closer to Javascript than the libraries you mention (& jQuery). Sure that means you need a bit of editing your code (which is made easy by being able to load both jQuery and Umbrella at the same time), but in the end you have a lot better result. Plugins are just methods extending the prototype, loop methods have similar arguments as Array's methods, which in turn makes it easier than ever to use arrow functions, etc. But IMHO the killer feature of Umbrella JS is that it's quite well documented, every method has at least an example but usually few, where e.g. cash doesn't have any example interleaved. Basically this would be my recommendation/conclusion: - If you have thousands of lines of Javascript/jQuery, I'd recommend Cash/Zepto instead. - If you just use jQuery for few methods/interaction, 100% go with Umbrella JS.
- fabiospampinato 5y agoI didn't mean to hijack the thread, I was just replying to somebody saying something about Cash :) I'm ambivalent regarding your documentation point, on one end jQuery is way more popular and one can largely just read jQuery's documentation for the methods that Cash implements too. On the other end that doesn't quite work when Cash's implementation works a bit differently than jQuery's, and just having a consistent, good, documentation is better in that case, and probably in general too. I don't personally care much which libraries people use for their needs, personally I'm trying to incrementally move away to Cash and other jQuery-like direct DOM manipulation libraries entirely, but it takes time.
- jffry 5y ago> the library this HN thread is supposed to be about Articles can absolutely just be seeds for discussion, and I think the theme of replacing jQuery is quite relevant across the industry as motivators like "support IE" are increasingly falling away.