Jason Knight
1 min readApr 20, 2024

--

It's not bad. The use of proxy to extract elements from the namespace is rather ingenious. My only real objections are:

1) Extracting the tags you're going to use from the namespace is a bit... glomy. heavy-handed.

2) It seems to bleed scope all over the place making for a high likelihood of code conflicts.

3) The byte obsession favored over type safety, immutability, and code clarity is doing it no favors. I'm all for small distributions, but not at those costs. When your total gzipped package is below the largest allowed packet size, live a little and throw some CONST in there and some extra {} for scope isolation.

4) Being that it calls functions for elements, it's not exactly the easiest mechanism for receiving data from server-side via XMLHttpRequest or Fetch. I chose JSON compatibility in mine for a reason.

That said I can think of more than a few projects I've worked with that were built with React or Vue where vanJS would have been a hell of a lot less headaches.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

No responses yet