3 ms·
Awesome. My problem is I've been waiting for 4.0 soooo long I ended up making my own jQuery with some key differences: * Animations, tweens, timelines use pu
by geenat 3y ago
Awesome. My problem is I've been waiting for 4.0 soooo long I ended up making my own jQuery with some key differences:
* Animations, tweens, timelines use pure CSS, instead of jQuery's custom system.
* Use one element or lists transparently.
* Inline <script> Locality of Behavior. No more inventing unique "one time" names.
* Vanilla first. Zero dependencies. 1 file. Under 340 lines.
https://github.com/gnat/surreal https://github.com/gnat/surreal
That said, it's fantastic to see 4.0 here, and I'll certainly be upgrading my many sites that use it!
- panphora 3y agoI've always thought there should be a modern, lightweight jQuery alternative like this. Well done! I love the syntax and have been implementing something similar (although with inline events and more than just the standard array methods). [0] Do you have an article/screencast on how the locality of behavior is implemented in both surreal and its companion project css-scope-inline? I'd love to understand it so I can maintain it longterm and add it to my own projects. I'd love to talk with you about your philosophy of the web. I think we could sync up about some things! [0] https://hyperspace.so/All.js.png https://hyperspace.so/All.js.png
- niutech 3y ago> I've always thought there should be a modern, lightweight jQuery alternative like this. Have you heard of Zepto? https://zeptojs.com https://zeptojs.com
- panphora 3y agoYes, thank you! Zepto is great and it's nice it's jQuery compatible. I've used it before and liked it. However, I guess I was thinking something a bit more modern -- adding more advanced functionality than what jQuery has. Like more array methods for elements (e.g. `pluck` elements based on property values), reactive data stores/templating, a mutation observer helper.
- niutech 3y agoWhat do you mean by `pluck`? Is it like `array.map(i => i[key])`?