Live data from Hacker News

Building a robust frontend using progressive enhancement

gov.uk

11–20 of 168 posts

Re: Building a robust frontend using progressive enhancement

#12
Even the article notes that mindless server-side is not good software engineering. (Note the use of the phrase "can cause problems" instead of "does cause problems".):

> If you do choose to use client-side JavaScript frameworks, be aware that although they can be helpful when building a service with a complex user interface, they can introduce problems.

> Using a client-side JavaScript framework can:

> - increase the overall size of your code base and push processing to the client-side, causing performance issues for users with a slower network connection or lower powered device

> - create a reliance on third-party code that your developers do not have control over, requiring you to make major changes to your service in order to stay up to date with changes in the framework

> - make it difficult to find people with the skills required to maintain the code, if the framework’s loses popularity over time

> If you use a JavaScript framework you should:

> - be able to justify with evidence, how using JavaScript would benefit users

> - be aware of any negative impacts and be able to mitigate them

> - consider whether the benefits of using it outweigh the potential problems

> - only use the framework for parts of the user interface that cannot be built using HTML and CSS alone

> - design each part of the user interface as a separate component

> Having separate components means that if the JavaScript fails to load, it will only be that single component that fails. The rest of the page will load as normal.

Re: Building a robust frontend using progressive enhancement

#14
post #6

When even governments knows the web better than the tech industry by and large itself. I despise React, ended up with Svelte+Typescript and now I realise that could do it all mostly with HTMX + templating with bit of alpine.js if at all.

Despise React's unnecessary complexity and non-standard-compliant non-separation-of-concerns squeeze-it-all-in-js approach as well. Svelte(kit) is still the most W3C compliant of the major frameworks out there. Also, it's not even a runtime-framework but a compiler, meaning you're left with nothing but the necessary HTML, JS & CSS just relevant for your page.

Lit is also totally web standards compliant to be fair.

Re: Building a robust frontend using progressive enhancement

#15
This is what I try to follow - serving html with prefetch data from the server, what could be done on client I do on client to minimize server round trips, minimum css (responsive layout) and vanilla js. Separate web pages as needed. Somehow that sounds weird and oldfashioned with my colleagues since I'm using only html, css and vanilla js? I don't miss a thing...

Re: Building a robust frontend using progressive enhancement

#16
I started web stuff in the 90s as a child. I didn't know what CSS or JS were, except the latter you could copy/paste some magic scripts to make things flash and suchlike. Later I built dynamic sites with PHP for local businesses. I learnt JS and CSS at this point (to some extent as least). Then I decided to quit web development because I couldn't stand spending so much time things to work with the shittiest browser available (IE6).

After almost 6 years away I came back around 2015 when I realised a web server would be useful for whatever I was doing. I was shocked to find the world had forgotten about so much regarding HTML and CSS. We used to build multiple stylesheets for our sites. That was forgotten. We used to make stuff work without JS first, then add JS as a nice-to-have afterwards. That was forgotten. I saw web devs just doing all their form validation in js and the server doing none. Shockingly, this is still common today. I'm not aware of a common pattern where you get the server to do validation and just display it in js. Everyone seems to either duplicate or not even do it on the server at all!

When I saw this I was no longer impressed by what people were doing on the web because it wasn't the web I knew, it was just "applications" built in JS. Trying to argue for "web first" was a losing battle.

Re: Building a robust frontend using progressive enhancement

#18
post #6

When even governments knows the web better than the tech industry by and large itself. I despise React, ended up with Svelte+Typescript and now I realise that could do it all mostly with HTMX + templating with bit of alpine.js if at all.

Despise React's unnecessary complexity and non-standard-compliant non-separation-of-concerns squeeze-it-all-in-js approach as well. Svelte(kit) is still the most W3C compliant of the major frameworks out there. Also, it's not even a runtime-framework but a compiler, meaning you're left with nothing but the necessary HTML, JS & CSS just relevant for your page.

React in the hook's era has gotten overly complex. The cods is unreadable and hard to reason about. Check any longer/complicated component as an example riddled with hooks.

Comparatively, Svelte has a much simpler mental model and at the end, leaves nothing but basic plain old javascript.

But I tend to question these days that do we need this much Javascript?

Post reply on HN