Skip to content
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

question - incremental builds support = part II #5002

Closed
ekdev2 opened this issue Apr 16, 2018 · 54 comments
Closed

question - incremental builds support = part II #5002

ekdev2 opened this issue Apr 16, 2018 · 54 comments
Labels
type: question or discussion

Comments

@ekdev2
Copy link

@ekdev2 ekdev2 commented Apr 16, 2018

#4981
I think @LekoArts is right. What I mean is if you generate a site with 2000 pages and deploy to aws, then one of those content pages changes in the cms, can you generate just that one page and deploy it.

@m-allanson m-allanson added the type: question or discussion label Apr 16, 2018
@m-allanson
Copy link
Contributor

@m-allanson m-allanson commented Apr 17, 2018

It's not something Gatsby does at the moment, but it is something people have asked for. There's been work in version 2 to improve performance on larger sites, but there's no release date for that yet.

@mattferderer
Copy link
Contributor

@mattferderer mattferderer commented Apr 17, 2018

@m-allanson is there a discussion/issue on how to handle this? I didn't see it in the link you listed. I'm curious to hear conversations on how to handle doing this on a host like Netlify & using a CMS like Wordpress/Drupal that currently require a lot of HTTP requests during build.

@pieh
Copy link
Contributor

@pieh pieh commented Apr 17, 2018

AFAIK you wouldn't been able to use incremental builds on netlify because .cache and public directories are not preserved between builds, so it will always do clean build

@mattferderer
Copy link
Contributor

@mattferderer mattferderer commented Apr 17, 2018

That's good to know. I'm tossing around a ton of ideas that aren't well thought out. So even if we could eliminate the need for HTTP requests, we still need to make sure the .cache and public directories can be referenced by the build tool which eliminates many of the hosts that lower the bar to entry.

@robertschneiderman
Copy link

@robertschneiderman robertschneiderman commented May 8, 2018

Another use case for incremental building is when you have a very large site that you want to build in parts. I was getting "heap out of memory error" when building ~5k pages at once.

We plan on our site getting very large, so we're testing Gatsby at larger scales. We've tried doing something like this path: './src/pages/${subPath}', where subPath is process.argv[3]. This works nicely when we host parts of our site with gatsby develop. It also circumvents the problems with the memory heap when using gatsby build for a 5k+ page site. For it to really be a solution, it would probably depend on the ability to specify an output subdirectory within the public folder: #4756

@ekdev2
Copy link
Author

@ekdev2 ekdev2 commented Jun 20, 2018

what if another approach is used to achieve the same goal. I wanted to run an idea by you guys and see what people think. So lets say you have a 5k page web site. The initial pages would be generated statically but each page will have a sub component that will load on top of the static content with the same content thats read from static json files. This way if a user wanted to update one page in the CMS in the middle of the day, they can make the update and just that static json file would be regenerated and deployed to a CDN. Then you can just regenerate the whole site maybe once a day as a nightly process. The seo static content might not be the most up to date during the day but I dont see that as a big deal. It will just get updated during the nightly process.

@ekdev2 ekdev2 reopened this Jun 20, 2018
@tsimons
Copy link
Contributor

@tsimons tsimons commented Jul 18, 2018

@robertschneiderman we've run in to the memory issue as well. We're closer to 1500 pages, but an insane amount of images (design blog). We've turned off source maps, and stopped the build from downloading image files, but ultimately had to edit the build command to increase the memory allocated to the node instance. via the --max_old_space_size flag.

One thing that worries me about this feature is schema building. If we don't have every post available for gatsby to build a schema from, our queries will throw errors. It would be really nice if there was a way to pass schemas to gatsby, or at least provide dummy entities during the build to demonstrate the different shapes they may take.

@agonsalves
Copy link

@agonsalves agonsalves commented Jul 18, 2018

I am considering using Gatsby to build the UI for a content site with over 5000 items, most with interconnected relationships to each other. The data will come from a database-driven CMS.

The benefit to using Gatsby over a standard API-driven React site is that I would spend a fraction of the time building and maintaining the data API and state management system that loads the remote data and stores it. (Since I plan on deploying this application for multiple sites of similar size, this seems like a very valuable benefit.)

The downside to using Gatsby in this case would be the fact that the entire site would need to be rebuilt for even the most insignificant content update. Forgot to add a comma? Rebuild all 5000 pages! Who even knows how long that would take? This is even more of an issue when considering the experience of the CMS users - they're used to seeing changes appear on the site immediately after they save them. With Gatsby, we're looking at a few minutes' wait (at least) before the change appears.

If there were a way to trigger builds for a subset of pages, it would make Gatsby the clear, definitive choice. At this moment, though, it's a tough sell.

@KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Jul 18, 2018

BTW, I've been working a lot on improving speeds for larger site builds for v2. On the latest v2 beta — you might be able to build 5000 pages in < 1:30. There'll be more speed improvements coming.

@tsimons
Copy link
Contributor

@tsimons tsimons commented Jul 19, 2018

That's amazing @KyleAMathews! I definitely look forward to that! Let me know if you want to test against an image heavy blog

@brod-ie
Copy link

@brod-ie brod-ie commented Oct 16, 2018

@KyleAMathews 5K is nice but we need 1M 😉

@Tawfiqh
Copy link
Contributor

@Tawfiqh Tawfiqh commented Oct 16, 2018

If we want to compile parts of the site separately, we can set flags on build so that gatsby-node knows only to generate the parts of the site specified. We could then add back in the previously generated static files. This works for us as long as we link to the previously generated files with a basic <a href> as opposed to a <Link to >.

I'm wondering if we can make <Link to> work when linking to previously generated files if we merge in some of the previous data.json at build time. Looking into that a bit more at the moment.

@rbmedia
Copy link

@rbmedia rbmedia commented Nov 7, 2018

I have no worry with the build time but more with the volume of static files that I need to upload for any update, we launched a large visual portfolio with Gatsby and the static site to upload is over 150 MB
Mostly images.
This makes the site unavailable around 40 minutes during an update
The availability to rebuild a part of the site is definitely a feature that would boost Gatsby.
I plan to use Gatsby for a new site but I will divide the site in a static and dynamic part using a traditional php CMS for the news part.

@mattferderer
Copy link
Contributor

@mattferderer mattferderer commented Nov 7, 2018

@rbmedia you might want to consider a host that does deployment switching like Netlify so your current site stays running until your new version is ready.

@rbmedia
Copy link

@rbmedia rbmedia commented Nov 7, 2018

Thanks Matt, I will consider it!
I did built some News websites with Drupal in the past, any update had to be online within a short lapse of time (less than 2 minutes). I would love to use Gatsby in the future for this kind of sites.

@KnisterPeter
Copy link

@KnisterPeter KnisterPeter commented Jan 17, 2019

Any news on this issue? We plan a site with around 100k pages and incremental builds would be awesome.

@Leocn
Copy link

@Leocn Leocn commented Jan 25, 2019

make another path as default static page folder, not '/public'.
After run gatsby build, copy the ../public/* to the default path.

@gatsbot
Copy link

@gatsbot gatsbot bot commented Feb 17, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? label Feb 17, 2019
@Tawfiqh
Copy link
Contributor

@Tawfiqh Tawfiqh commented Feb 19, 2019

I still don't think this is fixed/supported in Gatsby. Any news @ TeamGatsby?

@jariz jariz added not stale and removed stale? labels Feb 21, 2019
@wardpeet
Copy link
Member

@wardpeet wardpeet commented Feb 22, 2019

it's a long-standing issue because it's really hard to fix without thinking heavily about it. @Moocar has an issue open to at least get us a step in the right direction.

@xaviemirmon
Copy link
Contributor

@xaviemirmon xaviemirmon commented Dec 1, 2019

Incremental builds on Gatsby Cloud fixes these issues. You can signup for the private beta here https://www.gatsbyjs.com/builds-beta/

@dwightwatson
Copy link

@dwightwatson dwightwatson commented Dec 1, 2019

Nothing about that seems to suggest it supports incremental builds though - just that it has the "fastest build times for Gatsby sites".

I'd be concerned about the implication that incremental builds would only be available on a hosted Gatsby service rather than available to be used standalone.

@xaviemirmon
Copy link
Contributor

@xaviemirmon xaviemirmon commented Dec 2, 2019

I see what you mean @dwightwatson there's nothing on the website that says it's "incremental." At Gatsby Days London they demoed builds and it was definitely incremental builds. Not sure how it's done though and if it will be apart of the Gatsby package or if it's just going to be a service they provide.

@agonsalves
Copy link

@agonsalves agonsalves commented Dec 2, 2019

Investors gotta make their money back somehow. 🙄

@gomflo
Copy link

@gomflo gomflo commented Dec 10, 2019

trying to build very large website 140k+ pages
image

gatsby build is somewhat good… but doing the deployment its painful (zeit.co)

@github-actions github-actions bot added the stale? label Dec 31, 2019
@scandeezy
Copy link

@scandeezy scandeezy commented Dec 31, 2019

Unsure how to add a label to this, but I'm putting this down as still an issue.

@github-actions github-actions bot removed the stale? label Dec 31, 2019
@pvdz pvdz added the not stale label Jan 6, 2020
@pvdz
Copy link
Contributor

@pvdz pvdz commented Jan 6, 2020

@gomflo is there a way I can build your site? There might be some low hanging fruit to resolve to improve build times :) No promises.

@ethannkschneider
Copy link

@ethannkschneider ethannkschneider commented Jan 7, 2020

Nothing about that seems to suggest it supports incremental builds though - just that it has the "fastest build times for Gatsby sites".

I'd be concerned about the implication that incremental builds would only be available on a hosted Gatsby service rather than available to be used standalone.

re this ^: If my gatsby repo is in gitlab and not github, will I be able to use gatsby cloud/build features?

@sielay
Copy link
Contributor

@sielay sielay commented Jan 9, 2020

I might have mentioned that before, but regards original issue/feature. For publishers, Gatsby will make sense if we could trigger the only generation of new pages plus maybe update to indexes. Hardly any publisher would care about updating old canonical pages.

@mushkin-v
Copy link

@mushkin-v mushkin-v commented Jan 10, 2020

So will we have a standalone partial update or no chances? Maybe there is some another way to update only a few pages and don't rebuild the whole project?

@dominicfallows
Copy link
Contributor

@dominicfallows dominicfallows commented Jan 12, 2020

Just wanted to update that my team is close to publishing a PR into the Gatsby repo that we think enables incremental builds. We're just taking some time to write a good PR and tighten up the code, but I will update here when we are done (in the next week or so).

@dominicfallows
Copy link
Contributor

@dominicfallows dominicfallows commented Jan 22, 2020

Just wanted to update that my team is close to publishing a PR into the Gatsby repo that we think enables incremental builds. We're just taking some time to write a good PR and tighten up the code, but I will update here when we are done (in the next week or so).

Here's the PR #20785

@dominicfallows
Copy link
Contributor

@dominicfallows dominicfallows commented Jan 28, 2020

Further update to the PR: #20785 (comment)

@dominicfallows
Copy link
Contributor

@dominicfallows dominicfallows commented Feb 17, 2020

New PR, focusing in on incremental data changes #21523

@lannonbr
Copy link
Contributor

@lannonbr lannonbr commented Apr 27, 2020

With #21523 merged in and Incremental Builds available in Gatsby Cloud, I believe this issue is resolved. It doesn't support all workflows, but I am going to close this for now and it may be better to open a new issue in the future for future endeavors if need be.

@agonsalves
Copy link

@agonsalves agonsalves commented Apr 27, 2020

Should it really be closed? The optimization was just that - an optimization. It wasn't truly incremental builds. On top of that, whatever is available through Gatsby Cloud is not available through usage of the public package. For the specific intent of this ticket, nothing has been resolved.

@dandv
Copy link
Contributor

@dandv dandv commented Jun 10, 2020

Should it really be closed?

Based on #5496 (comment), I don't think this issue should stay closed, and I don't understand why the not stale label was removed.

@datakurre
Copy link
Contributor

@datakurre datakurre commented Jul 1, 2020

Has anyone here tried, or know if it is possible, to tweak GatsbyJS webpack configuration to simultaneously produce both development preview and production build version with ”gatsby develop”? (Possibly resulting ”incremental builds” with cost of forever running development server.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion
Projects
None yet
Development

No branches or pull requests