Live data from Hacker News

Building a robust frontend using progressive enhancement

gov.uk

21–30 of 168 posts

Re: Building a robust frontend using progressive enhancement

#21

This advise may have been correct for old-school SPAs, but most if not all points should be fixed in the current generation. E.g. first page load is static or SSR, and then the page is hydrated as a accessible SPA including url manipulation. Also automatic a no-js fallbacks are provided with many.

Having to deploy a dedicated server unit to render your frontend is a lot of additional complexity for zero benefit when you still require an API server to actually drive everything.

Have your API server render the HTML itself and your entire stack becomes radically simpler. Iteration speed goes through the roof.

If you're not building Google Sheets, skipping the entire SPA universe provides massive benefits with no notable downsides. The same UX can be provided either way but often with improved performance which actually means a better UX

Re: Building a robust frontend using progressive enhancement

#23

OMG it feels so good to not be the lone voice in the woods. I would say about 3/4 of my frustrations as a user are from sites that should have simply been built with HTML + CSS and minimal Javascript. The front end community most days feels like a jobs program.

Same here as developer, I only put up with SPAs at work, because job title isn't doing fronted stuff.

However on side projects it is pretty much vanilla.js without any kind of SPA related stuff.

Re: Building a robust frontend using progressive enhancement

#25

What’s old is new again. Maybe we should prioritize the simplest possible solution rather than what’s trendy today.

Just watched the recent DHH keynote at Rails World, I might not do Rails, but fully on-board with his point of view with where modern Web has gone.

Re: Building a robust frontend using progressive enhancement

#27

“You should consider using this in your requirements” implies that this is not a hard rule, it’s just an ignorable suggestion. It would be interesting to audit gov.uk web pages over time to see whether this advice is being followed.

Don't forget the rules of British English that make it very clear that the grammatical construction: "you should consider" means "you must in all circumstances save for the immediate alternate outcome being a genocide."

Re: Building a robust frontend using progressive enhancement

#28

Good advice, but > - users of assistive technology would be unaware of changes in context, for example when moving to a new page > - it would fail to handle focus when moving between pages > - the user would be unable to navigate using the back or forward buttons in their browser > - users would be unable to recover from an error, for example if there is an interruption to their network connection These aren’t strict…

You kind of get it out of the box with plain old HTML though. Once you get into SPA territory you’re reinventing a lot of wheels to get back to parity, or replacing native functionality with JS alternatives.

Consider multi-page forms: how many SPAs just store all of that in memory and then make one request at the end? Without JS, the BE would be saving the state for each step so you could come back to the form later or refresh without losing anything.

Re: Building a robust frontend using progressive enhancement

#29
post #20

A lot of (younger?) people seem to think that you need JS when just a regular html form would do.

I’ve run into developers that don’t understand how regular HTML forms work and think everything needs a REST call with JSON. Many of them were not young.

Re: Building a robust frontend using progressive enhancement

#30
post #14

Earlier quoted context omitted.

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.

[deleted]
Post reply on HN