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

Recent MDX PR changed function signature of createMDXNode #25975

Closed
laurieontech opened this issue Jul 23, 2020 · 5 comments · Fixed by #26004
Closed

Recent MDX PR changed function signature of createMDXNode #25975

laurieontech opened this issue Jul 23, 2020 · 5 comments · Fixed by #26004
Assignees
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@laurieontech
Copy link
Contributor

laurieontech commented Jul 23, 2020

See #25911

A recent perf improvement changed the return object in createMDXNode (https://github.com/gatsbyjs/gatsby/pull/25757/files#diff-15e9617772dbbdaa3f4c5399f3291de9R42)

It also changed the arguments passed to it.

This is a breaking change for those who were calling the function directly in the their gatsby-node.js file.

We should figure out if this is a necessary breaking change and document/bump versions accordingly. Or figure out a different option that won't be.

@laurieontech laurieontech added the type: bug An issue or pull request relating to a bug in Gatsby label Jul 23, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 23, 2020
@laurieontech laurieontech added topic: MDX and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jul 23, 2020
@johno
Copy link
Contributor

johno commented Jul 23, 2020

Hmm, yeah this usage is technically an "undocumented" API, but also exists on developer blogs. So we should probably make sure we're being backwards compatible here if we can be.

@laurieontech laurieontech changed the title Recent MDX PR changed return object Recent MDX PR changed function signature of createMDXNode Jul 23, 2020
@elrumordelaluz
Copy link
Contributor

but also exists on developer blogs.

Thanks @johno for the link, I was using this technique but didn't remember where I pick it.

Looking forward to the progress of this PR. Also available to provide any info regarding use cases.

@johno
Copy link
Contributor

johno commented Jul 24, 2020

We've gone ahead and reverted the breaking PR (thanks to @laurieontech) and we'll explore a new way to integrate these performance improvements next week so they don't break this use case.

We'll keep you updated!

@muescha muescha linked a pull request Jul 24, 2020 that will close this issue
@pvdz
Copy link
Contributor

pvdz commented Jul 29, 2020

Ok. The API was not public but used anyways.

Guess we'll keep it as is and deprecate it. I'll create a new function to do what needs to be done, issue a deprecation warning for the existing function and warn about perf implications of when the user keeps using it, or using something that uses it.

@pvdz
Copy link
Contributor

pvdz commented Jul 29, 2020

(Going to close this issue as the commit was reverted and will take a safer appraoch when trying again)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
4 participants