-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
react-autosize-textarea
dependency seems to be abandoned; what does this mean for <PlainText>
?
#39619
Comments
Maybe this could be a two steps project. Can we first make the v2 stable and deprecate v1? That way we'll be reducing the impact of the v1 removal (that can probably happen in a future WP release) |
Since Actually, I think the debate of what to do here is why things ended up the way they are. I guess the question is one of naming. Should the "editable text input in which text formatting is not allowed" be called |
EditableText is just an internal component that serves as a base for both RichText and PlainText. I still prefer the RichText and PlainText naming, EditableText is a bit confusing IMO. |
I've started #39817 to stabilize I'm guessing these are all misuses of the component, and we should switch to just using |
I don't know, one could argue that both use-cases are valid, in which case we'd need a "plain text" without borders and such and one that is more like a regular text area. could be a |
Any update on this situation? One thing I've neglected to mention until now is that this library causes dependency issues since it does not support React 17: https://github.com/buildo/react-autosize-textarea/blob/master/package.json#L74 |
I agree that v2 should be stabilized and v1 deprecated. In the core block, there are two blocks where
In this case, This is due to the fact that the reset CSS is not applied to the form elements in the site editor. I initially considered a CSS fix to Is it possible to continue this discussion? |
Sure, we could add a variant prop to indicate that you want the borders styled like a regular input field. But underneath it should remain an editable div where the borders are just added with CSS. We should deprecate v1 and remove the text area autoresizing. v2 with the editable div is much easier to handle. Happy to review a PR! |
@ellatrix @ZebulanStanphill |
Due to I'll try and get around to it this weekend, but if anyone wants to jump in and do it instead, be my guest. |
If you don't mind, I would like to take over your draft PR #39817. If you have any problems, please do not hesitate to tell me 👍 |
@t-hamano Go ahead! I'm pretty busy at the moment, so I appreciate someone else picking up the work. |
I have begun to work on this issue and have run into one problem. The custom HTML block and the shortcode block are currently using version 1 Therefore, I believe that either of the following approaches may need to be taken:
I would like to hear your opinion on what approach would be appropriate. |
I found #48215 which switches aa to #48215.
The above issue I was concerned about may be resolved once this PR is merged: textareas that need to keep HTML tags will be replaced directly with the new react-textarea-autosize rather than migrating to PlainText version 2 Approach. |
We should probably add a prop |
I've experimented with removing It's a bummer that it's blocked by |
react-autosize-textarea
, a dependency of@wordpress/block-editor
, appears to be abandoned. It has not received any updates since July 2020, and a PR made by someone on December 2020 to add support for React 17 has been entirely ignored.As it turns out, there's a very similar package called
react-textarea-autosize
, which is actively maintained, and appears to be significantly more popular, according to NPM weekly download statistics.I would make a PR to replace the dependency right now, but there's a bit of a hitch. Of the 2 locations where the
<TextareaAutosize>
component from the abandoned package is used, one is in the<PlainText>
component:As you can see, the
<PlainText>
component forwards most of its props to<TextareaAutosize>
, and there are no specific types declared for the props of<PlainText>
. As a result, replacing the<TextareaAutosize>
of the abandonedreact-autosize-textarea
with the one fromreact-textarea-autosize
would necessarily constitute a breaking change, since the latter has a slightly different set of custom props.But speaking of breaking changes, you can also see that our
<PlainText>
component has an experimental version 2, which simply forwards props to<EditableText>
(another component from@wordpress/block-editor
), which does not use<TextareaAutosize>
at all. So if we were to declare a breaking change for<PlainText>
, it would only affect the "v1" of the component. So at that point, you might as well just get rid of the v1 and fully commit to the v2, right?Well, not exactly, because the experimental version 2 of
<PlainText>
is still called "experimental"... and it has been for nearly 2 years now. (See #18361 and #21076.)So... now what? Pinging @ellatrix and @youknowriad since they were involved in the aforementioned 2 PRs.
The text was updated successfully, but these errors were encountered: