Live data from Hacker News

Plain Vanilla Web

plainvanillaweb.com

41–50 of 715 posts

Re: Plain Vanilla Web

#41

I work for about 2k users, they do not give a shit about reactivity... build a monolith, make it comfy, embrace page refresh (nobody gives a fuck about that in the real world), and get shit done.

Even so you can do insanely simple refreshing dynamics with CSS and JS without importing any npm packages.

Re: Plain Vanilla Web

#42
The navigation bar of that site to not stay put, vertically, when you click one of the links.

That in itself undermines a lot of the author's message, as they were not able to reasonably de-framework themselves.

(And - it's not hard to get the navbar right, in any number of ways. But you do have to do a bit of work before you preach things to others.)

Re: Plain Vanilla Web

#43

I support the general idea here but just because something is in a browser doesn't mean it's a good formalism. Notably, Web Components. They're fantastic for distributing components - after all, a Web Component will work in every framework (even React, the IE of frameworks, finally added support), or even in vanilla HTML. So you can build a component once and everybody can use it. It's fantastic. But for internally c…

I haven't started using Web Components, but I was under the impression that libraries like Lit address most of the issues you mentioned for devs who don't want to write their own minimal base class, no?

Re: Plain Vanilla Web

#44
This guide assumes web components is a viable alternative for frameworks like React or Vue. That's a very superficial assumption. React and Vue render the UI as declarative function of state, with the help of components. That's why we use those frameworks. Web components don't solve the state management problem.

Re: Plain Vanilla Web

#46

Very cool overview and a great article—it’s fascinating to see how far web components have come. Data passing, interactivity, and state management still seem pretty tedious in vanilla, though!

State management is arguably one of the most important problems to solve. That's why we use React and Vue. You can very easily build complex user interfaces at scale with those frameworks. And you can even take web components along for the ride if you want to. They are partially overlapping solutions for different problems.

Re: Plain Vanilla Web

#47
In theory, “de-frameworking yourself” is cool, but in practice, it’ll just lead to you building what effectively is your own ad hoc less battle-tested, probably less secure, and likely less performant de facto framework.

I’m not convinced it’s worth it.

If you want something à la KISS[0][0], just use Svelte/SvelteKit[1][1].

Nowadays, the primary exception I see to my point here is if your goal is to better understand what’s going on under the hood of many libraries and frameworks.

[0]: https://en.wikipedia.org/wiki/KISS_principle

[1]: https://svelte.dev

Re: Plain Vanilla Web

#48
As someone with a 'full stack' history (ie basic front end knowledge compared to a full-timer on that coal face every day), I do notice a lot of the stuff jQuery does is now native to the browser, like being able to use fetch with promises in a few lines of code, or select stuff with querySelector(All)? or xpath. Then all the nice additions to CSS (and HTTP, no more sprites) that weren't possible in the past and remove the need for frameworks.

I tend to rely on Bootstrap so the layout is reasonable on mobile- but that's purely through my own lack of experience.

But I guess someone with a more intimate knowledge can easily get the idea of building a framework. Then add on all the use cases and feature requests...

Some web pages, particularly traditional media websites are absolute hell holes of bloat, but I guess that's more about their ad serving than lean web development.

Re: Plain Vanilla Web

#49

I support the general idea here but just because something is in a browser doesn't mean it's a good formalism. Notably, Web Components. They're fantastic for distributing components - after all, a Web Component will work in every framework (even React, the IE of frameworks, finally added support), or even in vanilla HTML. So you can build a component once and everybody can use it. It's fantastic. But for internally c…

I haven't started using Web Components, but I was under the impression that libraries like Lit address most of the issues you mentioned for devs who don't want to write their own minimal base class, no?

Sure but this page is about not using a framework. Once you're on board with using a framework like Lit, you might as well use Preact or Svelte or a similarly lightweight framework. The "web component" angle adds no value if it's all internal to your app.

Lit is amazing though. It's fast, lean, and easy to learn. In fact, to my experience, the only things about it that are un-ergonomic, are due to the fact that it's built around web components. Lit without web components would be so much better (again, except if you're building something to be distributed to other programmers on any framework). It wouldn't have a single global registry of components, it wouldn't have that attribute mess, and I bet it'd not need a compiler at all (it doesn't need it now either, but is easier/nicer with it).

Re: Plain Vanilla Web

#50
post #36

A solid overview with some great tips. One recommendation is to change the mental model here. In my eyes it isn’t “don’t use a framework”, it’s “build the framework you need”. It’s tremendously easy to set up an extension of HTMLElement that has 90% of the functionality you’d want out of react. My SPA non.io is built like this - one master component that has class functions I want, and one script for generic function…

> It’s tremendously easy to set up an extension of HTMLElement that has 90% of the functionality you’d want out of react.

The last 10%, OTOH...

Post reply on HN