25

I very recently found out that VanillaJS (document?) is a library that's just bundled with 99% browsers and isn't exactly native JavaScript (shock of my life). While writing a lib of my own I normally avoid all helpful things, mostly libs. Now I have three questions:

  1. Is VanillaJS still considered a lib?
  2. Is there a way to do anything with the DOM without VanillaJS?
  3. Are major libs based on VanillaJS or native JS (without the document stuff)
DividedByZero
  • 411
  • 1
  • 4
  • 8
  • 70
    [Vanilla JS](http://vanilla-js.com/) is a joke. Are you pulling our leg or should I elaborate? –  Oct 28 '14 at 19:37
  • http://www.youtube.com/watch?v=Y2Y0U-2qJMs Separate JS from the DOM and you're left with the language itself, which benefits greatly from addon libraries. The DOM is what makes things like jQuery and YUI essentials. The different vendors Fing up their DOM implementations isn't the fault of JS, JS is just how you interface with their cluster-F'd DOMs. – Andrew Hoffman Oct 28 '14 at 19:39
  • @delnan I feel someone pulled both of mine off right now.. please do – DividedByZero Oct 28 '14 at 19:40
  • 2
    @RandomUser, I got it the **second** time I viewed the VanillaJS page. First time, I thought it was a simple helper library that later became "part of JS" when browsers started implementing it's functions. So it did not interest me. – Jesvin Jose Oct 29 '14 at 14:53
  • 1
    @aitchnyu **EXACTLY** what I thought! No wonder my Wikipedia edits were denied :P – DividedByZero Oct 29 '14 at 16:06
  • 1
    Not to be with the famous [vapor js](https://github.com/madrobby/vapor.js/tree/master). – Neil Oct 29 '14 at 16:44
  • @delnan Phrasing it that way could imply that it is a "joke" of a framework, in the sense that it's so terrible that it's not worth using. What's actually happening, of course, is that Vanilla JS is actually just native Javascript being promoted as a framework, perhaps as a flippant critique of the wide array of Javascript frameworks. – ravibhagw Oct 29 '14 at 20:45
  • 1
    @baultista IIRC, when I was referring POJO (Plain Old Java Object), I saw someone joke that it was an etablished pattern, but it *needed* a cool name to compete with the alternatives. – Jesvin Jose Oct 30 '14 at 08:35
  • 1
    "When you're ready to move your application to a production deployment, switch to the much faster method: '' ". ROFL!! I also love the download features checkboxes! – Ogre Psalm33 Oct 30 '14 at 12:07

1 Answers1

66

It's a joke, or rather, a witty way to make a point. "vanilla X" refers to "X in the most basic fashion" or "X without anything extra", so "Vanilla JS" is JavaScript as exposed by the browser. VanillaJS is native JavaScript. That includes the DOM, various newfangled APIs, the core language features. It excludes third party code, i.e. what one would normally call libraries or frameworks. The people behind it probably want to point out the advantages of doing things this way by framing it like marketing for a third party framework. There is, or at least used to be, a trend in the JavaScript world to throw frameworks at every problem regardless how trivial a solution in "vanilla" JavaScript would be.

  • I was thinking the JavaScript we use to play with the DOM is VanillaJS but, now that I think of it, the DOM thing **is** JavaScript(ECMAScript originally). – DividedByZero Oct 28 '14 at 20:11
  • 2
    Not quite synonymous with the DOM, but I get your point. Using 'VanillaJS' to manipulate the DOM, one must be aware of all of the different gotchas between the various DOM implementations. If using jQuery to manipulate the DOM, one need only know the abstracted DOM that jQuery exposes. – Andrew Hoffman Oct 28 '14 at 21:03
  • Related: http://gaming.stackexchange.com/a/186418. – TRiG Oct 28 '14 at 23:41
  • Related-er: http://meta.stackexchange.com/a/19492/231312 – Tim S. Oct 29 '14 at 01:44
  • 1
    @AndrewHoffman: The differences between implementations aren't nearly as big as they used to be; now that IE gives a damn about standards, one can easily write cross-browser-compatible code these days. – cHao Oct 29 '14 at 02:41
  • As long as you don't have to support stupid versions of IE – Wayne Werner Oct 29 '14 at 03:03
  • Is JavaScript so monolithic that you can't separate the language from the DOM manipulation "library"? – user253751 Oct 29 '14 at 05:26
  • But what about Node's vanilla? That doesn't include DOM. – Scimonster Oct 29 '14 at 07:03
  • @Scimonster http://vanilla-js.com/ talks about browsers, and browsers are monumentally more common than servers running Node, so I focus on browser's JS. –  Oct 29 '14 at 07:14
  • 6
    JavaScript engines (v8, spidermonkey, chakra) do not include the DOM. The DOM is added by the browser environment. – OrangeDog Oct 29 '14 at 10:57
  • 6
    Great joke on this topic: http://needsmorejquery.com – Almo Oct 29 '14 at 12:38
  • 2
    @RandomUser The DOM api is not part of the language Javascript itself. It is a W3C standard that compliant browsers should implement. For example, see this link where they define what an Element is: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-745549614 and this link where they define how the DOM should be exposed in Javascript: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/ecma-script-binding.html – Paul Oct 29 '14 at 14:32
  • My first thought was "this is some kind of collection of polyfills to make vanilla js work the same in all browsers" and I started to look for source code of VanillaJS :-) – DUzun Aug 27 '15 at 08:14