685
votes

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".

11
  • 245
    VanillaJS is regular Javascript. That's the joke.
    – Nelson
    Dec 6, 2013 at 23:54
  • 30
    vanilla-js.com (download the library, tick all the options and look into the source code to see how it's done) Dec 6, 2013 at 23:55
  • 35
    Like vanilla ice-cream is basically plain, "vanilla" in a lot of slang means "plain or boring"
    – TecBrat
    Dec 6, 2013 at 23:55
  • 21
    “Final size: 0 bytes uncompressed, 25 bytes gzipped.” Love it :O)
    – cronvel
    Jul 14, 2015 at 11:11
  • 23
    The really depressing thing is it appears on job specs as VanillaJS - tragic how little many recruiters know about the roles they recruit for.
    – Phil Lello
    Feb 5, 2016 at 9:45

9 Answers 9

580
votes

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).

9
  • 1
    That's a matter of opinion, and is dependent on the circumstance.
    – Blue Skies
    Dec 7, 2013 at 0:04
  • 13
    FYI: Vanilla JS is now 0 bytes, 25 bytes compressed.
    – Trisped
    Jun 19, 2015 at 22:09
  • 8
    @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). Mar 7, 2017 at 20:36
  • 1
    In my opinion most developers should understand this answer just fine ;) Mar 28, 2017 at 16:38
  • 2
    But StackOverflow is for all developers, not only most :) Mar 28, 2017 at 21:21
369
votes

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/

1
74
votes

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.

5
  • 3
    @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. ;) Jul 11, 2014 at 14:52
  • 4
    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.
    – Thomas W
    Jul 12, 2014 at 1:56
  • @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. Mar 6, 2016 at 14:54
  • 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.
    – Thomas W
    Mar 7, 2016 at 4:55
  • And if you include the enterprises inside it will take at least a decade Mar 16, 2016 at 8:16
48
votes

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?

2
  • 3
    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.
    – Ringo
    Jul 17, 2017 at 5:07
  • 1
    @Ringo 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.
    – Roy Tinker
    Jan 3, 2018 at 20:22
45
votes

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

1
  • 17
    And even Object.is(VanillaJS, JavaScript) except of course IE. Oct 4, 2015 at 19:02
43
votes

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,

1
5
votes

"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/

1
vote

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`
1
  • 1
    I get what vanilla JS is all a joke
    – rodude123
    Aug 15, 2018 at 13:14
0
votes

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.