Skip to main content Accessibility Feedback

When does using libraries stop being vanilla JS?

The other day on Twitter, Mark Goodyear asked:

Serious question, at what point do you call something no longer “vanilla”? The point when any lib is included?

Helper libraries are great. I use them all the time! Small helper functions and plugins are even better.

To me, vanilla JavaScript stops being vanilla when ripping out a library requires you to rewrite large amounts of code.

For example, Bliss.js, while lightweight, extends vanilla JS with the $ object and chained functions. If you build a site with it, removing it means removing the entire codebase.

Contrast that with helper functions like ready.js or extend.js. Yes, you have to modify any scripts that use those. But you don’t have to rewrite every selector and function.

To me, the danger zone is when you start trying to make vanilla JS more like jQuery. It starts with $. Then chaining. Suddenly, you’re basically recreating jQuery (which is itself written in vanilla JS).

Update: After some discussion in my Vanilla JS Slack Channel, I added a bit more nuance to my perspective. You can read about it here.


🔥 Hot off the press! I just launched a new pocket guide. Learn how to build interactive web apps with vanilla JavaScript.

Have any questions or comments about this post? Email me at chris@gomakethings.com or contact me on Twitter at @ChrisFerdinandi.

Get Daily Developer Tips