4 ms·
Could you describe what kind of pain points have you had? I've been building a photo-intensive static personal website lately. I started off with Next.js, but l
by naavis 6y ago
Could you describe what kind of pain points have you had? I've been building a photo-intensive static personal website lately. I started off with Next.js, but later switched to Gatsby, because so many things just worked out-of-the-box with it. This was especially the case with optimizing and resizing images.
For Gatsby there is gatsby-image, which works super well. For Next.js there is next-optimized-images which is not very mature. The latest version of Next.js also provides next/image, but as far as I have understood, it requires you to run the Next.js backend server, so it is not an option for 100% static websites.
https://nextjs.org/docs/basic-features/image-optimization https://nextjs.org/docs/basic-features/image-optimization
> Instead of optimizing images at build time, Next.js optimizes images on-demand, as users request them. Unlike static site generators and static-only solutions, your build times aren't increased, whether shipping 10 images or 10 million images.
Sometimes I also bumped into issues with Next.js where the framework was trying to send some code to run on the client browser instead of running it during page generation. The division between server and client seemed a bit too hazy for my taste and felt magical in the wrong ways.
- talolard 6y agoYeah, Gatsby-image was what drew us into the platform to begin with. That's what made it fast to get started. I found the plugin system confusing, and poorly documented so it was hard to know how to get the most out of a plugin and adjust it to whatever our own funny use case was. The graphql thing was annoying, we don't use graphql and don't know it and didn't find any advantage in having it around. It's been a while since I touched it, but every time I need to a put it off because it's not a nice env to work in compared to our "from scratch" react apps
- chrisweekly 6y agoNextJS supports export for 100% static site generation (like Gatsby). Unlike Gatsby, it _also_ supports a server runtime and SSR, and everything in between. Its magic is the good kind that decomposes into sane primitives. Respectfully, it sounds like you might have needed to spend a little more time with the docs.
- naavis 6y agoIt does support static site generation, which I was using it for, but for example next/image requires the backend API server. The case I was referring to was such that defining the exact same function in a component file behaved differently than in a page file, I think. In one case the build failed if I remember correctly, because it was trying to build client-side code but the code referred Node.js stuff. No need to be aggressive. I don't have anything against Next, I just felt much more comfortable with Gatsby.
- madjam002 6y agoParent explicitly mentioned next/image, which is not supported by next export static site generation.
- madeofpalk 6y agoThe common complaint about Gatsby is that it's slow. Once you reach a certain scale of records you're ingesting from Contentful or wherever, Gatsby really starts to chug down trying to infer all their types for GraphQL (I believe this is what causes the slow down).