Live data from Hacker News

A JavaScript-Free Front End

dev.to

41–50 of 215 posts

Re: A JavaScript-Free Front End

#41
post #14

Since I'm caching and gzipping everything, each subsequent pageview is around 6 KB; far smaller than the SPAs I've seen with equivalent functionality. That's ace. But my internet connection has a 2 second latency so I still have to wait an annoyingly long time every time I interact with your app. My connection is terrible too, so it drops every 10th request, and now I'm seeing a lot of broken pages. If only you'd wri…

I keep hearing offline-first trumpeted, but I have seen no examples of what that means. Terrible connections exist. But I fail to see how adding more scripting will always help with that. Service workers are definitely promising, but documentation for common use cases is still lacking. Even with a terrible connection, I would still trust a server-side app to load correctly on a refresh more than a SPA. If anything, t…

> But I fail to see how adding more scripting will always help with that

Your app has no control over browser connection management. JavaScript you write is aware of idempotency and retry semantics of your app, so it can manage requests more intelligently than the browser, without disrupting the user experience.

So sure, it won't always help if you do it badly, I can see how it always helps if you do it well.

Re: A JavaScript-Free Front End

#42

This write-up mostly highlights the loading speed and bandwidth benefits but not requiring javascript is far better than just that. In the age of spectre and with browsers exposing more and more bare metal functionality the idea of running arbitrary code on every random site I go to is absurd. There's dozens of us that simply don't run JS. Sites like these (and, say, the way chicago public media does fallback for no…

I'm not sure if you meant this or not, but there's text.npr.org. Honestly I'd prefer much of the web this way. I'd be OK with images too.

Re: A JavaScript-Free Front End

#43
post #21
post #8

This is totally true. We've recently started to discover this paradox ourselves: when styling and layout is all done via CSS, and JS + other assets are cached, HTML is just as light weight as JSON over the wire. As ashamed as I am to admit it, our newest innovation appears to be "multi-page apps"!

I remember there was some ridiculous article here where the author claimed to build world's fastest web app with PReact. It was a hierarchical list of HTML5 features with some tick-boxes. Out of curiosity I converted the giant JSON blob to list. HTML was about 15% smaller than JSON. You could also do most of the "logic" of the app via styling and normal HTML controls.

The benefit of JS comes in incremental updates. When you update that list with a new item, you can use optimistic update and small payloads in JS, while in HTML you have to load the whole page again, which is slower.

Re: A JavaScript-Free Front End

#44
What JS does can be reduced to several things:

- storing states, and conditionally passing states around

- toggling things on or off

- element reuse

- dealing with events

- ajax

Unfortunately it's unlikely HTML & CSS would support all these.

Re: A JavaScript-Free Front End

#45

This write-up mostly highlights the loading speed and bandwidth benefits but not requiring javascript is far better than just that. In the age of spectre and with browsers exposing more and more bare metal functionality the idea of running arbitrary code on every random site I go to is absurd. There's dozens of us that simply don't run JS. Sites like these (and, say, the way chicago public media does fallback for no…

> There's dozens of us that simply don't run JS

Was this intentional? It gave me a bit of a chuckle.

Re: A JavaScript-Free Front End

#46
Nice work, I definitely appreciate the focus on simplicity/speed. I just signed up to check it out.

I noticed on the invoice page, on mobile, the number inputs (qty, price, etc) showed the full alpha keyboard on input. I think you can add a few attributes to optimize, without using JS also.

Great work, thanks for sharing.

This link has been helpful for me:

https://developers.google.com/web/fundamentals/design-and-ux...

Re: A JavaScript-Free Front End

#48

100 percent agree. Use as little JS as possible on front end. And then definitely use zero JS on backend.

That seems a bit extreme. IMO that's a bit like saying "use zero Elixir/Erlang on the backend". I think a few people would take more contention with that line—and they're both languages running on VM's with a specific performance target.

Re: A JavaScript-Free Front End

#49

Im not sure how elegant I think the CSS hack is compared to just making a simplistic script for it. Would a user really notice the parsing time for such a simple javascript application?

I object to considering the techniques in the article "hacks". They all employ minimal markup, without extra boxes or complicated classes, and the CSS side is very simple.

Re: A JavaScript-Free Front End

#50
post #44

What JS does can be reduced to several things: - storing states, and conditionally passing states around - toggling things on or off - element reuse - dealing with events - ajax Unfortunately it's unlikely HTML & CSS would support all these.

webrtc, webasm, webgl, and a million other things, right?
Post reply on HN