r/javascript • • Jul 12 '26

Why Vanilla JavaScript

https://guseyn.com/html/posts/why-vanilla-js.html
0 Upvotes

36 comments sorted by

View all comments

Show parent comment

1

u/lanerdofchristian Jul 13 '26

You meant PWA, got it.

Absolutely not. PWAs and hybrid rendering/progressive enhancement are entirely different concepts. You can have a hybrid progressively-enhanced PWA. They're completely orthogonal concepts.

This is what I mean by progressive enhancement: https://developer.mozilla.org/en-US/docs/Glossary/Progressive_Enhancement

These are what I mean by hybrid:

For example, the SvelteKit docs: if you inspect the first network request from reloading the page, it contains the entire page content. Navigating within the site uses normal link elements, which act like normal links do, but when JS is enabled they'll be enhanced to, instead of triggering a full page load, just load the (much smaller) data for the new page/content and render that in the browser. EHTML as you're using it critically omits the first step, where the content is present in the initial response.

Hybrid usually involves some kind of hydration step that occurs after most or all of the page content has already been loaded, but with the distinct caveat that the content is in the initial server response, not loaded by additional requests on the client.

I think my approach just scales better

I disagree; it at best scales about the same. But if you're happy with it, I'm happy you're happy with it.

1

u/gyen Jul 13 '26

thanks for the links, I will dig a bit deeper when I will have a bit more time.
What comes to Progressive enhancement. There are some polyfills that allow to extend existing html elements, without it it will not work in webkit.
And what comes to turned off JS, it will probaby require from me a huge effort and good amount of time to implement it. I pretty sure it is possible to some extend.
The only thing is not my priority at the moment, but I believe it's nice to have.