Opening Position: Reactive Rails
I looked at the api
branch on the repository that @Matt-Yorkley set up (thanks Matt
). I think that it looks like a solid (preferable, even) approach to extract any business logic to a concern, and leave it to the controllers/reflex to determine how they render the data. This leaves them very skinny, boilerplate even, and makes it easy to keep things nice and clean. So after being pretty much ready 22 days ago to just make the call to go with React (much like @Kirsten yesterday), I’m now declaring for Reactive Rails, for three main reasons.
-
We should de-couple this decision from the decision to prioritize the API.
Whichever option we choose, we will have to explicitly prioritize the API if we want it to happen soon. Let’s say we go with React. The first project is the Product Uplift which I’d say is realistically months away from being deployed. So the only API work we’d be forcing ourselves to do in those few months by going with React (in other words, the only API work we get “for free”) would be the endpoints to support the Product Uplift work, which is a small percentage of the endpoints overall. As we continue rewriting the front end in React, we’ll eventually be “forced” to do more and more endpoints, but I’d say it’s several months to over a year before that rewrite is complete. We need the full API way, way before then; therefore, we need to prioritize it separately; therefore, we don’t really get it “for free” by going with React.
-
The needs of our API consumers are not the same as the needs of the web client.
I understand wanting to dogfood your own API, but designing a good API means thinking about the general case, not the specific case of your own web application. I would hope/assume that not too many consumers of the API are just looking to make a clone of the front end, but instead have some other, probably slightly different requirements. The conclusion is the same, that the API should be prioritized independently and not thought of as “this thing we’re building mainly to support our own React frontend”.
-
It makes us and the code base leaner.
I would love love love it if we could hire someone to focus on general front end development. Hiring someone who’s very specifically focused on/skilled in React feels wasteful if we can instead use a tool that we already understand and achieve the same thing with less code to maintain, and as a bonus, free up that person to work on more impactful features. This might be the person we’ve already identified through the recruitment process and we would just be refocusing/redefining what they’d be doing.
Some assorted closing thoughts:
I definitely recognize that there’s a lot of strong feelings about this, and also a lot of context that I’m not fully aware of. I’m especially wanting to hear more about @lin_d_hop’s statement that we’re losing funding/users daily because the API can’t support them, yet according to Luis, the API work “never happens”, yet according to Matt, it’s a pretty small amount of work for everything but checkout. Is there some underlying blocker, or just a case of priorities/needing to JFDI? A question for another place though.
I would make the joke about writing you a shorter letter if I had more time, but that’s not the issue; I just couldn’t find a good way to leave any of these points out! To sort of honor the original request for 2-3 sentences, just read the bold parts 