News for hackers. Stuff that matters.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by aspyct on Thursday May 25, 2023 @04:02AM (#36068165)
Yes, please be that guy. Or I'll do it.

Vanilla Javascript refers indeed to "javascript without a framework". So creating a framework and calling it "vanilla javascript" is... wrong?

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by jitl on Thursday May 25, 2023 @04:22AM (#36068278)
It’s 93 lines, less than most CSS resets. Small enough to copy paste to the top of your index.html in a script tag. You can use it without NPM, webpack, a special compiler pass, or a template language. Seems pretty vanilla compared to the full fat, popular alternatives.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by not_your_vase on Thursday May 25, 2023 @04:39AM (#36068369)
Seems pretty vanilla compared to the full fat, popular alternatives? Absolutely!

Does it seem vanilla compared to vanilla? Haha..

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by jwarren on Thursday May 25, 2023 @04:56AM (#36068455)
You're mixing metaphors there! It might be lightweight but it's still a flavour.

It's still not part of the common browser API, so yes it's easy to add, but no, it's not vanilla.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by Anon4Now on Thursday May 25, 2023 @05:07AM (#36068507)
> it's still a flavour.

> it's not vanilla.

Hate to interrupt, but vanilla is a flavor. And it's a pretty good one, dammit!

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by rgoulter on Thursday May 25, 2023 @05:15AM (#36068549)
Insofar as the discussion on the name "vanilla javascript" goes, this mixes metaphors.

"Vanilla JavaScript" implies "without anything added".

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by ohgodplsno on Thursday May 25, 2023 @05:25AM (#36068613)
Minified React is 1 line, line length isn't exactly a great judge of how much it does.

It's 3KB of barely documented code.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by nailer on Thursday May 25, 2023 @05:31AM (#36068654)
That's nice but still: don't do that. VanillaJS is already a thing. Make your thing have a different name.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by nextlevelwizard on Thursday May 25, 2023 @05:55AM (#36068774)
If I tell someone to "just use vanilla js" and they go googling and end up using VanJS instead.... that aint good.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by usrbinbash on Thursday May 25, 2023 @06:01AM (#36068816)
> Seems pretty vanilla

No it doesn't, same as "automobile" doesn't seem pretty Saturn-5, despite the fact that both are moving under their own power.

Terms have meaning, including meaning derived from communities by and large accepting that a certain term has a certain semantic meaning. And the accepted semantic meaning of "Vanilla Javascript" is "runs without a framework besides the browsers own API".

If my code works out of the box in an unmodified browser, then it is Vanilla JS. If I have to load a framework for it to work, then it isn't, period. And it matters exactly nothing whether the framework in question has 900,000 or 9 lines of code.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by rawoke083600 on Thursday May 25, 2023 @06:13AM (#36068885)
^^^100%
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by zambal on Thursday May 25, 2023 @06:43AM (#36069073)
So loading an external library or framework isn't Vanilla JS, but if I copy/paste the VanJS source into a script tag, nothing gets loaded, there's no syntax magic, just some function calls, so that's Vanilla JS, right? If the latter isn't Vanilla JS by your definition, can I at least copy/paste something from stackoverflow?

Trying to make Vanilla JS a strict definition seems pointless to me in the first place.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by usrbinbash on Thursday May 25, 2023 @07:18AM (#36069293)
> so that's Vanilla JS, right

I think we don't have to argue about the distinction between the library code and the application code. It doesn't matter how the library is loaded. You can get it from a CDN at runtime, load it from a scriptbundle, copypaste it into a <script> tag, it doesn't matter.

It's still library code that the rest of the application depends on. As soon as that is the case, it's no longer what the JS community by and large calls "Vanilla JS".

This is Vanilla JS:

    fetch('/readme.txt')
    .then(response => response.text())
    .then(data => console.log(data))
    .catch(error => console.log(error))
This isn't:

    awesomeLib().goesBrrrrr()
> Trying to make Vanilla JS a strict definition seems pointless to me in the first place.

Being able to name things, and having clarity in a community about what names denote, is anything but pointless.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by NoWizards on Thursday May 25, 2023 @09:50AM (#36070687)
When you do it this way isn't even a framework is just a helper library (at his best). There is another concept for this kind of micro-libraries but calling "framework" to something that will not establish a frame of work for you.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by svachalek on Thursday May 25, 2023 @12:39PM (#36072925)
The important part is that if you don't copy VanJS into a script tag, or use it all, you're still doing Vanilla JS.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by joesb on Friday May 26, 2023 @09:09AM (#36083591)
> If my code works out of the box in an unmodified browser, then it is Vanilla JS. If I have to load a framework for it to work, then it isn't, period.

Minor nitpick, third party library and framework does not modify your browser. They all still run on unmodified browsers.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by FrankyHollywood on Thursday May 25, 2023 @04:16AM (#36068232)
A framework build not to be a framework, it's almost philosophical :)

https://plato.stanford.edu/Archives/Fall2012/entries/liar-pa...

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by amelius on Thursday May 25, 2023 @05:59AM (#36068804)
Suggestion: call it Bourbon JS. Wikipedia:

> The majority of the world's vanilla is the V. planifolia species, more commonly known as Bourbon vanilla.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by abirch on Thursday May 25, 2023 @06:04AM (#36068835)
Wait people write JavaScript without drinking bourbon?
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by usrbinbash on Thursday May 25, 2023 @06:38AM (#36069036)
My goto JS drink is Absinthe.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by jcpst on Thursday May 25, 2023 @12:58PM (#36073157)
Please create a PR for my library goto-drink.js which uses labels for each libation so you can continue or break your drink.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by mikeryan on Thursday May 25, 2023 @01:05PM (#36073249)
You writing your front ends in Elm then?
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by egeozcan on Thursday May 25, 2023 @06:09AM (#36068862)
I've been managing that since more than a decade. Having neither jQuery nor bourbon was a challenge at first but browser APIs evolved and I fell in love with green tea.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by tipiirai on Thursday May 25, 2023 @06:30AM (#36068982)
I prefer Scotch
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by Onewildgamer on Thursday May 25, 2023 @10:46AM (#36071386)
No thanks, I get high with Javascript alone and a hangover so bad that lasts the entire weekend.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by WorldMaker on Thursday May 25, 2023 @02:02PM (#36073945)
The relationship between Bourbon (spirit), primarily distilled and aged in Kentucky, and Bourbon (vanilla plant), primarily grown in Madagascar is one of fascinating cross-convergence of "things rich French speakers loved", plus the coincident accident of Bourbon, Kentucky being a shipping port (and Oak as an aging vessel high in imparting vanillins). Both are a reminder that vanilla as a flavor was long a spice for (and named after) kings and to be enjoyed mostly by the rich. It is still hilarious to see things like "vanilla JS" meant to imply "boring" or "cheap" when historically that's very inaccurate.

Also, yes, bourbon (spirit) is a good accompaniment to late nights in JavaScript.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by elgenie on Thursday May 25, 2023 @05:03PM (#36076207)
The etymology is legit and comes from ice cream, for which vanilla is considered the default or “plain” flavoring.

https://en.wikipedia.org/wiki/Plain_vanilla

Vanilla historically being fancy but then becoming an attainable and cheap additive is probably somewhat responsible for it becoming the default ice cream flavor, and thus flipping the idiomatic meaning.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by WorldMaker on Thursday May 25, 2023 @07:36PM (#36077853)
Though note it was primarily the invention of artificial vanilla substitutes that made vanilla seem cheap/attainable. (Real Bourbon vanilla from Madagascar, for instance, is still far more expensive than most people realize.) There may even be a larger useful metaphor there, too, that "plain" vanilla is most often "fake vanilla".
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by schwartzworld on Friday May 26, 2023 @12:20PM (#36086155)
Lots of dessert / ice cream recipes use vanilla as an ingredient regardless of what the final flavor is meant to be. This also leads to the vanilla === plain misconception, imo.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by meigwilym on Thursday May 25, 2023 @06:26AM (#36068959)
Already taken. I know it's not JS but it's front end tooling.

https://www.bourbon.io/

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by amelius on Thursday May 25, 2023 @06:31AM (#36068990)
Vanilla was already taken too:

https://github.com/idevz/vanilla

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by briantakita on Friday May 26, 2023 @12:16PM (#36086101)
It's a zombie project as not many people use sass, let alone a heavy sass library.

bourbon.js it is?

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by modinfo on Thursday May 25, 2023 @06:31AM (#36068992)
Suggestion 2: call it IceCreamJS or just IceJS/CreamJS
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by gs17 on Thursday May 25, 2023 @02:19PM (#36074142)
jsAlaMode?
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by brabel on Thursday May 25, 2023 @06:46AM (#36069096)
Vanilla.js is the most popular framework in the world!!!!

http://vanilla-js.com

Also has the smallest footprint:

0 bytes uncompressed, 25 bytes gzipped!

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by robby_w_g on Thursday May 25, 2023 @01:30PM (#36073580)
> 0 bytes uncompressed, 25 bytes gzipped!

Compression Considered Harmful

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by pqdbr on Thursday May 25, 2023 @02:09PM (#36074019)
This is hilarious. I lost it at the empty line for loading it in production.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by perilunar on Friday May 26, 2023 @06:01AM (#36082140)
I clicked the download link to see what would happen, and it did indeed download a zero byte vanilla.js file. Zipping it using the OS X 'compress file' menu option gave me a 713 byte zip file however.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by ajd1988 on Thursday May 25, 2023 @11:45AM (#36072234)
I understand the confusion, given the existing terms but it seems the intent behind the name 'VanJS' is to highlight the simplicity and 'bare-bones' nature of this new framework, aligning it with the 'vanilla' aspect.

While it might lead to some confusion initially, with clear and transparent communication about what 'VanJS' offers, it could still work as a brand that distinguishes itself by simplicity - or pivot to Van rentals

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by aigoochamna on Thursday May 25, 2023 @12:41PM (#36072947)
I'd like to suggest my new reactive JS framework called "react.js" not to be confused with reactjs.
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by rawoke083600 on Friday May 26, 2023 @07:45AM (#36082849)
>While it might lead

Might ?? Come now, be an adult and a thinking person ! Go down the hall find 10 js/frontend programmers. Ask them what do they think "Vanilla JS" might mean ?

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by steren on Thursday May 25, 2023 @03:54PM (#36075327)
I agree with you and I opened https://github.com/vanjs-org/van/issues/18
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by dahwolf on Thursday May 25, 2023 @05:29PM (#36076498)
I will up you. Using the word "vanilla" to refer to anything neutral, default, or basic is wrong.

Vanilla is a sophisticated flavor, not to mention a precious and expensive ingredient. Most people have never consumed real vanilla in their lifetime.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by dheera on Thursday May 25, 2023 @06:00PM (#36076842)
Similarly, using the word "original" to describe plain potato chips is wrong. It's the most unoriginal flavor of the lot. Just call it "plain".
Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by ZoomZoomZoom on Friday May 26, 2023 @07:38AM (#36082799)
It's not similar. Unfortunately, "original" is one of the words with a couple of very close but different meaning. This one even goes first in the dictionary:

> Existing at the beginning of a particular period, process or activity.

The original meaning of the root "origin" comes from Latin: to rise -> beginning, source birth.

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by musicale on Monday May 29, 2023 @03:55AM (#36111754)
> Most people have never consumed real vanilla in their lifetime

What exactly is the "vanilla extract, vanilla beans" in Ben & Jerry's ice cream then?

Supposedly Haagen-Dazs ice cream is made from "5 simple ingredients": cream, milk, eggs, sugar, and Madagascar (sic) vanilla (which is "real" vanilla I assume?)

And what about the vanilla extract which I have on my shelf, whose ingredients are "vanilla bean extractions in 35% alcohol?"

Have we all fallen victim to a diabolical vanilla conspiracy?

Re:VanJS (Vanilla JavaScript): smallest reactive UI framework by dahwolf on Tuesday May 30, 2023 @07:37PM (#36132662)
Even though the main character of the universe, you, has consumed real vanilla, the point stands. Almost everything labeled "vanilla" does not actually contain real vanilla.