Next.js is the most frustrating, opinionated mess I've ever had to deal with(twitter.com)
twitter.com
Next.js is the most frustrating, opinionated mess I've ever had to deal with
https://twitter.com/emilwidlund/status/1672969385714102273
20 comments
In fact it's quite opposite. App directory has lot of quirks that I learnt building in it after experience in react. Just after using it for two weeks I found there is no global 404, you can't use things like window and document, server components are close to useless where you can't even read cookies in server component(you can't read it in client component in server as well even though next has it), it's better to stay away of API routes, you can't use environment variables in prod but you could use in dev, you could easily trip yourself by using 'next/router' instead of 'next/navigation' etc.
Does this not work?
https://nextjs.org/docs/app/api-reference/functions/cookies
https://nextjs.org/docs/app/api-reference/functions/cookies
Sorry, yes I think I tried that in client component and failed to use it in prerendering step or something(I could still be totally wrong, as I said I just spent 2 weeks in next app directory)
Can you just mix and match the app router and the page router?
I'm not actually sure what the value of the app router is, but the page router works well and is more mature.
I'm not actually sure what the value of the app router is, but the page router works well and is more mature.
> I think the problem is that SPAs are limited in use, but a lot of devs ONLY build SPAs and that creates a mess.
I am lead on an enterprise Angular project and among the reasons I went for it was due to the fact is is opinionated, but is doesn't get in your way. We're on Angular 16 now with a C# back-end and everyhing is going well, is logical, and performant.
Prior to this I was fully in the Microsoft ecosystesm, from ASP classic, through ASP.Net Web Forms, and through MVC.
This was the first project I decided to use a SPA front-end with, wanting to avoid Microsoft's latest Blazor push. It was too early to risk it.
SPAs have their place, and this is a large and complex system.
I agree that React is overused, it seems like it's the "go to" for many people, such as people who are either self-taught or went to a React-focused bootcamp. I've seen plenty of React sites that could be static HTML ... some of them could probably even get away with no JS.
I am lead on an enterprise Angular project and among the reasons I went for it was due to the fact is is opinionated, but is doesn't get in your way. We're on Angular 16 now with a C# back-end and everyhing is going well, is logical, and performant.
Prior to this I was fully in the Microsoft ecosystesm, from ASP classic, through ASP.Net Web Forms, and through MVC.
This was the first project I decided to use a SPA front-end with, wanting to avoid Microsoft's latest Blazor push. It was too early to risk it.
SPAs have their place, and this is a large and complex system.
I agree that React is overused, it seems like it's the "go to" for many people, such as people who are either self-taught or went to a React-focused bootcamp. I've seen plenty of React sites that could be static HTML ... some of them could probably even get away with no JS.
I've been using it for years and it's something where you need to learn what it's for and how to use those parts properly (static vs server), but once you get that figured out it's pretty quick to do a lot of things well. I haven't tried the new app directory or server components yet to make things even faster as why break something that works good enough. I think to take advantage of them you have to really understand the advantages and weaknesses of what came before them and why you would want to do the new thing.
Forcing NextJs to do something it's not meant to do (which I spent months doing last year) is not fun and leads to frustrating and wheel spinning, but doing what it's supposed to do I feel like I can spin up something so fast and easily and deploy to Vercel quickly and have a full web app in no time that has amazing speed. I wish they had a tier above pro, but below enterprise though for those who make a living off using it, but can't justify $1000/month just so someone will answer a phone call or email as to why their platform is failing with no errors and now you can't earn a living.
Forcing NextJs to do something it's not meant to do (which I spent months doing last year) is not fun and leads to frustrating and wheel spinning, but doing what it's supposed to do I feel like I can spin up something so fast and easily and deploy to Vercel quickly and have a full web app in no time that has amazing speed. I wish they had a tier above pro, but below enterprise though for those who make a living off using it, but can't justify $1000/month just so someone will answer a phone call or email as to why their platform is failing with no errors and now you can't earn a living.
This is a pretty low effort post. I don't use next much but I've played around with it.
They messed up launching the app structure when it wasn't fully functional but I'm under no obligation to use it.
It seemed to me when I did check it out that'd I'd probably want to stick with the more battle tested next style though.
They messed up launching the app structure when it wasn't fully functional but I'm under no obligation to use it.
It seemed to me when I did check it out that'd I'd probably want to stick with the more battle tested next style though.
Both Next and Vercel are fantastic. I've used Next for multiple projects and it's part of my go-to stack now. Why are you promoting someone complaining about not understanding it? This person is a troll who is conflating learning new technology for it being bad. I also don't understand how "opinionated" is the source of the complaint - what framework isn't opinionated?
> what framework isn't opinionated
Vanilla React, for one. When it came out, it was way less opinionated than Angular, being only a UI lib and not a full framework per se. But people kept trying to use it like a full framework, and ended up creating things like React Router and Redux and a bazillion other routing and state and SSR etc. solutions. It was a nightmare. React apps from that era are totally unreadable and hard to reason about.
It wasn't until Next that a React project could actually feel sane and organized, with sensible defaults controlled by one party instead of a million overwhelming packages from twenty different companies you'd have to mix and match.
Especially when used with Vercel, I agree, it's quite astonishing how much better it is than the stuff we lived with the last two decades.
Hell, even the official React docs now recommend using Next instead of Vanilla. That's how much better of an improvement it is...
Vanilla React, for one. When it came out, it was way less opinionated than Angular, being only a UI lib and not a full framework per se. But people kept trying to use it like a full framework, and ended up creating things like React Router and Redux and a bazillion other routing and state and SSR etc. solutions. It was a nightmare. React apps from that era are totally unreadable and hard to reason about.
It wasn't until Next that a React project could actually feel sane and organized, with sensible defaults controlled by one party instead of a million overwhelming packages from twenty different companies you'd have to mix and match.
Especially when used with Vercel, I agree, it's quite astonishing how much better it is than the stuff we lived with the last two decades.
Hell, even the official React docs now recommend using Next instead of Vanilla. That's how much better of an improvement it is...
After debugging an issue with a customer using using App router I decided to never touch NextJS and learn Remix instead.
Their official documentation for early loading scripts simply doesn’t work.
https://github.com/vercel/next.js/issues/51242
Did any of this stuff get tested at all before being labeled production ready?
Their official documentation for early loading scripts simply doesn’t work.
https://github.com/vercel/next.js/issues/51242
Did any of this stuff get tested at all before being labeled production ready?
Next.js is good overall. It has changed a lot over time and has some things that were not ideal like the whole getserversideprops and getstaticprops but the new App directory I am really liking, the new changes work more inline with my mental modal of how things should work.
What value does the app directory add? I read the docs a few times but still don't see a benefit over the page router?
It’s the most prominent test bed for React Server Components, which are still “experimental” but are being treated as stable in Next and promoted as such by React team. Besides the features that RSC directly tout, Next’s app directory implementation is supposed to address a bunch of problems with the split between server/build and client code.
I haven’t worked with it myself but at minimum I’d expect it’ll improve workflows where there’s clearly a need for breaking up server work and interleaving it with client rendering, because the server split is wherever you choose rather than at the top of your render tree
I haven’t worked with it myself but at minimum I’d expect it’ll improve workflows where there’s clearly a need for breaking up server work and interleaving it with client rendering, because the server split is wherever you choose rather than at the top of your render tree
It's somewhat amazing how the JS ecosystem is still struggling so hard to do things that, e.g., Laravel solved years ago. It's as if nobody ever heard of server-side rendering before.
I would argue that it is primarily but not exclusively the React community and it’s surrounding ecosystem.
Yes, it genuinely is a mess where people are continually reinventing the same things again and again on a loop and no two projects are the same, almost none of them are by the very nature of being React particularly well aligned with web platform standards and have major parts of their ecosystem captured by weird VC companies who don’t have the same priorities as your developers let alone your organisation.
That’s not particularly true for say Angular or jQuery or Web Components etc.
Yes, it genuinely is a mess where people are continually reinventing the same things again and again on a loop and no two projects are the same, almost none of them are by the very nature of being React particularly well aligned with web platform standards and have major parts of their ecosystem captured by weird VC companies who don’t have the same priorities as your developers let alone your organisation.
That’s not particularly true for say Angular or jQuery or Web Components etc.
Since the beginning of nodejs, the JavaScript ecosystem has become so uncontrollable package managers are trying to limit the opinionated mess that’s there, developers not happy it can do most things every other frameworks or libraries can do, having no choice but to give in adding +1 to JavaScript ecosystem mess, web assembly needs to be careful (esp rust) cause it’s contagious
I look at Tailwind & just die laughing at the prices for basic components
Long live vanilla js, jQuery or whatever else that gets you shipping faster.
Long live vanilla js, jQuery or whatever else that gets you shipping faster.
I don’t understand what you mean? Tailwind is free, sure you can buy prebuilt components but there are even more free ones. Also not making the connection between tailwind and vanilla js and jQuery. Also, it’s ideal if you can get away with just vanilla js, and jQuery isn’t that bad although Alpine is perhaps a bit better choice these days.
Next.js fixes quite a few of the initial problems with using React even though there's still some stupid and even some new stupid introduced.
I'm definitely building in Next.js now, not vanilla React.
I think the problem is that SPAs are limited in use, but a lot of devs ONLY build SPAs and that creates a mess. Before Next.js, if I was building anything other than an SPA, I'd really have to wrestle with if I should build it in MVC or React...because it was a lot more trouble in React to do it well. But I don't have that problem with Next.js.
I suspect that people struggling to work with Next.js from React don't have the experience of web app development before React existed, so suddenly they are faced with the same learning curve of people who had to figure out React when they were used to full-stack development.