-
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
Rename core/text
to core/paragraph
#2135
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2135 +/- ##
==========================================
+ Coverage 22.99% 23.05% +0.05%
==========================================
Files 141 141
Lines 4370 4372 +2
Branches 738 739 +1
==========================================
+ Hits 1005 1008 +3
+ Misses 2841 2840 -1
Partials 524 524
Continue to review full report at Codecov.
|
Sounds good to me! |
I can understand the sentiment here — call it what it is. I can also understand why you'd want to make this change sooner rather than later, as it invalidates all existing blocks. However I'm not 100% a fan of making this change now. I feel like there are still many very rough edges around text formatting, specifically around making lists and quotes, that need polish. We have a path forward on that, but it's very conceivable we'll be revisiting some of the behavior around the text block. Even now, you can make a single linebreak and you're still inside the same text block:
This is What I'm trying to say is that I feel like there's not a clear benefit to making this change yet — there might be once the linebreak and list-making flow plays out. I would also suggest that though the intention is right, make the breaking changes sooner, it is still a beta and we need to try and keep a cool head and stay nimble, there are likely to be breaking changes in the future also. (And even breaking changes shouldn't be too much worse than the text becoming part of the Classic Text block) |
The idea is from a comment on WPTavern - I think it's a really good one.
I think both of these things should be improved independently.
If and when we do this, it should happen in a separate block ( In the meantime, plugins should be able to explore those options themselves. That's a bit difficult at the moment: there is this |
In the absence of further feedback I plan to merge this later today. If and when text behavior changes to make this less necessary or less valid, we can change it back. As usage grows, we should start thinking more about breaking changes. Fortunately this case is pretty easy to handle because the blocks have the same structure: just convert the old blocks to the new name whenever we load a post. This is done in this PR, and future PRs can use similar approaches. |
Could set up a way to no invalidate |
The current behavior should just be an invisible change, but it's probably possible to not modify existing content. What would be the benefit of that approach? |
If we want to surface this, maybe we should just rename the title of the block and leave its name as is. This is still a moving part let's not take a final decision here. We already have the |
A paragraph is a paragraph, so we should call it a paragraph. Having the external name different from the internal name doesn't sound like a great idea to me. I think there is also some benefit to converting "text blocks as they exist today" to I don't anticipate any adverse effects from this change either way. It's not intended to be a final decision, and it'll be easy to change it later. |
This is a separate issue... but I do think these two names should match as well. |
de64fa1
to
823fe5a
Compare
To make it clearer that the
Text
block is actually a single paragraph rather than a section of continuous text, we should rename it toParagraph
.Split out from #1959, which also introduces a multi-paragraph text block (this PR does not).
To ease potential future rebases, most of the refactoring here was done in a semi-automated fashion using the following commands and the
codemod
tool: