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

fix(gatsby): Exclude build time when calculating dirty Ids #21795

Closed
wants to merge 2 commits into from

Conversation

sidharthachatterjee
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee commented Feb 27, 2020

This significantly speeds up consecutive builds if all changed is buildTime in the Site node

Co authored with @ascorbic

@sidharthachatterjee
Copy link
Contributor Author

Closing this for now because some folks might actually use buildTime 😛

@sidharthachatterjee sidharthachatterjee added the status: blocked This issue/PR can't be solved at the moment and shouldn't be closed/merged label Feb 27, 2020
@sidharthachatterjee
Copy link
Contributor Author

sidharthachatterjee commented Feb 27, 2020

We can't do what we added in 299626f because some folks might just use buildTime

Now there's an alternative that @pieh brought up:

  • Create a separate top level Node for buildTime
  • Calculate and put it there (in the internal-data-bridge internal plugin)
  • Add a link resolver for buildTime that does a passthrough to the new Node

This would let us track dependencies when buildTime is used in a query (at query resolution time) but not affect the Site node (which includes the heavily used siteMetadata)

This would however need some more work for data dependency tracking to work correctly:

  • The buildTime node would need to be of type Node - this would make it to show up in root query fields and this just pollute root level fields unnecessarily and it would be preferable to not add fields for it to root query

Also there used to be ignoreType that kinda would suffice for this

@freiksenet Do you remember why we stopped supporting it?

@freiksenet
Copy link
Contributor

ignoreType was gone as not important somewhere in schema customization time, I think it was always quite a hack.

@sidharthachatterjee
Copy link
Contributor Author

@freiksenet How do you feel about adding it back? 😛 Or do you have another preferred way to exclude something from appearing as a top level field in Query?

@freiksenet
Copy link
Contributor

I don't think number of fields in root fields is really an important consideration. I'd call it SiteBuildTime so that it's analogous with other Gatsby site stuff.

@sidharthachatterjee
Copy link
Contributor Author

Closed in favor of #21827

@MichaelDeBoey MichaelDeBoey deleted the fix/dirty-queries-build-time branch March 8, 2020 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked This issue/PR can't be solved at the moment and shouldn't be closed/merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants