What is VanillaJS?
Asked Answered
P

9

685

I have one simple question, that got stuck in my mind for a few days: What is VanillaJS? Some people refer to it as a framework, you can download a library from the official pages.

But when I check some examples or TodoMVC, they just use classic raw JavaScript functions without even including the library from the official pages or anything. Also the link "Docs" on the official webpage leads to the Mozilla specification of JavaScript.

My question is: Is VanillaJS raw JavaScript? And if yes, why people refer to it as "framework" when all you need is a browser without any special included scripts?

I am sorry for a probably stupid question but I have no idea what people are talking about when they say "VanillaJS".

Pentalpha answered 6/12, 2013 at 23:52 Comment(11)
VanillaJS is regular Javascript. That's the joke.Underarm
vanilla-js.com (download the library, tick all the options and look into the source code to see how it's done)Jenniejennifer
Like vanilla ice-cream is basically plain, "vanilla" in a lot of slang means "plain or boring"Tamaratamarack
No! You don't need to download it! It's pre-installed on every browser!Camelopardus
“Final size: 0 bytes uncompressed, 25 bytes gzipped.” Love it :O)Camelopardus
The really depressing thing is it appears on job specs as VanillaJS - tragic how little many recruiters know about the roles they recruit for.Anchylose
@PhilLello Please link me to one of these job specs!Afloat
@Kaylors here's search results for job specs requesting applicants to be versed in VanillaJS - as of right now it yields 29 search results: jobrobot.de/…Bern
VanillaJS is pretty much regular Javascript. When you click on the documentation, you'll be transported to MDN Javascript page. It was I think developer joke. Vanilla means unexciting, normal, conventional.Proletarian
It took me 5 minutes to understand why is that vanilla js library is 0 KB! LOL! vanilla-js.comChamber
PSA: Don't add a "VanillaJS" tag. It is not a library, language or feature. It's a joke. As such, it is not useful as a tag.Amby
S
580

This is VanillaJS (unmodified):

// VanillaJS v1.0
// Released into the Public Domain
// Your code goes here:

As you can see, it's not really a framework or a library. It's just a running gag for framework-loving bosses or people who think you NEED to use a JS framework. It means you just use whatever your (for you own sake: non-legacy) browser gives you (using Vanilla JS when working with legacy browsers is a bad idea).

Singleton answered 7/12, 2013 at 0:1 Comment(9)
Why do you qualify your answer with (non-legacy)? Or rather, why is it a "bad idea"?Sapp
Because it's a major pain in the ass to deal with oldIE without at least some helper functions - and when you need them you are better off with some lightweight library instead of re-implementing them on your own.Singleton
That's a matter of opinion, and is dependent on the circumstance.Sapp
"for your own sake: non-legacy" - better? ;)Singleton
FYI: Vanilla JS is now 0 bytes, 25 bytes compressed.Gripsack
@BlueSkies The fact "that plain ("vanilla") JS is bad when working with legacy browsers" is not an opinion, it's a fact. It's the very reason why frameworks like jQuery and others were invented: to simplify your life when dealing with the browser-incompatibilities hell! :) The only reason why vanilla JS started coming back in 2016 is that most modern browsers are now much more standards-compliant than they were in the past, so you need less and less frameworks (especially if you are a javascript expert).Dhole
In my opinion this answer is too unclear for such a simple thing. Other answers, telling directly that this is a joke, are less confusing. At the first time I thought that writing // VanillaJS v1.0 in code is some serious and meaning convention.Disproof
In my opinion most developers should understand this answer just fine ;)Singleton
But StackOverflow is for all developers, not only most :)Disproof
P
369

Using "VanillaJS" means using plain JavaScript without any additional libraries like jQuery.

People use it as a joke to remind other developers that many things can be done nowadays without the need for additional JavaScript libraries.

Here's a funny site that jokingly talks about this: http://vanilla-js.com/

Partin answered 6/12, 2013 at 23:54 Comment(0)
C
74

VanillaJS is a term for library/framework free javascript.

Its sometimes ironically referred to as a library, as a joke for people who could be seen as mindlessly using different frameworks, especially jQuery.

Some people have gone so far to release this library, usually with an empty or comment-only js file.

Cantharides answered 6/12, 2013 at 23:54 Comment(5)
@ThomasW I like portability and concise, productive syntax too. That's why I write function doSomething(args) { ... } and then in my code I can just doSomething in even less code than jQuery. ;)Crewelwork
Great, if you don't have to deal with real-world DOM or browser issues. Most people building webapps do. DOM manipulation & browser portability are the problems, to which jQuery was invented (improving on Prototype.js) as a solution. I agree with@NiettheDarkAbsol, that for pure algorithm code jQuery is not relevant.Fiance
@ThomasW Do "real-world DOM or browser issues" cause a huge problem in IE 9 and later? As far as I can tell, most of said issues are with IE 8 and earlier. IE on XP was unsupported when you wrote that comment, and IE 8 on Windows Vista and Windows 7 is no longer supported now that Microsoft is supporting only the latest IE available for each OS.Disqualify
Sure, IE 9 and 10 have incompatibilities! Somewhat fewer, but they still exist. Another developer and I spent 4-5 weeks at my last job squashing such bugs. I believe compatibility bugs/ variances will continue to exist for the forseeable future.Fiance
And if you include the enterprises inside it will take at least a decadeHallam
S
48

This is a joke for those who are excited about the JavaScript frameworks and do not know the pure Javascript.

So VanillaJS is the same as pure Javascript.

Vanilla in slang means:

unexciting, normal, conventional, boring

Here is a nice presentation on YouTube about VanillaJS: What is Vanilla JS?

Subjective answered 22/9, 2016 at 10:9 Comment(2)
This is really just a stupid joke that is very confusing to newbies. It's so obvious that front end engineers like to cloud the waters so they can appear to know more than the next person.Luggage
@Luggage Not any more than French jokes that require a deep knowledge of French culture to understand are intended to make people who tell them appear to know more than others. People may be using some "in-jokes" to exclude others, but that's not a good assumption to make, especially when they are quick to explain when asked.Portfolio
P
45

The plain and simple answer is yes, VanillaJS === JavaScript, as prescribed by Dr B. Eich.

Puissant answered 4/8, 2015 at 22:33 Comment(1)
And even Object.is(VanillaJS, JavaScript) except of course IE.Coniology
F
43

VanillaJS === JavaScript i.e.VanillaJS is native JavaScript

Why, Vanilla says it all!!!

Computer software, and sometimes also other computing-related systems like computer hardware or algorithms, are called vanilla when not customized from their original form, meaning that they are used without any customization or updates applied to them (Refer this article). So Vanilla often refers to pure or plain.

In the English language Vanilla has a similar meaning, In information technology, vanilla (pronounced vah-NIHL-uh ) is an adjective meaning plain or basic. Or having no special or extra features, ordinary or standard.

So why name it VanillaJS? As the accepted answer says some bosses want to work with a framework (because it's more organized and flexible and do all the things we want??) but simply JavaScript will do the job. Yet you need to add a framework somewhere. Use VanillaJS...

Is it a Joke? YES

Want some fun? Where can you find it, http://vanilla-js.com/ Download and see for yourself!!! It's 0 bytes uncompressed, 25 bytes gzipped :D

Found this pun on internet regarding JS frameworks (Not to condemn the existing JS frameworks though, they'll make life really easy :)), enter image description here

Also refer,

Factional answered 28/8, 2017 at 11:5 Comment(1)
try 2.2*100 in vanilla js :DPanatella
R
5

"Vanilla JS” is an expression that got popular after the publishing of a satire website in 2012 (http://vanilla-js.com/). There’s a section covering its story/meaning in this post.

So why the joke? It kind of came as a modern response to the old school knee-jerk reflex of relying on jQuery and additional JS libraries. With the ECMAScript spec and modern browsers capabilities, the need to bypass plain JS with external libraries to maintain consistency across browsers just isn’t there anymore. Here’s a site that shows you how true this is with concrete examples: http://youmightnotneedjquery.com/

Reality answered 26/7, 2018 at 17:54 Comment(0)
R
1

This word, hence, VanillaJS is a just damn joke that changed my life. I had gone to a German company for an interview, I was very poor in JavaScript and CSS, very poor, so the Interviewer said to me: We're working here with VanillaJs, So you should know this framework.

Definitely, I understood that I'was rejected, but for one week I seek for VanillaJS, After all, I found THIS LINK. 😂

What I am just was because of that joke.

VanillaJS === plain `JavaScript`
Roof answered 4/8, 2018 at 7:15 Comment(1)
I get what vanilla JS is all a jokeMasao
M
0

There's no difference at all, VanillaJS is just a way to refer to native (non-extended and standards-based) JavaScript. Generally speaking it's a term of contrast when using libraries and frameworks like jQuery and React. Website www.vanilla-js.com lays emphasis on it as a joke, by talking 'bout VanillaJS as though it were a fast, lightweight, and cross-platform framework. That muddies the waters! Thus, it can be a little philosophical question: "how many things do I compile to Vanilla JavaScript without being VanillaJS themselves?" So, a mere guideline for that is: if you can write the code and run it in any current web-browser without additional tools or so called compile steps, it might be VanillaJS.

Marlite answered 27/9, 2018 at 11:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.