Re:Developing small JavaScript components WITHOUT frameworks
by bigmanwalter on Sunday April 17, 2016 @05:30PM
(#11516407)
This is one of my preferred methods of development.
I use jQuery because I'm not worried about the 40kb and I'll take all the free backwards compatibility I can get. Besides it'll inevitably be a dependency for one of the libraries you want to use.
If my templates start getting complex I've been known to use Jade templating with Jadeify.
But... but... jQuery? :D
Anyways, in real-world development, jQuery is still the #1 go-to tool. A little above vanilla, but not too much abstraction. It's just right.
By the way, there's
- fetch to replace that old XHR. (https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
- Promises which should come with fetch, and also replace success and error callbacks in jQuery (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...)
- document fragments to create DOM elements and do manipulation in memory. (https://developer.mozilla.org/en-US/docs/Web/API/DocumentFra...)
I use jQuery because I'm not worried about the 40kb and I'll take all the free backwards compatibility I can get. Besides it'll inevitably be a dependency for one of the libraries you want to use.
If my templates start getting complex I've been known to use Jade templating with Jadeify.