-
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
[v2] Migration guide updates #5661
Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
ddd19d6
Remove yarn examples for consistency with other docs
m-allanson 8718398
Add rename responsive image queries section
m-allanson bf0a458
Add postcss plugins section
m-allanson 231184a
Remove checklist (moved to issue 3986)
m-allanson 00d68ee
Add mixed CommonJS/ES6 section
m-allanson 8053835
Link to Gatsby webpack docs
m-allanson bb64597
Add node id section
m-allanson 7afa9d9
Add section: remove explicit polyfills
m-allanson f616086
Add section: Change modifyBabelrc to onCreateBabelConfig
m-allanson 163d7ea
Add section: Change `modifyWebpackConfig` to `onCreateWebpackConfig`
m-allanson e54d5f9
Add section: CSS is inlined automatically
m-allanson 5413b73
Add introduction and small tweaks
m-allanson d10adad
Correct line numbers
m-allanson ca6d375
Improve explanation around movement of libs to peerDependencies
KyleAMathews 433833a
chore: minor capitalization tweak
jlengstorf 05b1e85
Add edit link
m-allanson d0cebc7
Split peer dep updates into two sections
m-allanson 9124ad1
Declarative headings
m-allanson c5e1c15
Add table of contents
m-allanson 2be2dca
Use neater Fragment syntax
m-allanson b8c4860
More detail on deprecation note
m-allanson 405073e
Inline comments on code examples
m-allanson bfc9301
Add Jason's node ID query example
m-allanson 6af965a
merge origin/v2-migration-guide
m-allanson d5beb1b
Use markdown diff syntax for before / after examples
m-allanson ad47463
Add 'in-progress' note about babel polyfills
m-allanson ed23990
Add instructions on how to install Gatsby v2
m-allanson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add node id section
- Loading branch information
commit bb64597ea9251143657678472f0d7225de9c3282
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,3 +277,12 @@ Mixing `import` and `module.exports` is not ok: | |
import foo from "foo" | ||
module.exports = foo; | ||
``` | ||
|
||
## Don't query nodes by ID | ||
|
||
Source and transformer plugins now use UUIDs for IDs. If you used glob or regex to query nodes by id then you'll need to query something else. | ||
|
||
[See the Pull Request that implemented this change](https://github.com/gatsbyjs/gatsby/pull/3807/files) | ||
|
||
> TODO: add example | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a real example from one of my projects. 😄 query MyImageQuery {
allImageSharp(filter: {
- id: {regex: "/default.jpg/"}
+ sizes: {originalName: {regex: "/default.jpg/"}}
}) {
edges {
node {
id
sizes(maxWidth: 660) {
src
}
}
}
}
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks :) |
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps eg "Rewrite node ID queries"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I think @m-allanson original wording is correct. There aren't "node ID queries" just queries that might try to query nodes by ID.