-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Epic: Migrate from Gatsby to NextJS #52
Comments
YEESSES!!!!! |
After spending considerable time over the past week on this, I want to offer my (very long) thoughts: Content OrganizationHaving any form of a content layer to abstract the filesystem is critical given how we're storing our content on the filesystem instead of a database and API. For Gatsby, this is done through GraphQL and its For NextJS, there is no official support for a filesystem content layer. For example, we keep our slides in
For option 1, I couldn't really think of much other than trying to set up For option 2, I first tried copying the files from An alternative option that I just came up with (and would probably be what we would do if we continue pursuing NextJS) would be to just rename DeploymentSince Gatsby is a static site generator, it doesn't matter where we deploy since any web server application can do the job. Netlify, GitHub Pages, a Raspberry Pi running Apache, sure. One of my highest motivations for a static site is so that we can deploy on Cloudflare Pages - which offers unlimited requests/bandwidth, a CDN, and very good analytics so we don't have to use third-party trackers (all for free!) With NextJS, we can either run the site on Node.js/Edge runtime OR create a static export of the site. If we go with Node.js/Edge, we'll have limits in terms of server-side execution and bandwidth and probably will have to purchase. If we go with a static export, there will be understandably less features compared to server-side rendering. However, the feature set we have is far less than what Gatsby can provide because NextJS wasn't made for static site generation! For example, if we want image optimization and processing, we'll have to implement all that functionality ourselves, whereas with Gatsby, I don't even need to think about it. Or something as simple as generating a Future ConsiderationsRight now, we don't need server-side rendering or logic since all we are doing is displaying static content. I'll quickly go over some features that we are looking to implement to determine if we would ever need anything like that:
ConclusionI really wanted to migrate to NextJS, but there have been too many issues that I'm not sure how to resolve (which have already been solved in Gatsby). I also do not see major benefits that would result in us migrating to NextJS other than possibly more stability (although I haven't had any issues with Gatsby) and a better attitude towards the website from the helper team lmao. But I am curious to hear more thoughts to determine where we go from here. |
This is simply not true. I searched "nextjs static blog", and the first result is an article by the next.js team using
The main benefit is easy-to-find documentation and tooling. I don't know if I'm just a complete idiot, but for example adding the images in Gatsby took me 2-3 hours, and doing something similar in next.js would have taking 15 minutes. While trying to add it in Gatsby, I ran into outdated repos, forks of official (unmaintained) plugins so that items could work, and a lack of good documentation if you didn't have the exact usecase that the Gatsby homepage describes. I have no issues with using Gatsby, because at the end of the day I don't mind using graphql and markdown. I just worry that Gatsby is dying. See this state of javascript post under "retention". People do not want to continue using Gatsby. This lack of an ecosystem in the future leads to an overall slower development process. I think if we write it in Gatsby, in 2-3 years, it will already need a rewrite. That might be OK. |
I was referencing this article in my first few attempts at implementing content type parsing from the filesystem (you can see gray-matter added in package.json). This implementation only works for files stored directly in the "posts" folder and it doesn't work recursively. It does not handle "index.md" files. It does not handle the actual MD content. It does not generate types or ensure type checking. In our specific use case, we sometimes specify a This is what I meant by Next.js not officially supporting a filesystem content layer - we have to write the layer ourselves and that feels unnecessary when there are already plugins that do exactly this in Gatsby (and Contentlayer did end up writing all of that themselves, so there really is no point dwelling on this further).
I assume you are referring to storing images in the And realize that the only thing you did to add image support to MDX for Gatsby was an additional 20 lines to the config file, most of which was JSON formatting. And if you wanted to do it the Next.js way, you could have done that too - Gatsby's version of the All that being said, I was not aware of Gatsby's declining popularity. I do agree it would not be in our best interest for the framework we use to go bottom-up in the next few years. Which is a complete shame because after working with Next.js I completely understand why Gatsby does things the way it does. Still, my concerns for things like image optimization and site deployment remain unaddressed. |
Yeah, this is probably true. I should refactor the sponsor images to be relative to the sponsor file. This makes a lot of sense. Potentially a lot of the trouble I had was not understanding this design. I think it is unrealistic to migrate to Next.js unless we hit any major issues with Gatsby, and it looks like those have all been resolved. I do think that you could find a solution to all the concerns you have about image optimization and site deployment, but is it worth it? Then the migration process would be more about : "what is the benefit of next.js over Gatsby", and my main response would be "better long-term ecosystem support, and baseline ability from helpers to contribute to the site". But if we add most of the features we want this summer, the long-term ecosystem support isn't that critical, and so the main point for migration would be Is it significantly easier to do things the next.js way over the Gatsby way? And in my previous projects, it seemed that answer is yes, but you reached a different conclusion which is equally valid -- next.js does not make things significantly easier for us. So TLDR; based on your research into our site needs and how next.js can meet them: in it's current state, Gatsby is more suitable for our static content-driven model than Next.js (is what I'm hearing) And I think that soothes my head, so I will stop complaining about Gatsby :) |
feel free to close if you agree, but also happy to discuss further. |
Closed in favor of #190 |
Gatsby is working fine for now, but as a long-term goal, we should move to NextJS since it has become more mature. We shouldn't migrate until we have finished implementing most of our desired features.
The text was updated successfully, but these errors were encountered: