Live data from Hacker News

Next.js 13.4

nextjs.org

11–20 of 42 posts

Re: Next.js 13.4

#11
I've been using the app/ dir for a couple months now on a side project and I'm really liking how concisely I can build UI + backend + deployment. Vercel is getting some heat for it's pricing, but Next.js is really pushing forward what's possible for people without fiddling with DevOps, separate frontend deployment, separate backend deployment, etc. Coming from Django with Create React App, Django Rest Framework, on a VPS, is a relative nightmare compared to Next.

For example, in one small file, two functions, you have a reactive UI, styling (Tailwind), backend with database fetching, routing, and deployment handled:

async function getPostsFromDb() {

  return await prisma.posts.findMany();
}

export default async function PostsPage() {

  const posts= await getPostsFromDb();

  return (
    
          {posts.map((post) => {
            return (
              
            );
          })}
    
  );
}

Re: Next.js 13.4

#12
post #4

It's astonishing how complex this has become. All the server component stuff is great technologically speaking and if you're using React, it's a very welcome thing as this will lead in the long term to less bloated applications for end users. But as a developer I just can't stand all the complexity and the magic going on. And now a React compiler is on its way too. This is just too much.

> now a React compiler is on its way too

I googled for this and couldn't find anything. Do you have any links that give more info about this?

Re: Next.js 13.4

#13
Really hyped about this! I can't wait to try it out and watching the CI build as we speak. I am curious however about a few points. From their examples in the blog post it's not clear what kind of payloads can be transfered when using server actions. Do they need to be serializable in a specific way? Can I transfer dates? Can they return something (in case I want to validate a form on the server and return an error or a success code)? How does it figure out that the db import will not be bundled into the client? Because it is only used in the function with the "use server" directive? And finally: Can I call "use server" functions in a client component too? In case I want some extra state in there?

Maybe there is someone here who knows more!

Re: Next.js 13.4

#14

I've been using the app/ dir for a couple months now on a side project and I'm really liking how concisely I can build UI + backend + deployment. Vercel is getting some heat for it's pricing, but Next.js is really pushing forward what's possible for people without fiddling with DevOps, separate frontend deployment, separate backend deployment, etc. Coming from Django with Create React App, Django Rest Framework, on a…

Their pricing seems OK to me, the only issue I have is that you can't tell them just to shut it down if the bill goes past a certain limit.

Re: Next.js 13.4

#15

I've been using the app/ dir for a couple months now on a side project and I'm really liking how concisely I can build UI + backend + deployment. Vercel is getting some heat for it's pricing, but Next.js is really pushing forward what's possible for people without fiddling with DevOps, separate frontend deployment, separate backend deployment, etc. Coming from Django with Create React App, Django Rest Framework, on a…

> ...in one small file, two functions, you have a reactive UI, styling (Tailwind), backend with database fetching, routing, and deployment handled

Sounds like a recipe for spaghetti.

Other platforms have been here before (ASP.NET Web Forms comes to mind) and it always ends up bad.

Re: Next.js 13.4

#16

A big benefit of the pages folder is the ability to statically generate content on build time and deploy, then getting the performance benefit of being a static site. Does/will the app folder allow for the same static generation capability? Seeing `Is the pages directory going away?` in the release notes to me seems like a hint that the pages directory may be going away.

Yes, the app router allows for the same static generation.[0] It is the default rendering strategy, and the page only becomes "dynamic" (rendered at request time) if the page has a "dynamic function". (functions that use URL search params etc.)

[0] https://nextjs.org/docs/app/building-your-application/render...

Re: Next.js 13.4

#17
post #4

It's astonishing how complex this has become. All the server component stuff is great technologically speaking and if you're using React, it's a very welcome thing as this will lead in the long term to less bloated applications for end users. But as a developer I just can't stand all the complexity and the magic going on. And now a React compiler is on its way too. This is just too much.

> now a React compiler is on its way too I googled for this and couldn't find anything. Do you have any links that give more info about this?

There isn't much info out there yet, but this video is a small preview: https://youtu.be/lGEMwh32soc

The latest update is mentioned in the March 2023 blog post: https://react.dev/blog/2023/03/22/react-labs-what-we-have-be...

Re: Next.js 13.4

#18

A big benefit of the pages folder is the ability to statically generate content on build time and deploy, then getting the performance benefit of being a static site. Does/will the app folder allow for the same static generation capability? Seeing `Is the pages directory going away?` in the release notes to me seems like a hint that the pages directory may be going away.

Yes, the app router allows for the same static generation.[0] It is the default rendering strategy, and the page only becomes "dynamic" (rendered at request time) if the page has a "dynamic function". (functions that use URL search params etc.) [0] https://nextjs.org/docs/app/building-your-application/render...

Further, you can statically export your application to HTML, CSS, and JS files and host without a server: https://nextjs.org/docs/app/building-your-application/deploy...

Re: Next.js 13.4

#19
After running Next.js in production for a few years I never want to touch it again. I haven't used Vercel, but hosting on AWS I had to patch configurations in dirty ways just to get it to run reliably. I suspect they "locked" things like node config behind the abstraction of Next.js to drive users to their platform where issues are "magically" solved.

Re: Next.js 13.4

#20
post #8
post #6

I've been using the App Router beta for a few months on a pre-production project. No major complaints and I can see the vision. However, I (understandably) had a big issue with implementing Algolia Instant Search SSR into it. Fingers-crossed that 3rd party libraries launch support for it soon.

That's a good flag. I'll reach out to the Algolia team to talk about this.

Thanks! Here's a GH Issue about it that I follow: https://github.com/algolia/instantsearch/discussions/5413#di...

Feel free to reach out. My GitHub is @Colton

Post reply on HN