-
Notifications
You must be signed in to change notification settings - Fork 4.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
Footnotes: Remove extra callback when parsing content #66370
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -13 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
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.
Agreed. It seems that this memoization can be safely removed.
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.
Worthwhile change regardless of the Compiler stuff, thanks!
Co-authored-by: tyxla <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: mcsf <[email protected]>
What?
This PR removes the extra callback for updating footnotes when parsing content, which seems to be unnecessary since #52577.
Why?
React Compiler seems to dislike instances where a cached function depends on another cached function. See #66361 that experiments with React Compiler and generates errors in the post editor (see screenshot below).
How?
I found this behavior unexpected and would like to dig further into it. But in the meantime, it does look like the inner callback is unnecessary, (since #52577) so I'm removing it, in favor of the outer ones. Removing the inner callbacks and moving the dependency to them fixes the issue.
Testing Instructions
This shouldn't have any impact on behavior, but you can test it with a post with many footnotes and ensure they continue to work well.
Performance test results should also not be impacted negatively.
You can also test this with React Compiler:
npm install
npm run dev
Testing Instructions for Keyboard
Same
Screenshots or screencast