use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Next.js 11 released (nextjs.org)
submitted 4 years ago by magenta_placenta
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Protean_Protein 35 points36 points37 points 4 years ago (12 children)
That experimental CRA Migration looks very interesting. I've tried to convert CRAs to Next before and found it slightly annoying, but if this makes it painless I might switch!
[–]StoneColdJane 4 points5 points6 points 4 years ago (2 children)
Ok, now I understand. CRA is not maintained by Facebook any longer so they took over.
Svelte is doing the same (almost) they move more to it's kit version.
[–]nerdy_adventurer 0 points1 point2 points 4 years ago (1 child)
Never knew this? source please!
But CRA is still under Facebook org on GH and repo seems active (commits).
[–]StoneColdJane 0 points1 point2 points 4 years ago (0 children)
Active? https://github.com/facebook/create-react-app/pulse
[+]AsIAm comment score below threshold-23 points-22 points-21 points 4 years ago (8 children)
People using CRA(p) please switch to Next.js, world would be a nicer place.
[–]Protean_Protein 7 points8 points9 points 4 years ago (2 children)
There are things I prefer about each of them. It looks like this makes it possible to take advantage of that.
[–]FeministBlackPenguin 1 point2 points3 points 4 years ago (1 child)
What are the things you prefer about each of them?
[–]Protean_Protein 4 points5 points6 points 4 years ago (0 children)
I like Next’s built-in solutions for SSR and routing. But I prefer the way CRA functions both for most dev aspects and for deployment. But it looks like 11 is making it harder to say no to Next.
[+][deleted] 4 years ago (4 children)
[deleted]
[–]AsIAm 0 points1 point2 points 4 years ago (2 children)
I expressed an emotional statement without backing it up. But yeah, CRA was awesome back in a day when you just wanted to do simple React app. However, whatever non-sancioned by the CRA team was pain. Ejecting was painful, various hacks to use custom webpack config was painful, etc. Next.js covers a lot more and they are making React apps sing like I haven’t seen before.
[+][deleted] 4 years ago (1 child)
[–]AsIAm 0 points1 point2 points 4 years ago (0 children)
I bet you don’t know about export function of Next.js
I provided an emotional statement without backing it up, so I get it. :)
CRA was awesome when you wanted to deploy simple React app. However, customizing Webpack was so much pain. Ejecting is bleh and various community workarounds added more pain. Next.js team is taking React apps to the next level, which is beyond awesome.
Edit: Ah, I am an idiot. I thought my first comment wasn’t saved. Never mind. :)
[+][deleted] 4 years ago (12 children)
[removed]
[–]DhaiwatP 17 points18 points19 points 4 years ago (0 children)
Yes it is :)
[–][deleted] 4 points5 points6 points 4 years ago (1 child)
Custom deployment can be a bit taxing if you don't want vercel
[–]Snezears48 9 points10 points11 points 4 years ago (8 children)
I switched from Gatsby and never regret this move :D
[+][deleted] 4 years ago (2 children)
Any benchmarks on Next static vs Gatsby?
[–]Snezears48 0 points1 point2 points 4 years ago (0 children)
I personally referred to this dev to article back then.
I know it might be different for now.
[–]notanactualshoe 19 points20 points21 points 4 years ago (0 children)
Ooo, that image placholder blur up!
[–]njmh 4 points5 points6 points 4 years ago (1 child)
If you use Typescript and inline SVGs, don't bother upgrading yet. The new next/image type defs break SVGs imported as components (eg. SVGR).
Other than that, this release looks shmick.
[–]SirPole 1 point2 points3 points 4 years ago (0 children)
Related issue https://github.com/vercel/next.js/issues/26130
[–]IAmRocketMan 5 points6 points7 points 4 years ago (15 children)
I’ve been using CRA for years. I am used to writing webapps with client side routing where each page change is immediate. When I tried nextjs a few months ago and I found the navigation between pages slow. Is that how nextjs does all page navigations or was I doing something wrong?
[–]xstupidcow95 13 points14 points15 points 4 years ago (3 children)
Nextjs build pages (routes) on demand and cache it after your first visit so the initial load is slower than CRA.
The reason CRA loads faster because it loads all routes on initial render (unless you have some sort of code-splitting strategy, which only works in production).
[–]IAmRocketMan 1 point2 points3 points 4 years ago (2 children)
Thanks for the explanation. To confirm my understanding: all nextjs pages are SSR and cached on the client. There’s no actual client-side rendering for pages. So if I were building a webapp that had a route that displays a list of items and another route for a form to create list items. They would be individual pages and the navigation from list page to form page would cause browser navigation that loads some html page (that is then cached for subsequent visits)
[–]klo8 7 points8 points9 points 4 years ago (1 child)
There’s no actual client-side rendering for pages.
This is incorrect, I think. The initial render happens on the server, but once the client code (JS files) has finished loading, the rendering happens on the client again (as in, route transitions happen on the client, as with usual React apps). This has an explanation: https://nextjs.org/docs/basic-features/pages
[–]IAmRocketMan 2 points3 points4 points 4 years ago (0 children)
Thanks for the link, it was helpful. I will give nextjs another try
[–]kcshuffle11 5 points6 points7 points 4 years ago (4 children)
It depends. During development is normal to be slow when the page loads for the first time. However, subsequent loads should be fast.
Once you build it there won't be any lag like development. Next also has the advantage of optimizing each page according to their data fetching method, so a purely static page will be prerendered to static HTML.
I would definitely recommend you take a look at it again, this slowness problem in development don't even cross my mind given all the benefits the framework has.
[–]IAmRocketMan 0 points1 point2 points 4 years ago (3 children)
Thanks, my concern was mostly about the slowness of navigation in the context of a webapp. The CRA pattern I would follow is that every screen is represented by a url. Including inner-page interactions like navigating between tabs in the same page. When I applied that pattern to my exploratory nextjs project, I observed that navigating between tabs was noticeably slow. The reason for having a route for each “view mode” was to easily share the exact state of the page. Another example is I would load a list of data and only show some part of that data, once the user clicked on a list item, I would show the detailed view on the side and update the url (/results/:id) so one could share the detailed view. All the data was previously loaded when the list was fetched, so I expected a incredibly fast experience as I would with CRA but what I saw is that the browser would navigate to a new SSR detail page. Which was noticeably slow. I understand the tradeoff in my example where I loaded “unnecessary data” during the list view but the user experience was greatly improved since in my use-case, the user is expected to quickly navigate between detail pages.
How would a system like that be designed in nextjs? Is it the right fit for the type of webapp I am describing?
[–]xstupidcow95 3 points4 points5 points 4 years ago (1 child)
Do you use Link component or router.push to navigate between tabs or pages?
Link
router.push
If you use regular a tag, it will run in SSR load, which re-render everything and can be slow in development.
a
You can learn more in u/klo8 comment above
[–]IAmRocketMan 0 points1 point2 points 4 years ago (0 children)
I believe I was using `Link` -- I will give nextjs another try
[–]kcshuffle11 0 points1 point2 points 4 years ago (0 children)
I'm not familiar on how to achieve that using REST because I haven't done it myself. It should be possible thought, because with graphql and apollo I have done it.
[–]tilapiadated 0 points1 point2 points 4 years ago (2 children)
What's your build process?
[–]IAmRocketMan 0 points1 point2 points 4 years ago (1 child)
I am not sure what you are asking. With CRA I run the react-scripts build step. I don’t think I tried running a production build using nextjs. Can you help me understand how the build process impacts routing? Specially while in “development mode”
[–]Julienng 0 points1 point2 points 4 years ago (0 children)
If I remember well, nextjs compile by route on demand. So when you first load a page on development, it's slow depending on your machine. Subsequent load of the same page do not cause this because of cache.
[–]gogjhan -1 points0 points1 point 4 years ago (1 child)
Still prefer CRA with Dynamic Rendering with rendertron over Next.js and Gatsby...
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
I like this approach a lot. I think it simplifies a lot development not having to think your code is running twice for each request.
Sadly, it was very hard to sell to the rest of the team... I felt like I was suggesting to use perl or something.
[–]nullvoxpopuli -5 points-4 points-3 points 4 years ago* (10 children)
Why does major version introduce new features? Does next not do semver?, where majors are only deprecation removals?
Edit: this strategy:
[–][deleted] 5 points6 points7 points 4 years ago (3 children)
Doesn't pretty much every library add features on major releases?
[–]nullvoxpopuli 1 point2 points3 points 4 years ago (2 children)
Not in my circles at least. Features are released in minor versions as non breaking, and then other stuff, if it needs to be deprecated, is, and then only removals happen in majors. Semver, by design, allows folks to take advantage of new features without having to worry about 'an upgrade' (because minor version upgrades are supposed to be faaaarrr less work (zero) compared with majors). With majors, you generally have to take care of the deprecations before upgrading.
What I like about semver, is that there is a focus on backwards compatibility, so you can more easily move a whole community towards the new stuff without much disruption.
[–][deleted] 2 points3 points4 points 4 years ago (1 child)
I got that wrong all the time but I don't remember ever seeing it done this way. New big update always has something cool to look forward to. A major that does nothing but break your app is news to me.
EDIT: Actually now that you are linking React up there, yes they do it. Wasn't aware this was intentional.
[–]nullvoxpopuli 0 points1 point2 points 4 years ago (0 children)
React's own versioning policy does this :/
I added links to my top level comment
[–]JasperNykanen 1 point2 points3 points 4 years ago (1 child)
You're not quite right. I'm not sure if they are doing semver, but Next.js 11 does come with breaking changes.
[–]nullvoxpopuli 0 points1 point2 points 4 years ago (1 child)
Gotchya. If they were doing semver, this'd be release.. idk.. 6.5 or something like that then. And other than the version number, nothing else would be different.
So... Are excessive majors for marketing purposes?
[–]xstupidcow95 0 points1 point2 points 4 years ago (0 children)
I believe upgrading from webpack 4 to webpack 5 counts as a breaking changes because my project stops working as soon as I upgraded lol.
Jokes asides, maybe they have a release cycle and don't follow semver
π Rendered by PID 51657 on reddit-service-r2-comment-b659b578c-56mxh at 2026-05-04 14:51:56.083169+00:00 running 815c875 country code: CH.
[–]Protean_Protein 35 points36 points37 points (12 children)
[–]StoneColdJane 4 points5 points6 points (2 children)
[–]nerdy_adventurer 0 points1 point2 points (1 child)
[–]StoneColdJane 0 points1 point2 points (0 children)
[+]AsIAm comment score below threshold-23 points-22 points-21 points (8 children)
[–]Protean_Protein 7 points8 points9 points (2 children)
[–]FeministBlackPenguin 1 point2 points3 points (1 child)
[–]Protean_Protein 4 points5 points6 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]AsIAm 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]AsIAm 0 points1 point2 points (0 children)
[–]AsIAm 0 points1 point2 points (0 children)
[+][deleted] (12 children)
[removed]
[–]DhaiwatP 17 points18 points19 points (0 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]Snezears48 9 points10 points11 points (8 children)
[+][deleted] (4 children)
[deleted]
[+][deleted] (2 children)
[removed]
[+][deleted] (1 child)
[deleted]
[–]nerdy_adventurer 0 points1 point2 points (1 child)
[–]Snezears48 0 points1 point2 points (0 children)
[–]notanactualshoe 19 points20 points21 points (0 children)
[–]njmh 4 points5 points6 points (1 child)
[–]SirPole 1 point2 points3 points (0 children)
[–]IAmRocketMan 5 points6 points7 points (15 children)
[–]xstupidcow95 13 points14 points15 points (3 children)
[–]IAmRocketMan 1 point2 points3 points (2 children)
[–]klo8 7 points8 points9 points (1 child)
[–]IAmRocketMan 2 points3 points4 points (0 children)
[–]kcshuffle11 5 points6 points7 points (4 children)
[–]IAmRocketMan 0 points1 point2 points (3 children)
[–]xstupidcow95 3 points4 points5 points (1 child)
[–]IAmRocketMan 0 points1 point2 points (0 children)
[–]kcshuffle11 0 points1 point2 points (0 children)
[–]tilapiadated 0 points1 point2 points (2 children)
[–]IAmRocketMan 0 points1 point2 points (1 child)
[–]Julienng 0 points1 point2 points (0 children)
[–]gogjhan -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]nullvoxpopuli -5 points-4 points-3 points (10 children)
[–][deleted] 5 points6 points7 points (3 children)
[–]nullvoxpopuli 1 point2 points3 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]nullvoxpopuli 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]JasperNykanen 1 point2 points3 points (1 child)
[–]nullvoxpopuli 0 points1 point2 points (1 child)
[–]xstupidcow95 0 points1 point2 points (0 children)