Live data from Hacker News

Next.js 8 released

nextjs.org

71–80 of 118 posts

Re: Next.js 8 released

#71
post #46

Earlier quoted context omitted.

Next.js gives you prefetching as well as code splitting as well as server rendering. You get to use all the modern tools that React gives you, an abundance of open source React components, and get an SEO and load time optimized website with minimal configuration. Building a server rendered, dynamic web app is non trivial. Next.js makes it a lot easier. React coupled with Node.js has been used for SSR since 2015 in si…

> prefetching Prefetching is a questionable and a lot discussed feature, do you want to prefetch all the 50 links on my page? Even if you think this a great feature, I am sure the user using your page doesn't like that you abuse his/her bandwidth. Especially those on mobile. > code splitting This is not a feature. Automatic code splitting is turn-key-ready in CRA. I wrote this now for the tenth time... > server rende…

> Prefetching is a questionable and a lot discussed feature, do you want to prefetch all the 50 links on my page?

This isn't how Next prefetches with dynamic routing. It fetches the JS required to construct the DOM of those pages, but doesn't execute it. If on one page you have three links to /gallery/a, /gallery/b, and /gallery/c, then gallery.js will be prefetched once. You can confirm this in devtools. Also, prefetching is opt-in.

Re: Next.js 8 released

#72
post #16

What I don't get: Either you go full SPA or SSR. And If you go for latter then you can choose any stack, e.g. Rails, express with pug, Django, PHP, etc. Why do people take React's constraints to the backend? No bashing, really wondering what's so much better then. I know why a React SPA can be better than a SSR. But what is better about a React SSR vs the typical SSR?

With frameworks like Next.js, it's no longer either/or, the explicit goal is to have the best of both worlds. The first page is delivered with SSR (for speed), then it boots React in the browser and works as an SPA.

Re: Next.js 8 released

#73
post #40

Earlier quoted context omitted.

How long is the first page load of your react SPA?

This is the wrong question. I use React for SPA use cases and then initial loading time is secondary but I tell you something, my stock React SPA with tons of js and assets has following loading times: DOMContentLoad: 1.08sec, Load: 2.26sec and let's look at nextjs.org: DOMContentLoad: 1.09sec, Load: 2.31sec I mean this comparison doesn't make sense because you don't know my SPA and I could write anything here but te…

DOMContentLoaded isn't as relevant with SSR, because the markup and styles come rendered on the first response, so you never see an initial blank white page.

More relevant metrics are TTFB (time to first byte) and TTI (time to interactive).

I wouldn't want to implement a marketing site in express/pug. I want the flexibility of components and all the other benefits that React offers.

Re: Next.js 8 released

#74
post #46

Earlier quoted context omitted.

> prefetching Prefetching is a questionable and a lot discussed feature, do you want to prefetch all the 50 links on my page? Even if you think this a great feature, I am sure the user using your page doesn't like that you abuse his/her bandwidth. Especially those on mobile. > code splitting This is not a feature. Automatic code splitting is turn-key-ready in CRA. I wrote this now for the tenth time... > server rende…

You're just being nitty and not adding any value to the conversation. Code-splitting in Next.js is fundamentally different than in CRA: https://nextjs.org/#automatic-code-splitting https://facebook.github.io/create-react-app/docs/code-splitt... It's automatic, handled server side...and it gets hydrated on the server side if necessary with asynchronous data. The benefits of this on browser performance and developer pe…

Next.js is some over-engineered thing without a proper use case.

If Next.js was good in SEO, nextjs.org would rank well on the search query 'react ssr' but you know what, it couldn't even rank within the top 10. There's nothing, no nextjs dot org, just a Medium article below the fold. Just want to see your face after you convinced your management and your entire team to move to Next and facing how your organic search volume is nosediving...

This whole thing is pure content marketing paired with forum spamming to get people converted to Zeit's products. I am bit surprised that not more 'real users' defend Next.js here, seems like just some maintainers/contributors could show up worshipping Next. This is all too obvious and maybe young devs fall into your trap.

Btw, I know what JSX is capable of and I prefer it over many things but it's not about JSX or pug or whatever. Next.js is abusing a powerful lib/framework for SSR and templating. SSR is much more, e.g. proper routing, read the thread, Next doesn't get routing (the #1 req of SSR) right and wants to do SSR? Sure.

Re: Next.js 8 released

#75
post #31

Earlier quoted context omitted.

> Next.js [...] loads a little faster IDK, my dockerized express site loads much faster. At 20ms without network time (and this w/o caching). My real React SPA give you instant (0ms) page loads. Nextjs.org initial load is at 580ms and the doc came at whopping 1.38sec (oh yeah) and page loads are not instantly... this thing doesn't make sense (for my use cases). If the only thing I know is React and JSX, then maybe bu…

How can that be possible? The DNS lookup takes longer than that and you still haven't even gotten to your site. Once there the first byte time from the initial HTTP round strip still take considerably more. This is all network traffic that does matter what the application is doing.

> How can that be possible? The DNS lookup takes longer than that and you still haven't even gotten to your site.

I wrote without networking time which includes DNS lookup

Re: Next.js 8 released

#76
post #40

Earlier quoted context omitted.

This is the wrong question. I use React for SPA use cases and then initial loading time is secondary but I tell you something, my stock React SPA with tons of js and assets has following loading times: DOMContentLoad: 1.08sec, Load: 2.26sec and let's look at nextjs.org: DOMContentLoad: 1.09sec, Load: 2.31sec I mean this comparison doesn't make sense because you don't know my SPA and I could write anything here but te…

DOMContentLoaded isn't as relevant with SSR, because the markup and styles come rendered on the first response, so you never see an initial blank white page. More relevant metrics are TTFB (time to first byte) and TTI (time to interactive). I wouldn't want to implement a marketing site in express/pug. I want the flexibility of components and all the other benefits that React offers.

> How can that be possible? The DNS lookup takes longer than that and you still haven't even gotten to your site.

Me too. But if you ever did marketing landing pages for products you might know that one landing page is not enough. You need thousands which match to Ad Word campaigns or which are optimized to different SEO fields, domains and whatever. While you still could manage this with Next and nice components, Next's subpar routing might be an obstacle.

Re: Next.js 8 released

#77
post #9

Next.js is an awesome framework, but dynamic routing is still a mess, and clean URL masking [0] is unnecessary complicated: you have to add a route handler to Express.js, and you have to use 2 different props to your components to make it work. The Next team explains it because they don't want to solve this problem by shipping a definition of all the route of the app [1] because it does not scale. But while it is tru…

> they started to rewrite the core of Next.js

This is such an important piece of information. Imagine you opt for Next and have to rewrite your app soon. I know, APIs can be backwards compatible and Next's next version will be backwards compatible but there is always something which doesn't work, sending you down the rabbit hole...

Re: Next.js 8 released

#78
post #16

What I don't get: Either you go full SPA or SSR. And If you go for latter then you can choose any stack, e.g. Rails, express with pug, Django, PHP, etc. Why do people take React's constraints to the backend? No bashing, really wondering what's so much better then. I know why a React SPA can be better than a SSR. But what is better about a React SSR vs the typical SSR?

I still think that you should endeavor to server-render anything you can get away with. Because of that, we have invested heavily in React SSR.

The biggest value-add of using React on the server is being able to share our design library and business logic with our front- and back-end. We can develop the structure, style and behavior of our website as React components and deploy them server side or client-side. In general, our team has found that the component model is far more composable than templates like pug, PHP, etc.

Re: Next.js 8 released

#79
If you are going to use it as a static site generator, you should also try Hugo + the Mainroad theme, generated files are super light and easy to style as you wish.
Post reply on HN