DEV Community

Discussion on: Some libraries you can use with Vanilla JS

Collapse
 
z2lai profile image
z2lai • Edited

I get that there might be an established definition of Vanilla JS. But isn't Vanilla JS libraries just JS functions packaged together. I don't see much of a difference between keeping the JS all in one file, vs storing it in another module and importing it.

Collapse
 
kigiri profile image
Clément

For me the difference is, directly using the browser API and writing code just for your needs and understanding the API behind the code.

In a way, react can be use as just a vanilla JS library in that case, you don't even need to write JSX and can use it for some elements only... It's probably lighter than some of the libraries listed in this article.

Collapse
 
itwasmattgregg profile image
Matt Gregg

With this definition then libraries like Vue and React are "Vanilla JS" libraries.

Thread Thread
 
z2lai profile image
z2lai

Yeah good point. I think of React as non-vanilla because of how many layers of abstraction it has. But I guess ultimately, if there's even one layer of abstraction, like packaging a one-liner into a library, then it might as well be considered non-vanilla.