Live data from Hacker News

None of my projects want to be SPAs

whatisjasongoldstein.com

161–170 of 362 posts

Re: None of my projects want to be SPAs

#161

Earlier quoted context omitted.

I recently started a hobby project and initially went with a JS solution. But when I had to start deciding on auth, maybe an orm, routing, db layer, and templating, I said fuck it and installed Rails. Previously I had never built a real product in Rails, only the book store tutorial. I'm really happy with Rails so far. I don't have to worry about a lot of shit I had to worry about in JS land and now I can focus on th…

This is my experience as well. Sometimes the conventions are frustrating, and particular to Rails I still don't know how to handle the front end well aside from jQuery (how are you doing it? Stimulus + Turbolinks, or...?), but is it ever refreshing to just focus on your product instead of all the tooling surrounding developing your product.

If you need a lot of JS, Vue is a nice choice. You can drop it in for just a single page of your site if you need heavy JS on one part but still want Rails on the rest. Or you can go full-on Vue front end with Rails in API mode, or anywhere between.

Re: None of my projects want to be SPAs

#162

This may be a mean thing to say, but basically I think SPA's are massively overused, because developers want to demonstrate that they can do them. Why? Because big companies like Facebook and Google use them. Why? Because they actually are doing things that require them. 99% of the SPAs in production are things that should have been done the old Rails/Django/Laravel way, but that would not set you up as a developer w…

Yeah, some people go so far as to directly claim that something is good because Google uses it. And when Google uses it, it probably IS good for solving Google's problems. But most people aren't Google and don't have Google's problems.

Ugh… We've had one of those developers. Now we're stuck with a legacy GWT¹ SPA that sucks the life out of any developer who touches it.

1: Google's abandoned webapp toolkit where you get all of the drawbacks of writing Java code with none of the benefits.

Re: None of my projects want to be SPAs

#163
post #123
post #113

Earlier quoted context omitted.

Global variables are different from global state. Every program has global state, whether you like it or not. Global variables are a poor way to declare, mutate, and read global state.

Redux means everything is global state which is terrible. A grid I render now has to have global state and most projects forget to do any cleanup - so you end up with all this junk in redux that isn't needed anymore, clogging up memory.

Nothing is forcing you to put everything in Redux. If state only has relevance to a single component then keep it in that components state, Redux works perfectly fine with this approach.

Re: None of my projects want to be SPAs

#164

Earlier quoted context omitted.

Well, SPAs are attractive even for websites that don't particularly benefit from them because of the technical attractiveness of having the website be like any other client that consumes your server's API.

sure but there are very few websites in the world that need to publicize an api, basically only sites that need to be able to function as applications. once you have a site that needs to be an application arguing for it to be single page is not that great a leap.

Sure, I meant to make the point that developers are drawn to SPAs for more understandable reasons than just being a bunch of lemmings.

Also, it's hard to realize how much work a SPA actually entails until you get your hands dirty. SPAs generally sound great on paper from a technical standpoint.

Re: None of my projects want to be SPAs

#165

Earlier quoted context omitted.

The other day I was arguing this exactly in a thread here about Ruby. People argue that Rails is outdated and is irrelevant for "modern web development", even though the web is not as modern as most people might think. Even what Facebook does, the only really hard part is the sheer scale they operate at. Facebook (the website) is not a single page app and other than the scale could be done in Rails with some AJAX spr…

sure, although modern browser apis mean the url bar can change in a reasonable way

Having the address bar behave sensibly is one of guiding principles of the Ember JavaScript framework. A good modern SPA framework should be able to handle proper routing out of the box.

Re: None of my projects want to be SPAs

#166

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…

I recently started a hobby project and initially went with a JS solution. But when I had to start deciding on auth, maybe an orm, routing, db layer, and templating, I said fuck it and installed Rails. Previously I had never built a real product in Rails, only the book store tutorial. I'm really happy with Rails so far. I don't have to worry about a lot of shit I had to worry about in JS land and now I can focus on th…

If you're starting from scratch, you ought to check out Elixir. Phoenix is a supremely productive framework.

Re: None of my projects want to be SPAs

#167
> It beats being a Magpie Developer. I have more time time to pet my dog, read a lot of books, make fresh pasta by hand, and circle a more slowly evolving collection of powerful technologies that let’s me get stuff done without spending half my free time chasing shiny new things.

Saying stuff like this is sure to please the hacker-news hipsters. But... is this honestly anyone's experiencing using new web technologies?

I tend to be on the bleeding edge of tech, and I very rarely regret learning a new technology. And I do not feel like I am wasting all of my time flitting from technology to technology.

I just think this is a smarmy attitude disguised as wisdom. People should like what they like. And as someone who has had to climb that hill before: Waiting around not expecting the world to change around you is a losing bet every time.

The fool doth think he is wise, but the wise man knows himself to be a fool.

Re: None of my projects want to be SPAs

#168
Completely agree on this one. I feel that a big chunk of "let's make it an SPA" is coming from the development team wanting to use and learn first hand these new exotic tech stacks. In the past two companies i have been, there was no strict guidance on the technology stack for each microservice or web app, so it ended up being a jungle of microservices written in GO, Elixir serving apps in React.js, VUE.js etc.

Did the company or the end user benefit from this? Hell no. Only one benefiting were the developers who ten left and asked for a 10k more salary on their next job for sporting that fancy new javascript framework. NICE!

Re: None of my projects want to be SPAs

#170
There is a place for SPAs. I just built a single page React app (using the create-react-app package) that mostly replaced a complex pile of spreadsheets. It came out fantastic, I think. The entire compressed Javascript is about 150 kilobytes, the scripts typically load in less than 500 milliseconds, and my co-workers are very happy. The code is easy to change and the interface between the client and server is clean. (Note: I disabled the built-in PWA features; they made versioning difficult due to excessive caching.)

On the other hand, I also maintain a public facing service that is mostly server-rendered with lots of JQuery snippets. I don't see a need to convert it to a SPA. It works well as-is.

I conclude from my experience that public facing services probably shouldn't be SPAs, while things that outgrow spreadsheets might be good candidates for SPAs. I wonder what other areas have been explored.

Post reply on HN