jQuery II: The Quickening! I recently built a toy Golang SSR project using Zepto, a jQuery-like library, and felt like I was 17 again (**EDIT: it's unmaintained - don't use it). Also of note is that "Highlander II" takes place in the year 2024 [1]. It's a sign! Everything old is new again! `$` is immortal! [1] https://en.wikipedia.org/wiki/Highlander_II:_The_Quickening
TinyJS – Shorten JavaScript QuerySelect with $ and $$
11–20 of 94 posts
Re: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#12I recommend the author remove that or note inspiration from the README to avoid detracting from the rest of the work. I realize there’s more here than the traditional document.querySelector.bind(document) assignment.
Re: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#13> This README was generated by ChatGPT Damn good README. Also, good library.
A readme should be more reference / show and less drivel.
Re: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#14I do believe I've seen something like this under another name. Using "$" to shorten JavaScript? That seems a lot like jQuery. > This README was generated by ChatGPT You don't need AI to explain this one.
Re: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#15This is the whole code: (() => { const assignDeep = (elm, props) => Object.entries(props).forEach(([key, value]) => typeof value === 'object' ? assignDeep(elm[key], value) : Object.assign(elm, {[key]: value})) const tagNames = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'd…
window['$'] = selector => document.querySelector(selector)
window['$$'] = selector => Array.from(document.querySelectorAll(selector))
is really what I want to haveRe: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#16Re: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#17Like jQuery but for 2024?
Re: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#18may I ask what's the point of `const tagNames =`? removing it would make no difference, as far as I can tell - just make sure the previous line ends with a semicolon (or add it at the same line as the opening square bracket)
That's a reason to never use this imo.
There are plenty of other jquery-lite helper libraries out there. 95 percent the utility with hardly any cost in terms of script size.
Converting querySelectorAll to an array is honestly most of the benefit of these libraries.
Re: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#19jQuery II: The Quickening! I recently built a toy Golang SSR project using Zepto, a jQuery-like library, and felt like I was 17 again (**EDIT: it's unmaintained - don't use it). Also of note is that "Highlander II" takes place in the year 2024 [1]. It's a sign! Everything old is new again! `$` is immortal! [1] https://en.wikipedia.org/wiki/Highlander_II:_The_Quickening
jQuery proper is both maintained and has actively been working on a 4.0 release and still gets security and bug fixes
Re: TinyJS – Shorten JavaScript QuerySelect with $ and $$
#20jQuery II: The Quickening! I recently built a toy Golang SSR project using Zepto, a jQuery-like library, and felt like I was 17 again (**EDIT: it's unmaintained - don't use it). Also of note is that "Highlander II" takes place in the year 2024 [1]. It's a sign! Everything old is new again! `$` is immortal! [1] https://en.wikipedia.org/wiki/Highlander_II:_The_Quickening
https://www.bennadel.com/blog/4184-replacing-jquery-110kb-wi...