Live data from Hacker News

Mini projects built with VanillaJS. No frameworks or libraries

github.com

31–40 of 171 posts

Re: Mini projects built with VanillaJS. No frameworks or libraries

#31
post #6

I love these type of showcases. It‘s been a wonderful time when simply upload files via SFTP and had a running application. No need of webpack bundles, vendor libraries to achieve a simple functionality that could be solved in a few lines of code ... I really do hope this kind of developer attitude (writing pure VanillaJS) is coming back.

There's a reason why a lot of those libraries and tools are used though. Webpack bundles are used to strip down multiple JS files and libraries into a single bundle that contains only what is needed to run a particular application. Libraries like React serve a purpose too, particularly when you're building large applications that need to be maintained by many people all at once, or when you need insane compatibility…

IE11 is "insane compatibility" now?

rants about having to support IE6

Re: Mini projects built with VanillaJS. No frameworks or libraries

#33

This is good for practice and learning but honestly what is the point of going backwards. Some of these demos don’t even work on safari in mobile. Frameworks are there for a reason. If one must learn in plain ja then sure go for it but no point knocking down frameworka

Most of these didn't work on Firefox either or fail gracefully, so no cross-browser support. I'd say that the more "stuff" you need to do on a web app, the more likely those features will need to be cross-browser compatible, and having done that in the past, I can say that VanillaJS is a fine thing for simple straightforward web apps, but when you start needing more features, it can be a load-off to outsource it to a framework.

If you understand what the framework is doing, used sparingly, some frameworks can save you some time. JS libraries have the same deal, there are some features that I would prefer not rewrite every time I write an app. For instance, PDF.js is quite indispensable at reading PDFs in the browser and I think someone would spend quite a bit of time re-writing all the features you need from that library.

Anyways, I guess it just all comes down to using the right tool for the job.

Re: Mini projects built with VanillaJS. No frameworks or libraries

#34
Here's one I did as an assignment for a job interview: https://github.com/ivancuric/hn-scroll

You can see it in action here: https://hn-scroll.netlify.com/

The task was to build an offline capable site which displayed the latest Hacker News posts, and loaded more lazily when scrolling. I had to use the official HN API, and I couldn't have any middleware or caching. Everything had to be done client-side.

The app ended up being 1.4kb in total, with support for practically streaming in the items, batching them by network response times and render frames, while keeping the order.

You can see the batched items in this version: https://codesandbox.io/s/hardcore-stonebraker-8m8fx

Re: Mini projects built with VanillaJS. No frameworks or libraries

#35

I'm so glad to see this and projects like this getting attention. I'm responsible for several tools at my current job using nothing but straight JS, including a couple which have had a significant (positive) impact on the special projects team here. I love JS. I love it's ubiquity (F12 in any browser and you've got a REPL). I love the freedom I have when I write in it to do whatever the fuck I want and shoot myself i…

I'm having trouble reasoning about this code, can you show me how it's used?

Re: Mini projects built with VanillaJS. No frameworks or libraries

#36

There’s no need for these projects to be “mini”. Javascript and html is a good choice for big things too. It’s still my go to “frontend stack” for lots of stuff today. Here’s a pretty big “VanillaJS” project I built back in 2006, back when we called these things web apps: https://www.twiddla.com/

Here is my VanillaJS project from 2010. http://np.ironhelmet.com (OK, there is a bit of jquery in there.)

this is my humble vanillaJS project from even later (2013 I think?) http://djkramnik.github.io/Kasparov/

Re: Mini projects built with VanillaJS. No frameworks or libraries

#37
post #18

Earlier quoted context omitted.

I always find it interesting that the people who unabashedly admit they have minimal front-end experience usually have the strongest condemnation of the current tools.

Don’t worry. People with a lot of front-end experience, in this case me, also condemn the current tools.

Can I ask what sort of front-end frameworks/tools you use that you also condemn?

Re: Mini projects built with VanillaJS. No frameworks or libraries

#38
I did a project around 2018 if I remember correctly where I did all of the code in inlined vanilla JS. It was simply firing off timed API calls for a pop quiz but it was resilient up to the point where a page reload would simply continue where the last question left off. Maybe 300 lines of code, max. Literally anybody that had to work on it kept asking why I didn't at least use jQuery or another flavor of the month framework.

"Can you point out in this code where using a framework is necessary?"

Never got an answer to that, still people were so nervous about the lack of JS frameworks.

Re: Mini projects built with VanillaJS. No frameworks or libraries

#39

I'm so glad to see this and projects like this getting attention. I'm responsible for several tools at my current job using nothing but straight JS, including a couple which have had a significant (positive) impact on the special projects team here. I love JS. I love it's ubiquity (F12 in any browser and you've got a REPL). I love the freedom I have when I write in it to do whatever the fuck I want and shoot myself i…

Woa there! Why would JavaScript have `with` if you weren't intended to use it‽ How about:

    let applyTemplate = template => object => {
        with(object) { 
            return eval("`"+template+"`"); 
        }
    }

Re: Mini projects built with VanillaJS. No frameworks or libraries

#40
Quick / dumb question : in the breakout game example (https://github.com/bradtraversy/vanillawebprojects/blob/mast...) wouldn't the game feel fast/slow depending on the power of your computer since the physics loop does not make use of the elapsed time between updates ?
Post reply on HN