I don't think that's necessarily the case - I always thought that it means without the prerequisite of a framework like Angular or library like React...
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.
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.
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.
This totally makes sense to me in a matter that the "library" doesn't have any other dependencies like jQuery, React/Vue, etc. i.e. if you're familiar with JS you can just get the library and start using it without cognitive overload by finding that you also have to use that on a specific platform only, having other packages installed and be in a parallel universe.
This totally makes sense to any seasoned developer or any backend developer. But frontend developers nowadays have a mess in their heads. They believe that React is a library because they thought to believe this. Therefore they don't understand completely what a library actually is. Hence a comment: "Vanilla js librairies, how does that makes sense ?" with 17 likes. Awful.
Kindly please describe what is a library to you, their might be an interesting discussion here.
If we take the example of the editor.js "library":
it's 574k of js bundled
has dependencies (at least highlight.js for syntax highlighting)
has an ecosystem of plugins all only working for this library
The line between library and framework is a bit fuzzy, I would still consider react a framework because it is how people use it and arguably the recommanded way to use it.
My message was not about react being a lib, more than using huge library not the spirit of what I would call vanilla JS.
It is not fuzzy and it never was. It always was simple and clear. It became fuzzy when promoters of React decided to call it "library".
A library is just a set of methods/functions regardless of its size. It can be GB in size and it still will be the library. Editor.js is a perfect example of a library. Another one jQuery - 30,000 plugins and why it even matters?
Framework on another side can be several lines of code, but still, be a framework just because it requires your code to be written in a certain way. React which requires extending classes and implementing methods is a perfect example of a framework.
General principle:
Your code calls the library, but the framework calls your code.
Speaking of "Vanilla JS", "Vanilla JS" is a part of jQuery hate strategy invented by the same frauds who call React the library.
The power of a language is in its libraries and frameworks. "Vanilla JS" is nonsense, the same way as "Vanilla Java" or "Vanilla Python". We just need to call libraries - libraries and frameworks - frameworks and use them where they make sense.
Thanks bigbott, I was skimming the comments and thinking “please tell me SOMEONE knows what a library is! Big ol bundle of code!”
Maybe people don’t “need” to learn C++ but I swear a week with it and people wouldn’t be confused by stuff like the idea of a “library” that is just a big block of text.
It’s almost like how a real library is a place that holds lots of useful information data and methods to achieve things. Weird, right? 😜
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Vanilla js librairies, how does that makes sense ?
I thought vanilla was js precisely without libs
Vanilla JS is when you don’t abstract away to a framework like React or JQuery etc... You can still use libraries.
I don't think that's necessarily the case - I always thought that it means without the prerequisite of a framework like Angular or library like React...
My exact thought.
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.
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.
With this definition then libraries like Vue and React are "Vanilla JS" libraries.
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.
Because you can use them with vanilla JS, w/o dependencies nor supersets.
I guess, it means it doesn't require some framework like React, Angular, Vue, JQuery, etc.
JQuery isn't really a framework though, yet I'd still consider it non vanilla JS.
This totally makes sense to me in a matter that the "library" doesn't have any other dependencies like jQuery, React/Vue, etc. i.e. if you're familiar with JS you can just get the library and start using it without cognitive overload by finding that you also have to use that on a specific platform only, having other packages installed and be in a parallel universe.
This totally makes sense to any seasoned developer or any backend developer. But frontend developers nowadays have a mess in their heads. They believe that React is a library because they thought to believe this. Therefore they don't understand completely what a library actually is. Hence a comment: "Vanilla js librairies, how does that makes sense ?" with 17 likes. Awful.
Kindly please describe what is a library to you, their might be an interesting discussion here.
If we take the example of the editor.js "library":
The line between library and framework is a bit fuzzy, I would still consider react a framework because it is how people use it and arguably the recommanded way to use it.
My message was not about react being a lib, more than using huge library not the spirit of what I would call vanilla JS.
It is not fuzzy and it never was. It always was simple and clear. It became fuzzy when promoters of React decided to call it "library".
A library is just a set of methods/functions regardless of its size. It can be GB in size and it still will be the library. Editor.js is a perfect example of a library. Another one jQuery - 30,000 plugins and why it even matters?
Framework on another side can be several lines of code, but still, be a framework just because it requires your code to be written in a certain way. React which requires extending classes and implementing methods is a perfect example of a framework.
General principle:
Your code calls the library, but the framework calls your code.
Speaking of "Vanilla JS", "Vanilla JS" is a part of jQuery hate strategy invented by the same frauds who call React the library.
The power of a language is in its libraries and frameworks. "Vanilla JS" is nonsense, the same way as "Vanilla Java" or "Vanilla Python". We just need to call libraries - libraries and frameworks - frameworks and use them where they make sense.
Thanks bigbott, I was skimming the comments and thinking “please tell me SOMEONE knows what a library is! Big ol bundle of code!”
Maybe people don’t “need” to learn C++ but I swear a week with it and people wouldn’t be confused by stuff like the idea of a “library” that is just a big block of text.
It’s almost like how a real library is a place that holds lots of useful information data and methods to achieve things. Weird, right? 😜