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

feat(gatsby): Add nodes db module #9416

Merged
merged 6 commits into from
Oct 29, 2018
Merged

Conversation

Moocar
Copy link
Contributor

@Moocar Moocar commented Oct 26, 2018

In preparation for #9338, I've added a new nodes db module that can be implemented by an appropriate db nodes backend. Which is only redux as of now. The loki PR will eventually be implemented so that it can be featured flagged on/off using this functionality.

I also added getNodesByType since it makes sense even without loki.

@Moocar Moocar requested a review from a team as a code owner October 26, 2018 05:45
@pieh
Copy link
Contributor

pieh commented Oct 26, 2018

Seems like untintentional changes to packages/gatsby-remark-embed-snippet/src/__tests__/__snapshots__/index.js.snap were commited?

@Moocar
Copy link
Contributor Author

Moocar commented Oct 28, 2018

@pieh The gatsby-remark-embed-snippet test was failing on my machine. Updating the snapshot fixed it on mine, but breaks it on the CI machine. It's quite strange. I've reverted the snapshot so we can merge this. I'll try and figure out why it's breaking on my machine. From what I can see, the markup is getting ordered differently.

@pieh
Copy link
Contributor

pieh commented Oct 29, 2018

I think this looks good, one thing to do here - we will need to update peerDependency gatsby version in plugins that were changed to use new getNodesByType helper function (if someone install new version of plugin - he also need updated version of gatsby that provide that function) - I'll handle this

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pieh pieh merged commit 7d31fe7 into gatsbyjs:master Oct 29, 2018
@Moocar
Copy link
Contributor Author

Moocar commented Oct 30, 2018

@pieh thanks for updating the package versions!

pieh pushed a commit that referenced this pull request Oct 31, 2018
**Builds on #9416 . Merge that one before this**

In additional to performing the queries, `run-sift.js` also currently converts the results into connections (if connection query). But as part of #9338, we will be using `loki` to perform queries too. So we would need to duplicate the connection logic in both query engines.

This PR pulls the connection logic out of run-sift and into `build-node-connections` which makes sense to me as the query engine doesn't need to know about connections. Only about whether it should return one result or many (thus the `firstOnly` flag).

Another benefit is that the query engine no longer needs to understand page dependencies.
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
In preparation for gatsbyjs#9338, I've added a new nodes db module that can be implemented by an appropriate db nodes backend. Which is only redux as of now. The loki PR will eventually be implemented so that it can be featured flagged on/off using this functionality.

I also added `getNodesByType` since it makes sense even without loki.
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
**Builds on gatsbyjs#9416 . Merge that one before this**

In additional to performing the queries, `run-sift.js` also currently converts the results into connections (if connection query). But as part of gatsbyjs#9338, we will be using `loki` to perform queries too. So we would need to duplicate the connection logic in both query engines.

This PR pulls the connection logic out of run-sift and into `build-node-connections` which makes sense to me as the query engine doesn't need to know about connections. Only about whether it should return one result or many (thus the `firstOnly` flag).

Another benefit is that the query engine no longer needs to understand page dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants