Live data from Hacker News

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

github.com

101–110 of 154 posts

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

#101

I know in this community the overloaded value for vanilla in this context means just javascript without other people's javascript. But "vanilla web" should really mean HTML and CSS.

no js = just html and css

no framework js = topic of this link

vanilla = a bean, or a flavor

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

#102

> Naively re-rendering a whole component using .innerHTML should be avoided as this may hurt performance and will likely break important functionality such as input state, focus, text selection etc. which browsers have already been optimizing for decades. I think this statement deserves some serious scrutiny. In many cases the performance hit may not be relevant or noticeable. I know this because I've been very produ…

That's what OP means: https://codesandbox.io/s/elastic-rubin-hxpcw?file=/src/index... And that's why reconciliation algorithms became so popular. You can't be serious when you say that losing input focus and text selection have never been relevant to you. Basically, dealing with the internal state of components down the tree becomes a nightmare.

it is possible to track and set cursor location after updating innerHTML... it is definitely no longer simple and clean though haha.

https://codesandbox.io/s/zealous-vaughan-qd3gg?file=/src/ind...

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

#103
post #101

I know in this community the overloaded value for vanilla in this context means just javascript without other people's javascript. But "vanilla web" should really mean HTML and CSS.

no js = just html and css no framework js = topic of this link vanilla = a bean, or a flavor

In the software sense, vanilla means "in it's original form, without addons, modifications, abstractions, third party libraries, ...".

Like a "vanilla kernel" is a Linux kernel without (distributor) patches. Or a "vanilla debian" is a Debian system without third party repositories or software.

Regarding parent, I could say... you cannot make a permanent To-Do web app, with HTML+CSS... drag and drop? data persistence? you need a backend (and JS for event handling) or as in this case local storage via JS.

OK, you can make a simple To-Do with static forms being sent to a backend... but then you have HTML+CSS+something (java, python, php, ruby, perl, golang, whatever), not only HTML+CSS.

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

#104

I know in this community the overloaded value for vanilla in this context means just javascript without other people's javascript. But "vanilla web" should really mean HTML and CSS.

Sure, so which subset of HTML are we talking about?

Because unless I'm misremembering things, HTML 2.0 (literally the first version intended to be a standard going forwards) came out exactly the same year that JS dropped in a commercial browser (1995), and superseded the previous HTML and HTML+ markups.

So surely you don't mean HTML with things like file uploads, or GIF support. Because that's not "vanilla" in your world.

/s

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

#105
post #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 ne…

> 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. Often a custom micro-framework better suits the needs of a particular project. I've written micro-frameworks for specific projects intentionally, because they did a few things that the established frameworks either didn't do, or it was very difficu…

> Often a custom micro-framework better suits the needs of a particular project.

Fitting the needs of a particular project is frequently a local optimum however. Often, it's much more optimal to focus on the needs of a whole team or even whole company. You can hire people who already know React/Vue/whatever, but there is no one in the world who knows your micro-framework.

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

#106

Earlier quoted context omitted.

React has been stable since ~2015, and there are no signs of that changing.

I guess this depends on your definition of "stable". Sure, React code written in 2015 will still work, but it's hardly the "modern" way to write React and if your organization's code was written entirely in 2015, engineers will probably be clamouring to rewrite it. Taking the somewhat-arbitrary but reasonable standpoint that "stable" means that there aren't any major architectural changes required to bring a codebase…

Apparently modern housing uses PEX water pipes, but my house has a mix of PEX, iron, and copper pipes. The water flows just fine. I'll probably rip out the iron and copper eventually when I do a major remodel, but I'm not stressing about it.

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

#107
post #21
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…

Original author here - thanks! Yes, ES5 is a huge pain. However, I believe 5% of users (see other comment) are not a joke for many apps. There's always the question of minimum critical APIs required: If you build a 3D or webcam app you can forget ES5 altogether, of course. > It’s a lot like using polyfills when needed. Never thought of it this way, thanks for that! As is state in the conclusion, the study would likel…

5% is not a realistic number for ES5. 1% of users are IE11 and the other 4% are weirdos like Opera Mini that won’t work no matter what JS you use.

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

#108
post #105

Earlier quoted context omitted.

> 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. Often a custom micro-framework better suits the needs of a particular project. I've written micro-frameworks for specific projects intentionally, because they did a few things that the established frameworks either didn't do, or it was very difficu…

> Often a custom micro-framework better suits the needs of a particular project. Fitting the needs of a particular project is frequently a local optimum however. Often, it's much more optimal to focus on the needs of a whole team or even whole company. You can hire people who already know React/Vue/whatever, but there is no one in the world who knows your micro-framework.

But due to its micro-size, it won't take long to learn.

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

#109

Earlier quoted context omitted.

That's what OP means: https://codesandbox.io/s/elastic-rubin-hxpcw?file=/src/index... And that's why reconciliation algorithms became so popular. You can't be serious when you say that losing input focus and text selection have never been relevant to you. Basically, dealing with the internal state of components down the tree becomes a nightmare.

it is possible to track and set cursor location after updating innerHTML... it is definitely no longer simple and clean though haha. https://codesandbox.io/s/zealous-vaughan-qd3gg?file=/src/ind...

Your answered yourself there. It's not only about input focus, it could be anything really, like loading state, form values, progress indicator, etc. People will be basically building yet another framework at the end. React is not the only solution, there are plenty of lighter alternatives. OP's solution is just very type-unsafe.

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

#110

I know in this community the overloaded value for vanilla in this context means just javascript without other people's javascript. But "vanilla web" should really mean HTML and CSS.

Sure, so which subset of HTML are we talking about? Because unless I'm misremembering things, HTML 2.0 (literally the first version intended to be a standard going forwards) came out exactly the same year that JS dropped in a commercial browser (1995), and superseded the previous HTML and HTML+ markups. So surely you don't mean HTML with things like file uploads, or GIF support. Because that's not "vanilla" in your w…

/s all you want but the distinction between documents and applications is clear.
Post reply on HN