Live data from Hacker News

If Not SPAs, What?

macwright.com

371–380 of 456 posts

Re: If Not SPAs, What?

#371
post #12

My argument for SPAs rests on the completely subjective yet I feel incredibly powerful impact of latency. When anything takes more than 50ms to react, it becomes mentally jarring to the user. Whether it is typing in an SSH session, clicking a menu with a mouse, auto-completing a box, etc - all these things generate a completely different human response and relationship with the application if they get below that thre…

Yet, my experience is that it makes more sense to just implement those features that need more interactivity on the frontend.

It's incredibly wasteful to do a SPA for one autocomplete field, or one map widget, etc. HTML delivered directly to the browser is very responsive.

Re: If Not SPAs, What?

#372

Earlier quoted context omitted.

When anything takes more than 50ms to react, it becomes mentally jarring to the user Yes, but you often pay a huge penalty on the first page load, which for many use cases is the most important. I'd be so happy with a turbolinks version of GMail.

Use the basic HTML version of Gmail, you can set it to be default.

And it's so responsive!

Re: If Not SPAs, What?

#373

With all due respect, I don't think the question is "how do we simplify SPAs?"; I think the question is "why do we need to run any app in a browser?" Look at the work associated with the "Next Billion Users" project [1]. Most of our assumptions about how-and-why are merely based on luck-and-whim. We didn't arrive at SPAs through some elaborate Grand Design. I just don't understand what a web application offers that c…

My perspective on this question is that its convenience. If the app is something relatively simple, I just want to use it on the browser and not have to go through the steps of installing software that I probably will only use once. Also using a webapp is less dangerous than installing a program in the sense that it can't read your files, install malware, etc. I can relatively safely use an unknown webapp with confidence, but I would only install a program on my actual computer if I trust the author of it.

Re: If Not SPAs, What?

#374
post #316

Earlier quoted context omitted.

> You might not want to use JS but a language “like” JS such as TS or Lua would definitely be on the table. Or just JS without the biggest warts. When you remove the warts from JS there's not much left. And I'd be pretty skeptical of someone starting a new project in Lua today. I think the mainstream choice for a "blank slate" language today would look something like Swift or Kotlin; Typescript can gets close, but it…

> When you remove the warts from JS there's not much left Modern JavaScript is pretty sweet to write compared to pre 2015. It sure is fun to join in on the "JavaScript bad" circle jerk though.

When the bar are languages like F#, Haskell, Elm, Reason... How can JS be considered good? All languages have warts, but JS is a language full of them, ambiguity is the name of the game, mutating everything is encouraged and global mutable state is everywhere. Very little has changed for JS outside of syntax, the core is still rotten.

Re: If Not SPAs, What?

#375

I use Clojuresript with a react interface to create SPAs for data analytics UI at work. It is much simpler and easy to manage. For me developing applications with javascript tend to get complex over time as the app grows. State management is really simple in Clojurescript. I was able to create reusable components which can be ported over to new projects with little effort. I now find it much more easier to develop th…

In your video, you're just hitting localhost.

This is a just a demo to show front end UI.

Re: If Not SPAs, What?

#376

Earlier quoted context omitted.

I would also prefer something like Next.js with partial hydration. But what I want in that is probably a much bigger ask: I want the partial hydration to be performed automatically with static analysis. Something like Svelte (real DOM codegen, no need to ship a library to the browser) would be especially nice, but I don’t want to give up JSX. In the end, this is probably well outside the scope of a framework coupled…

I'm not sure if we're saying the same thing, by partial hydration I mean only wiring some specific client side components for interactivity. As in only shipping the react components over the wire that need to be rendered on the client for user interaction. Meaning the overall page is vanilla HTML, but some subtrees are React wired components. Complete with state management that can work between all of them. In which…

Yes, that was what I meant as well. But as I’ve read about the approaches currently available, all of which require manually opting in per component, I’ve had two thoughts:

1. Manually marking a component for hydration likely means shipping the whole structure below as JS, which may hit diminishing returns fairly quickly.

2. At least if you’re using TypeScript, enough is known (or could/should be) to determine which components are truly static. Next.js already has a rudimentary version of this. That kind of analysis could be a huge DX improvement.

Re: If Not SPAs, What?

#377
post #353

Earlier quoted context omitted.

I'm definitely not a mindless CTO. ;) Micro front-ends is the concept of breaking apart a front-end monolith. SPA's are usually built in one framework like Angular or React. Over time, this can get very convoluted and turn into a bad monolith (there are good ones). The second part is that instead of building screens, you design features (like invoices or customers or catalog) and develop the set of views that encapsu…

> I'm definitely not a mindless CTO. ;) Based on this comment you do kind of sound like one. Could you elaborate on what you think 'Domain Driven Design' is, and what you think 'boundaries' are in the context of development? It would help dispel the impression I get that you're a clueless CTO who knows enough to be dangerous. (apologies for being a bit rude perhaps; consider it a comment slightly in bad faith, but ve…

DDD is a set of principles where you have conversations with your business partners, model scenarios, determine a ubiquitous language, and build software that mirrors those models and conversations. Determining your bound-contexts, their relationship to other bound-contexts, and determining where sub-domains belong. Though this can be confusing since you could have an "order" domain in several bound-contexts with different purposes. It also tends to move away from traditional OO modeling since we're pulling things apart, not abstracting them in order to decouple. I took Eric Evans 5-day class two years ago, but I've been professionally utilizing DDD for about five years including helping build Accenture's new performance management system.

Re: If Not SPAs, What?

#379
post #353

Earlier quoted context omitted.

> I'm definitely not a mindless CTO. ;) Based on this comment you do kind of sound like one. Could you elaborate on what you think 'Domain Driven Design' is, and what you think 'boundaries' are in the context of development? It would help dispel the impression I get that you're a clueless CTO who knows enough to be dangerous. (apologies for being a bit rude perhaps; consider it a comment slightly in bad faith, but ve…

DDD is a set of principles where you have conversations with your business partners, model scenarios, determine a ubiquitous language, and build software that mirrors those models and conversations. Determining your bound-contexts, their relationship to other bound-contexts, and determining where sub-domains belong. Though this can be confusing since you could have an "order" domain in several bound-contexts with dif…

I think the problem is your didn't concretely explain what your method entails and how it is any different from doing a plain HTML website or a Javascript one. Technically, there is a server, and a client, so what do you do exactly on the server and the client and how does it difference from other methods?

It's like someone asking you how does AJAX works and your start discussing functional programming. It doesn't explain what AJAX is and how does it differ from plain server side rendering.

Re: If Not SPAs, What?

#380
post #358

There is nothing wrong with reloading a page. Hackernews is doing it. On the other hand a page not working because webdevs deemed your browser outdated really is problematic.

This is something I really struggle to understand about the modern web dev mentality. What is exactly so bad about reloading a page? You get visual cues that the browser is doing work, and the page you requested is being downloaded. On the other hand, some SPAs literally provide zero cue when a route has been changed, which is just awful UX to me.

Agreed. For the most part I don't really care, the target audience of those services is probably people who put up with that kind of bullshit. But there are cases when functionality and compatibility should trump everything e.g. banking software or e-governance.
Post reply on HN