Patch react-autosize-textarea for updated types#61570
Conversation
sirreal
left a comment
There was a problem hiding this comment.
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.
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.
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.
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
I'll add a README to the patches dir, that's a good plan.
youknowriad
left a comment
There was a problem hiding this comment.
The README is very useful. Thank you.
What?
Patch
react-autosize-textareato 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.