News for hackers. Stuff that matters.
Re:I Miss Rails by revskill on Thursday March 28, 2019 @08:26PM (#19518025)
Here's how i replace Rails with the "modern stack":

- Compile Graphql schema into Typescript typings + Fragments for "Active Record"

- React Hooks as controllers action.

- React Suspense for HTML rendering.

- Apollo for graphql caching

- ExpressJS for middlewares.

- @reach/router for routing.

- @loadable/component for code splitting.

- Serverless for API.

I missed Rails, too. But i found that the "modern stack" is not bad at all. It just needs more time to investigate to find out the best way to reuse features.

Re:I Miss Rails by rsanheim on Thursday March 28, 2019 @08:53PM (#19518179)
Your post is a perfect example of why the "modern stack" is a horrible developer experience (and lets be honest, probably crummy user experience) compared to Rails.
Re:I Miss Rails by revskill on Thursday March 28, 2019 @08:57PM (#19518210)
You're absolutely correct at current moment.

I hope the DX will get better soon. But this stack beats rails on scalability, universality, user experience, and many more. It's a trade-off that i found worth the effort.

Re:I Miss Rails by 0xADEADBEE on Thursday March 28, 2019 @09:42PM (#19518437)
This sounds exhausting! But I'm betting there's some pretty solid benefits or you wouldn't do it. Could you expand on why someone might pick this a little?
Re:I Miss Rails by revskill on Thursday March 28, 2019 @09:58PM (#19518507)
The main benefit i got is that, i could independently package SSR React Component, then my application is just a composition of those packages.
Re:I Miss Rails by peteforde on Friday March 29, 2019 @01:38AM (#19519419)
Honestly, this is such an un-sexy answer that it might shock some sense into people that are still on the fence. It might not be too late for you.

Seriously, gang: Rails is productive, fun and lets you focus on making your customers happy instead of optimal package composition.

Re:I Miss Rails by revskill on Friday March 29, 2019 @07:18AM (#19520626)
I was a Rails user for about 4 years. The DX of Rails is unbeatable still today.

But this is a trade-off i take into account.

I even have a production system running on Rails, with frontend React.

This stack's benefits to me:

- Universality (one Typescript to rule all backend and frontend)

- Separation of concern (no more MVC, only components)

- Scalability (each part could scale independently)

- Modularity (the business logic now could have its own service as a graphql API)

- User interactivity in less code (this is why SSR with React)

My new application on this "modern stack" is nearly to be released. If you want to know more, ping me on twitter @revskill.

Re:I Miss Rails by peteforde on Friday March 29, 2019 @03:54PM (#19525031)
I guess this just seems like a massive amount of hoop jumping that, from the outside, looks like OCD levels of premature optimization for future demands that might well not occur.

Put differently: how much more time and energy would you have had to work on your MVP if you had just used Rails?

Re:I Miss Rails by revskill on Friday March 29, 2019 @04:12PM (#19525200)
Actually, the time spent to setup correctly all the toolings is much more than the MVP itself. The ratio is about 6/1. Once setup, it took me about 1-2 weeks to complete a MVP.

Want new feature ?

- Add a graphql API (if not exists) and compile to Typescript typings.

- Develop and deploy a React Component for that feature.

- Install and add to the application.

Re:I Miss Rails by digitaltrees on Friday March 29, 2019 @01:11AM (#19519310)
Let’s talk in 6 months as those packages evolve and diverge. While rails core team does the work of maintaining all the packages as a consistent whole.
Re:I Miss Rails by revskill on Friday March 29, 2019 @08:41AM (#19521085)
Sure. This is both sides of a coin. Or we get freedom and take care for it with responsibility, or we're stuck inside a box.
Re:I Miss Rails by digitaltrees on Sunday March 31, 2019 @02:20PM (#19537207)
You can’t “take care of it with responsibility” if you have a lot of dependencies since you don’t control the library’s maintenance, or how it evolves with other libraries. So then you have to chose between adding dependency (with very real maintenance downsides) vs writing things yourself and reinventing things that should be solved.

Further, being stuck in a box also means that the community can rely on that very box and add more extensions with the architecture of the box in mind. A box gives assumptions to build on top of. Sure if you really really need a triangle it’s painful, but then you should ask, do I really need a triangle?

I think the real insight of DHH is that most web apps are not as “unique” as developers would like to believe and that the harmony that comes with conventions, the speed that comes with a unified end to end integrated system, and the focus developers gain for actual impactful choices when many unimportant choices are made for them is an amazing improvement.

He said recently, that insight is as controversial today as when he launched rails, and he is surprised more rails competitors haven’t emerged.

I think the first end to end GraphQL > Single Page App framework that has a similar level of integration to rails will dominate.

Re:I Miss Rails by tjpnz on Thursday March 28, 2019 @11:55PM (#19519049)
This strikes me as being more archaic than modern.
Re:I Miss Rails by revskill on Friday March 29, 2019 @08:42AM (#19521089)
Except the stack is deployed as a lambda function.
Re:I Miss Rails by wzy on Thursday March 28, 2019 @09:38PM (#19518414)
... you had me up until "Serverless".
Re:I Miss Rails by revskill on Thursday March 28, 2019 @09:59PM (#19518514)
Actually, this stack is deployed as a serverless function ! "Serverless for API" means i could use any language to develop API. Serverless provides better scalability in my opinion.
Re:I Miss Rails by cagmz on Thursday March 28, 2019 @10:59PM (#19518786)
Do you have any code samples for this? Sounds interesting.
Re:I Miss Rails by revskill on Thursday March 28, 2019 @11:07PM (#19518822)
It's private code. I'm writing a book on this topic and will release once it's done.