Live data from Hacker News

Vanilla-todo: A case study on viable techniques for vanilla web development

github.com

1–10 of 154 posts

Re: Vanilla-todo: A case study on viable techniques for vanilla web development

#2
This is nice, patterns over libraries.

I would question the choice to use ES5, as it makes it significantly more complicated to handle dependencies between modules in a scalable way. I understand the point of avoiding a build step, but if the code can run in modern clients without it I don’t think it breaks the spirit of the project to use a bundler to support certain older browsers. It’s a lot like using polyfills when needed.

Re: Vanilla-todo: A case study on viable techniques for vanilla web development

#4
post #2

This is nice, patterns over libraries. I would question the choice to use ES5, as it makes it significantly more complicated to handle dependencies between modules in a scalable way. I understand the point of avoiding a build step, but if the code can run in modern clients without it I don’t think it breaks the spirit of the project to use a bundler to support certain older browsers. It’s a lot like using polyfills w…

Agreed, I originally thought this might be an older project from a couple of years ago because of the ES5. “Vanilla” doesn’t have to mean “supports IE11” in 2020 (before anyone jumps on me, yes, depending on your users you may very well still need to support it, but it’s very clearly on the way out - finally)

I love the motivation behind the repo though. The author’s write-up is fantastic and refreshingly reasonable in the dogmatic webdev world. It gives great insight into the places where real value _is_ provided by frameworks and build tools

Re: Vanilla-todo: A case study on viable techniques for vanilla web development

#5
I don't know who originally said it but "If you're not using a framework, you're building a framework". This repo even has the following caveat: (2) These usually end up becoming a custom micro-framework, thereby questioning why you didn't use one of the established and tested libraries/frameworks in the first place.

That said, I don't hate it. For quite some time, I've taken the stance that a web development team needs an opinionated framework, but it's fine for it to be a bespoke creation rather than off-the-shelf. The biggest value of choosing React, Vue, Svelte, etc is, in my opinion, less about it doing the heavy lifting for you with the DOM and more about adopting an established valid opinion to guide the team's development.

Re: Vanilla-todo: A case study on viable techniques for vanilla web development

#8
post #2

This is nice, patterns over libraries. I would question the choice to use ES5, as it makes it significantly more complicated to handle dependencies between modules in a scalable way. I understand the point of avoiding a build step, but if the code can run in modern clients without it I don’t think it breaks the spirit of the project to use a bundler to support certain older browsers. It’s a lot like using polyfills w…

I did not know how widespread ES5 is nowadays: https://caniuse.com/es6 says 94.69% of users worldwide use a browser that fully supports it.

Re: Vanilla-todo: A case study on viable techniques for vanilla web development

#10
post #7

The trick is to stop thinking XML/HTML and instead use functions which returns elements/components. First write the app in spaghetti code, then turn it into pure functions. var app = todoList(data); document.documentElement.appendChild(app);

In other words, the good old MVC pattern.

(M) Model is your `data`. (V) View is what your function returns. (C) Controller is the functions your elements may use to mutate the data.

Post reply on HN