Live data from Hacker News

None of my projects want to be SPAs

whatisjasongoldstein.com

141–150 of 362 posts

Re: None of my projects want to be SPAs

#141

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…

Microservices are in the same camp. I use them, I love them, I advocate for them. But microservices don't make any sense if your application doesn't call for it or if you don't have the orchestration infrastructure to roll them out and test them easily.

I've worked at places in all four quadrants of should/shouldn't and do/don't use microservices.

Re: None of my projects want to be SPAs

#142

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…

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.

Re: None of my projects want to be SPAs

#143

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…

Microservices are in the same camp. I use them, I love them, I advocate for them. But microservices don't make any sense if your application doesn't call for it or if you don't have the orchestration infrastructure to roll them out and test them easily. I've worked at places in all four quadrants of should/shouldn't and do/don't use microservices.

Yeah microservices is another one that suffers from the One Solution To Rule Them All mentality.

They're GREAT when they're the right fit.

Most websites aren't really a right fit and do fine with a classic webserver->DB setup.

Re: None of my projects want to be SPAs

#144

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…

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.

Re: None of my projects want to be SPAs

#145

Earlier quoted context omitted.

> 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. Redux offers a few benefits: 1. Allows you to keep your global application state 100% predictable by treating it as a pure function of an event stream (dispatched actions). This makes it trivial to test. 2. Allows you to "time travel" the state of your store using…

I have yet to see a long term project built with Redux that was maintainable. That seems to be the common denominator in React projects that do not survive technical debt accumulation. The issue with Redux is that it encourages side effects in components. After a while people are dispatching all over the place and you end up in a similar situation as you were with keeping track of JavaScript events. All of a sudden s…

> I have yet to see a long term project built with Redux that was maintainable.

The only maintainable projects I have worked on in terms of web apps have been with Redux.

Redux is not great for simple projects, it is great for medium and large scale projects.

> All of a sudden something stops working because someone removes a component that is dispatching on a timed interval etc.

That's the problem: react and redux are not enough for large projects, you also need a way to manage side-effects. Incorporating `redux-saga` would fit that purpose.

React, redux, redux-saga -> this is the recipe for large scale applications that I have used, built, and helped maintain with success.

One of the strongest benefits of redux is being able to see every single event in a debugger that displays current state, action payload, next state. It really does make tracking down state changes a matter of reading a global log.

Furthermore, because redux is not dependent on react and under the hood it is simply and event emitter, it becomes relatively easy to use the same exact business logic for one web app and use it for some other delivery.

We did this at my last company: because our business logic was based on redux and completely separate from the UI layer: we were able to build: a cli, chrome extension, outlook plugin, and mobile apps using the same exact business logic.

Re: None of my projects want to be SPAs

#146
Yeah.

1. Tons of existing jQuery components.

2. Ten of custom, loosely coupled ones.

3. Built-in PubSub for their communication:

   $(document).on("custom-event", function() {...})
4. Routing (if needed) in 60 lines of code: https://github.com/c-smile/spapp

And you can do any SPA out there. Or not SPA.

Re: None of my projects want to be SPAs

#147

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…

As you're doing Rails I recommend you check out Stimulus JS (https://stimulusjs.org/). I've installed it in a recently project (Rails 6, rake webpacker:install:stimulus) and it's like a breath of fresh air. Totally gets out of your way, but lets you add behaviour to your app as you need it.

Re: None of my projects want to be SPAs

#148
post #98

We turned to React as the UI solution in our Rails app almost 2 years ago. It was the hot thing and I fell in love with the concept of components. While it did work well, I regret the decision. It convoluted our codebase and it seemed like simple tasks took way longer than I estimated. We're now back to doing things the "Rails way" with erb templates, turboklinks, and Stimulus to give us that JS functionality we were…

I've started a new project with Rails 6 and Stimulus just recently. Stimiulus really does feel like a breath of fresh air. Just enough to let me do what I need to do without feeling like a burden.

Re: None of my projects want to be SPAs

#149
post #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.

Writing good SPAs is exponentially harder than good non-SPAs. At least from my experience.

Re: None of my projects want to be SPAs

#150

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…

[deleted]
Post reply on HN