-
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
feat(gatsby): Remove deleteNode with ID arg #29205
Conversation
@LekoArts I would say yes |
@TylerBarnes To get myself unblocked and you not urged to merge your tests ASAP I reverted the WordPress changes :) The current state is now using deprecated APIs then, but it still works. |
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.
Left a minor comment on the error message, but it's non-blocking and just a suggestion.
I did notice that this typescript definition isn't updated as part of the PR.
gatsby/packages/gatsby/index.d.ts
Line 1130 in e691342
deleteNode( |
I assume that's generated?
) | ||
expect(getNode(`hi`)).toBeUndefined() | ||
const deprecationNotice = | ||
`Calling "deleteNode" with a nodeId is deprecated. Please pass an ` + | ||
`object containing a full node instead: deleteNode({ node }). ` + | ||
`Calling "deleteNode" with an object containing a full node is deprecated. Please pass ` + |
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.
I might change this slightly?
"Calling 'deleteNode' with {node} is deprecated. Please pass the node directly to the function: deleteNode(node)."
An object containing the full node reads a bit confusing in my mind.
if (args && args.name) { | ||
// `plugin` used to be the third argument | ||
plugin = args | ||
`Calling "deleteNode" with an object containing a full node is deprecated. Please pass ` + |
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.
See above.
No idea how I missed that 😅 |
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.
Looks good to me!
Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
Description
This removes the possibility to use
deleteNode
with theID
of the node. This was deprecated in favor of passing in the wholenode
and now will be removed.New deprecation
We align
createNode
anddeleteNode
and add a new deprecation notice to deleteNode.So that at the end it will be
createNode(node)
anddeleteNode(node)
instead ofdeleteNode({ node })
Documentation
The docs (source plugin guide) are updated.
Related Issues
[ch23642]