I have the same instinct (JSP / JSF had the same concept) but I must say, making pages as files in next.js is really nice. You can have all your dynamism within them, but having a simple way to do overall routing is lovely.
It is nice. It is easy. There's a reason we started there.
Then, suddenly after a certain amount of scaling, it isn't. And it's not like that's an impossible situation either, but you end up with all the consequences of building a framework to do X and then having to build an inner platform[1] to do some other Y inside of X instead.
Sure. It's a tradeoff either way - ergonomics for common cases or not. I imagine in your case you're constructing lots of custom logic anyway, whether it's in an API gateway (or similar) component to put the auth logic before the application, or put the logic in some before_request handler in the web application.
I haven't, but I've just had a read. It looks well thought through and opinionated, which is what I'd expect and want from NextJS.
Time will tell if it misses a load of cases, but I can't think of any. I'm not doing any UI work at the moment, and while I wanted to introduce NextJS to my new team's new project, we tried it but couldn't get it to work with our slightly tricky component tech (StencilJS). I think that's a StencilJS <-> ReactJS issue rather than a StencilJS <-> NextJS issue, though.
Not the author but for me it’s insane that the router doesn’t do http routing on verbs but rather leave it to be repeatedly reimplemented in every single page (and the fact that you can’t do simple things like what’s been available in rails for over a decade with resources).
Understood. This I think is a slightly different way of making a web application - NextJS is built on REST calls and client-side view changes.
If I've understood correctly, your Phoenix example is more like traditional full page request response programming, where you can post a form and get back a whole new web page. Phoenix no doubt has magic to make the whole page not reload, but point being that I think a lot of NextJS's target users are developers who come from a REST + SPA background, and wouldn't think to send some data and get a changed view back. They'd send some data, maybe get a response, update their client side data store and their view would change automatically.
It works the same for JSON/REST in Phoenix though, you don’t have to concern yourself if it’s a GET or PATCH because the correct function has already been called from the router.
Sure, understood. You can (and probably should) have a separate logic/controller layer from HTTP handling. You can do this with either though, I think? Just call a function in another file?
I honestly don’t get all the file routing hype. How hard is it to setup a React Router? It’s like a few lines of code and you get a massively flexible setup, without any lock-in.