-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Conditional Page Builds do not work #26741
Comments
If I run However, when I modify only static content (for example Here's the complete log:
|
Right, sorry I understand. Basically any changes to js/css files will cause a full rebuild. "Conditional page builds" only work for data changes |
I see now. The documentation is confusing because its called Conditional Page Builds but changing one page builds all pages. This sounds like it would work:
The part thats not well defined is "data". It wasn't until the second paragraph that I found an answer:
But this still doesn't define "data" or how to modify the data to make a "Conditional page builds" work properly. Can "data" be a json file? How can I try this out with the gatsby example? |
@styfle I think you could say that "data" is anything that comes from the GraphQL data layer. You can read more about it here. In some cases it's markdown content, in others is API-fetched data. It's actually quite common on Gatsby projects to have a "data" part. You can try set it up with a simple mdx plugin to see it working. Do you think the issue is solved? |
The "Data" in question is anything from page queries. Ideally it would work with static queries as well, but there's a bug with it that needs fixing. I've put together a pr that adds some additional logging so hopefully that will at least help show when Gatsby is having to rebuild all the pages. |
I couldn't get the https://github.com/gatsbyjs/gatsby/tree/master/examples/using-gatsby-with-json-yaml git clone https://github.com/gatsbyjs/gatsby
cd ./examples/using-gatsby-with-json-yaml
yarn install
vim package.json # update "build" script
yarn build
vim content/My-JSON-Content.json # update title
yarn build See this git diff screenshot to see what I changed. This still built all the pages. I would expect only
Seems like a bug to me. |
Hey, Everything already got mentioned but I'll give a tl;dr and close it afterward. Conditional Page builds is an experimental feature that only works with data updates. Data updates in Gatsby means, data that comes from the GraphQL layer, in this case only page queries are supported. It can work with JSON updates when using Gatsby at this point in time is not going to invest in this feature and it will probably stay experimental without any development. For more info about our roadmap see https://www.gatsbyjs.com/blog/announcing-unified-gatsby |
Description
Following the steps from Conditional Page Builds, all pages are still built.
Steps to reproduce
Expected result
Expected only
src/pages/page-2.js
to be rebuilt.Actual result
All pages were rebuilt.
Environment
The text was updated successfully, but these errors were encountered: