Live data from Hacker News

Next.js App Router Update

nextjs.org

81–90 of 93 posts

Re: Next.js App Router Update

#81
post #37

The new docs are extremely annoying; if you're still running a legacy app, sometimes you get put into a doc for a feature you think exists, but then you realize it's not for the right version you're running. Also the new app routers are very confusing. There are concepts of a layout, template, page, etc. While it's nice to have server rendering at this level, it's difficult to understand what is bubbling which direct…

Apps using the Pages Router aren't legacy, it's totally fine and encouraged to continue using it. We'll continue to support in far into the future and also be adding some new features there, too. Where are you landing into the docs from, Google? We try to add version history notes at the bottom of docs pages, but maybe we should place these at the top. Open to feedback.

Just keep the old version's docs and have a version select drop down.

I don't want to trawl through what is essentially a changelog, I want to browse/search the docs for the version I am using.

Re: Next.js App Router Update

#82

Anyone sharing the disappointment with NextJS, please have a second look at https://www.meteor.com/ again. It is much more powerful in terms of backend/frontend communication and reactivity, and even though there was a huge downturn some years ago, its picking up steam again. Importantly: it has been around for roughly a decade now and in most cases "just works", and you can even pick the frontend lib you like (react…

Also have a look at https://vite-plugin-ssr.com/ (author here).

VPS is slightly lower level which gives you a lot more control: integrate with your existing Node.js backend (use any backend framework you want), deploy anywhere, use any React alternative (Solid, Preact, ...) and any data fetching tool (e.g. Relay can't really be used with Next.js).

The flip side is that you've to write a little bit more glue code. Although this will be alleviated by a lot with projects such as Bati[0], Stem[1], and vike-react (see Vike Rebranding[2]).

VPS also cares a ton about details, such as hooks for full control over i18n (use any i18n strategy you want), better Base URL support (VPS supports setting a different base for your server and your CDN), automatic deploy synchronisation, domain-driven file structure, polished and helpful error messages (especially the next upcoming release), ...

Detailed comparison with Next.js: [3].

If you run into any blocker then it's quickly fixed (or at least a workaround is proposed).

It supports not only SSR and pre-rendering, but also SPA in case you don't need SSR. It's going to support RSC but doesn't yet (RSC isn't ready for production).

Because it's lower level and because it's decoupled from React everything is designed in an agnostic way and with meticulous care. In other words: vite-plugin-ssr is becoming a robust foundation. There are breaking changes coming for the v1 release but beyond that chances are that there won't be any breaking changes for years in a row.

In a nutshell: vite-plugin-ssr takes care of the frontend and only the frontend. You keep control over your architecture. (Whereas frameworks tend to put themselves right in the middle of your architecture restricting you in fundamental ways.)

Last but not least: it's powered by Vite which means blazing fast HMR.

[0] https://batijs.github.io

[1] https://stemjs.com/

[2] https://github.com/brillout/vite-plugin-ssr/issues/736

[3] https://vite-plugin-ssr.com/nextjs-comparison

Re: Next.js App Router Update

#83
post #27
post #8

Vercel as a hosting provider is almost purposely slow (at least on the free tier) for app router based sites. RSC files in particular take 500ms to 2000ms to start serving those static files.

The page load performance of a site on Vercel's free and paid tier should be the same. Both would be using Vercel's Edge Network and possible a Vercel Function if dynamically rendered. As mentioned in the post, we're working to improve loading performance in general with the Next.js App Router.

But the stuff is static. Just that RSC files are oddly slow which can prevent a page transition on a fast click.

And there isn’t a way to signify loading as those events on the router are gone.

Re: Next.js App Router Update

#84

Earlier quoted context omitted.

> Next and React have gotten way too complicated. Because I'm fed up with all the unnecessary complexity, and I want to try Vue because it looks a lot less complex, and I've already had a positive experience in the ecosystem with Vite and Vitest.

I mean.... This just sounds like novelty. You could keep using the react you've always liked?

Yeah, it's a good point, and I'll continue to do that on my stable projects. But for a new project I'd like to try Vue, because I don't like the direction React is moving. In five years the "React I like" might not be available or widely practiced.

You're right that Vue will be a novelty - that's what I'm saying: React has jumped the shark to the point that it's now worth trying something for its novelty, because it just might be better.

Re: Next.js App Router Update

#86
At my current gig we support two Next apps (both on the pages router) and are currently in the very early stages of building a new Next app using the app router. While we are very excited about the technology, adoption has been slowed by a few things.

1. Server components have poor support for certain (non tailwind) css solutions. We had hoped to use vanilla-extract as its syntacticly similar to other css-in-js solutions, but ran into issues with HMR completely falling apart locally if the page contained a NextImage. We ended up falling back to good ol’ fashion sass modules.

2. As some other commenters mentioned googling for support somewhat consistently lands you on the opposite routers docs and while it’s somewhat obvious to tell where you are its still missable if you are moving quick.

All that to say I’m personally, _sorta_ burnt on Next and have found a ton of joy using svelte + sveltekit for my personal/hobby projects.

Re: Next.js App Router Update

#87
post #76

Earlier quoted context omitted.

I think, if I'm recalling it correctly, that the component that is defining it in the docs can be either client or server and by marking the functiom as server only, Next knows to do magic.

Next may know that but developers sure won't.

This kind of noodley bundling opt-out is also extremely dangerous from a security perspective. I expect there are a lot of Next.js apps leaking code and possibly secrets that should only be available on the server.

Re: Next.js App Router Update

#88

I have found that it is pretty difficult to find what I'm looking for when searching for articles/issues that relate in any way to the Next router. "App router" and "pages router" were two of the most ungooglable and generic name they could have chosen. Suddenly it is much more difficult to find what I'm looking for in the ecosystem.

Agreed, nextJS feels incredibly overloaded with lots of terms that seem to conflate.

I tried to use the new app router, but it felt infuriatingly opaque to me, so I just went back to pages. Fortunately you can use the newest nextJS v13 and still have access to the old Pages system.

Re: Next.js App Router Update

#89
post #37

The new docs are extremely annoying; if you're still running a legacy app, sometimes you get put into a doc for a feature you think exists, but then you realize it's not for the right version you're running. Also the new app routers are very confusing. There are concepts of a layout, template, page, etc. While it's nice to have server rendering at this level, it's difficult to understand what is bubbling which direct…

Apps using the Pages Router aren't legacy, it's totally fine and encouraged to continue using it. We'll continue to support in far into the future and also be adding some new features there, too. Where are you landing into the docs from, Google? We try to add version history notes at the bottom of docs pages, but maybe we should place these at the top. Open to feedback.

Pressing command+k, attempting to find a solution to an issue- but the solution is for app routes not pages route.

Having them separate was better for documentation satisfaction.

Re: Next.js App Router Update

#90
post #31

Earlier quoted context omitted.

Sorry about this. I work on the documentation (author of the post). Are you talking about searching through the docs or searching through GitHub? ARe there specific things you've searched for you couldn't find?

It has been primarily related to web search and Github. It has been a month or two since I last tried the Next.js app router and I don't remember specifics, but I do recall that my workflow often involved searching for an issue, article, or guide related to how to accomplish something or fix something in relation to the router, but with the distinction between routing mechanisms being represented by these relatively…

Naming things is hard. On the one hand, I prefer descriptive names like app router. On the other, idiosyncratic names like, idk, Pinecone are more googleable but opaque and hard to remember sometimes.

I used the CSS toolkit called Less and that name took the worst out of each hand. That was just terrible re: searching for things.

Post reply on HN