Comment by z9znz
3 years ago
I'm not a frontend guy, so maybe someone else here knows how to effectively benchmark the current system. I would be very curious to see how the current system performed versus a new React FE. Surely MS will do this themselves, but I don't know if they will publish it (especially if it shows the net result of the change was negative).
There is also a very big difference in dev experience/toolset and dev velocity between RoR templates and React. Large apps that use RoR or Django templates become very messy and unenjoyable to work with over time. Plus being able to reuse parts of the state on the client is a big productivity boost.
For me personally API+front end is a much cleaner and productive paradigm than having to pass massive dictionaries from a controller to a template. This separation of concerns allows to focus on and optimize data sources/retrieval and UI/rendering independently. Really nice!
> than having to pass massive dictionaries from a controller to a template.
Don't you pass already massive JSON payloads from your API endpoints down to your client to update the views?
How's this any different than your hypothetical or even real world scenario?
API can be a very thin layer that a well constructed client can utilize right from the "view" (a React component). A template file in a backend framework is a one-way feature in the majority of cases. You have to construct and pass _all_ its context (or create helpers, global context, etc) every time. So the controller needs to request data, prepare it (template data manipulation is mostly minimal), pass it. Basically a controller starts doing too many things over time, too much business logic is added to accommodate pretty low featured templates.
> Don't you pass already massive JSON payloads from your API endpoints down to your client to update the views?
Not really. You send many parallel API requests from the client, each response is a smaller JSON. And when you navigate to the next page, most of its data is already in your state, so you have to request just the missing part (e.g. a different post). When you are constructing context for a page on the backend you have to provide all its context every time. The template doesn't make requests based on some logic.
Api + a fe framework is easier than all backend? .... Ohhhh kay
"Easier" is a difficult word to describe and agree on. Building rich UI is incomparably faster and more enjoyable in React than it is in Django or RoR (hence why most rich web UIs are built using JS frameworks).
Deploying API and FE separately can also be more efficient, as these services likely require a different tech stack, a different scaling/load balancing setup, and have a different release cycle.
2 replies →