-
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
Patch react-autosize-textarea for updated types #61570
Conversation
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.
This removes onPointerEnterCapture"
and onPointerLeaveCapture
, which were removed from React.
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. |
@@ -0,0 +1,13 @@ | |||
diff --git a/node_modules/react-autosize-textarea/lib/TextareaAutosize.d.ts b/node_modules/react-autosize-textarea/lib/TextareaAutosize.d.ts |
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.
So by adding a patches file like that, npm automatically overrides the dependency or something? How does that work. TIL
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.
Also is there a way to add a comment or something to explain why we need the patch? Git blame might suffice though.
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.
Yarn has this functionality built in. Gutenberg uses the patch-package
package and runs it on postinstall to do the patching:
Line 311 in b83f0f9
"postinstall": "patch-package && node ./patches/patch-xcode.js", |
I'll add a README to the patches dir, that's a good plan.
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.
The README is very useful. Thank you.
What?
Patch
react-autosize-textarea
to fix some type issues. This should be a harmless change.There are bigger problems with the library that can be addressed, see #61568.
This is a short term fix that should be harmless and fix some build issues.
Extracted from #61486
Why?
Incompatible types can cause this to break because there are type errors between the library and recent React types.
How?
Patch the package to remove references to some keys that no longer exist in the React types.
Testing Instructions
On install you'll see the following (note
react-autosize-textarea@7.1.0 ✔
):CI is sufficient for testing.