At NodeBB, we have afairly divergent team when it comes to our tech stack. Sure, we all use Node.js and Redis, but those were decisions that we agreed upon after a bit of wrangling:
- Do we use MySQL (MariaDB), MongoDB, or Redis? (We decided on Redis)
- Should we use so many new technologies all at once? (We decided: Yes)
- Should we completely open-source the NodeBB code? (We decided: Yes)
To be clear, NodeBB now uses a moderate amount of jQuery.
- Modern browsers handled it superbly (we were building a forum software for modern browsers, so even moreso)
- I felt like a l33t hacker (and a bit hipstery) when I used
I think I was definitely the last holdout (I joke that Baris' first commit was probably
git commit -am "adding jQuery", but I digress...), and I ended up switching to jQuery in my day-to-day because:
- The library was already there, since Bootstrap required it
- We sometimes (albeit rarely) ended up running into obscure browser incompatibilities.
- Ironically, we kept finding bugs in places where we mixed jQuery and vanilla**!
Ironically, we kept finding bugs in places where we mixed jQuery and vanilla!
Aside: Don't you hate articles where random quotes (like the one right above this paragraph) are interjected in the middle of an article and have barely anything to do with what the current paragraph is talking about?
Anyways -- we were building an entire web app, and in that scenario, I now think it's perfectly fine to use a library, if only to abstract away a couple little processes that could be replaced with a single line.****
We may go back to using vanilla in places where speed is of absolute paramount importance.
In conclusion: My love affair with vanillaJS isn't over yet...
Also hilarious: VanillaJS Framework
Core Maintainer, NodeBB
* We use
.textcomplete() for username mentions. We also use
$.draggable, and some other jQueryUI components
** For example, an existing event listener (
addEventListener(notifEl)) would break after someone had upgraded
notifEl = document.getElementById('#notifications'); to
$('#notifications');. This is more an example of sloppy coding, but it still shows that seemingly innocuous changes can still produce side-effects.
*** A developer I know once built a script injection style library that loaded an entire framework in order to parse < 200 lines of code. This snippet was supposed to be used on other peoples' websites!
**** Can I use