Live data from Hacker News

None of my projects want to be SPAs

whatisjasongoldstein.com

71–80 of 362 posts

Re: None of my projects want to be SPAs

#71

The latest project I'm currently working on I got to choose how to build. It is an internal CMS. I went with Rails API, React, Material-UI. So far, I like it. I like separation. I know that one side ( ruby, rails, gems, pg, sql etc ) is all about data -> one mindset. Another side is about views ( js, css, html, multiple select, date pickers, autocompletes etc ) -> different world. I build my assets in one place, I wo…

I'm almost exactly the same situation these days: small project, got to choose my tech stack, so I went with a "conservative" part I have good experience with (backend in Flask) and a more experimental part (for me) that I'm taking the occasion to explore and learn: React + TypeScript + Material UI.

For that latter part, although I must recognize that the tooling has evolved into a quite complex pipeline (which is a cognitive investment, almost a gamble, in itself), I also clearly see the benefits of a set of ideas that have rapidly evolved in the turbocharged settings of the web development ecosystem:

React: the distillation of many programming paradigms (functional, composition over inheritance, etc) for building UI components.

TypeScript: the augmentation of JS with mature and powerful programming constructs.

Material: a visual language for UIs with a strong focus on coherence and being truly cross-platform.

All in all, although I'm well aware of the critiques that can be addressed to the modern webdev environment (the so-called "JS fatigue"), I feel like all these new tools empower me, and I really enjoy learning about them.

Re: None of my projects want to be SPAs

#72
I come across so many sites that have been needlessly built as SPAs, and so many of those are broken in ways that are really hard to understand even as a technically savvy user. For regular people, it's a truly appalling experience - the sites my wife has to use for work are all like this, all broken and all slow - she blames her laptop. SPAs need to die.

Re: None of my projects want to be SPAs

#73

Earlier quoted context omitted.

SPA isn't automatically the best solution for a page or site with frequent updates. The updates are handled by JavaScript and http calls. You can write a lot of that stuff in a dozen lines of JQuery with nicely refreshing content and ajax instead of throwing in large amounts of framework bloat.

> You can write a lot of that stuff in a dozen lines of JQuery with nicely refreshing content and ajax instead of throwing in large amounts of framework bloat. OTOH jquery is much bigger than you'd expect, there isn't much of a difference between a minimized jquery and vue, or even react once you factored in gzip. And while I've no experience doing so using vue, writing small dynamic react components embedded in larg…

[deleted]

Re: None of my projects want to be SPAs

#74
post #54

I went from MVC style all-in-one frameworks (Rails, Laravel) to application APIs fronted by single page applications and hope the developer mindshare tilts back to MVC frameworks. Something that'd take me an hour or two in Rails can take a week using these new tools, even after being reasonably experienced with them. Don't even get me started on Apollo (not my thing at all, and from my experience most don't know how…

For a component here and there React is a pretty bad choice because of its size. Svelte could be a more suitable option, but I’m not so sure it passes the magpie test.

[deleted]

Re: None of my projects want to be SPAs

#75
post #47

Earlier quoted context omitted.

SPA isn't automatically the best solution for a page or site with frequent updates. The updates are handled by JavaScript and http calls. You can write a lot of that stuff in a dozen lines of JQuery with nicely refreshing content and ajax instead of throwing in large amounts of framework bloat.

jQuery 2.1.3 is 27.8Kb. React + React DOM is 35.6Kb. 7.9Kb extra isn't nothing, but it's not something many sites really need to stress over. It's definitely not enough to state using React is adding "large amounts of framework bloat".

[deleted]

Re: None of my projects want to be SPAs

#76

We recently went in the opposite direction for a student project I'm working. We have a full SPA Angular frontend, and we use CouchDB as our datastore. There is a Node "backend," but it only serves things like Slack integration, the browser has a local PouchDB instance that directly syncs with the server's CouchDB. This way, we can deploy hotspots with nothing more than a Couch install and a static server for the SPA…

Are you running your own CouchDB instance?

Re: None of my projects want to be SPAs

#77
post #72

I come across so many sites that have been needlessly built as SPAs, and so many of those are broken in ways that are really hard to understand even as a technically savvy user. For regular people, it's a truly appalling experience - the sites my wife has to use for work are all like this, all broken and all slow - she blames her laptop. SPAs need to die.

Isn't this just the same as saying bad code acts badly though?

People can, and have written bad websites using every technology. I can think of plenty of badly written, hard to use MVC websites from my past.

It should come as no surprise, that bad developers have found ways to make badly written SPAs as well today.

I don't think we should judge a technology by its worst implementations.

Re: None of my projects want to be SPAs

#78

I don't use Elixir/Phoenix, but Phoenix's LiveViews brings all the butter to the monolith bread. State remains on the server, only visual state is sent over websockets, and the HTML is transformed with morphDOM. https://dockyard.com/blog/2018/12/12/phoenix-liveview-intera... I hope to see this idea brought to Rails, but the its websocket story doesn't seem there yet.

I agree - it seems like a LiveView equivalent for Rails should be doable in principle. Check out these two projects, they're sorta heading in that direction: Fie: https://fie.eranpeer.co/ AnyCable: https://anycable.io/

Re: None of my projects want to be SPAs

#79
Back when I was doing React, what pulled me in was that it WASN'T a framework for SPAs. What I got from it was the ability to build UI widgets (components, in React terms) that worked within a page, and were composable with other UI widgets.

With that approach, you really wanted to keep every component self-contained. That meant a lot of bookkeeping with passing events back and forth between parent and child widgets, but while it was a lot of typing, it was all fairly easy, and if I wanted to change how an event was handled, it usually only involved a component and MAYBE the components immediately above or below it in the component tree. Data passed further than that was generally wrapped in objects and therefore didn't require code changes.

Then introduce Redux and similar frameworks, and I totally lost interest. It's as if the entire React community forgot all the lessons they learned writing Python and C programs in college and went back to creating global state. What in the actual hell? I wrote a good amount of code in Redux, too--I worked on teams that used it--so this wasn't just pre-judgment. These frameworks add a huge amount of hidden global complexity just to avoid having to pass parameters to components, which is the simplest thing to do.

And once you're doing that, you HAVE TO write an SPA, because any part of the page you want to be interactive gets pulled into Redux and your JS eventually eats the whole page. It's an infection.

When writing JavaScript now, I sometimes end up rolling my own version of the component style. It's an effective design pattern for UI widgets. But it hasn't been worth it to use React for a while now because the tooling and tutorials are all too conflated with Redux and similarly awful tools. And on a team, there's always the worry that someone on your team will infect your code with Redux and it will grow and consume your entire site. It's a real shame.

Re: None of my projects want to be SPAs

#80
I feel as if many sites that used to be fine and work well have regressed in usability and features and introduced unexpected behaviors and bugs since the SPA paradigm seems to have taken over. This seems especially true for many corporate, bank, shopping brand sites, etc. An example is the Capital One 360, Chase, and AMEX sites and even Reddit.

Even JustWatch.com seems like it's fairly polished, still has it's quirks. So, I just end up using InstantWatcher.com instead. Hacker News works well as is too, except the search on the bottom can act up it seems once in a while.

Edit: How could I forget, Netflix. The UI, getting to the details of a show/movie. Browsing, discovery, searching, it all feels broken and unintuitive. The DVD site last I checked was still decent. Netflix seems like the poster child for usability and regression issues moving to a SPA.

Post reply on HN