2 ms·
Express is like making a sandwich by buying bread, meat, and condiments from the super market. NextJS is like buying a sandwich from a vending machine. The big
by williamcotton 2y ago
Express is like making a sandwich by buying bread, meat, and condiments from the super market. NextJS is like buying a sandwich from a vending machine.
The biggest issue with apps like NextJS is that they didn't explicitly build upon and expose the Express API. What they should have done is client-side app routing with a version of Express that runs route handlers in the browser. They also needed to add parallel middleware that runs in both a browser and server context. That's the only sane way to support functionality and components that run in both the server and browser context.
The entire NextJS architecture is flawed because they picked the wrong pivot point.
We want to be making sandwiches from store-bought components. Sometimes we do need to swap out the bread and NextJS has the wrong abstractions to do so which results in all sorts of soon-to-be-breaking-changes-spaghetti to work-around the deficiencies.
It would have been much better to maintain an application by working directly with requests, request middleware and request route handlers, with a mock request corresponding to mouse events for the client-side.
The request-response cycle is the fundamental nature of the web application, even in the browser.