-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Move freeform block to separate package #70603
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
base: trunk
Are you sure you want to change the base?
Conversation
|
Size Change: -2.93 kB (-0.16%) Total Size: 1.86 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.
The native block is using MissingEdit... so I copied it here.
tyxla
left a comment
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 is great work @ellatrix and I've tried it out with the TinyMCE removal experiment, and it still seems to work OK!
This could also be a good step towards finally deprecating and moving TinyMCE to another plugin at some point. Maybe time to revive the experiment also and see how far we can go with it.
I see some tests are failing, but besides that, what else do you think this needs before being ready for a review?
| textColumns, | ||
| verse, | ||
| video, | ||
| classic, |
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.
Won't this remove the block completely for mobile?
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.
I think it's still registered through registerCoreBlocks, but not 100% sure. I've asked the mobile team to test and review the mobile part.
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.
For mobile I'm pretty much blind and am completely relying on the unit and e2e tests
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.
Yes, the changes to this file result in no longer registering the block type, which means the new packages/block-freeform/src/missing.native.js is never utilized.
I opened #70644 with suggestions to address this.
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.
Took a look at #70644 - let's land it before getting back to this one.
|
@tyxla It's ready for review. What are all the scenarios we need to test?
Fixed it |
| 'wp-block-library', | ||
| 'wp-blocks', | ||
| 'wp-edit-site', | ||
| 'wp-edit-post', |
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.
@Mamaduka I just added wp-block-freeform-editor to edit-post, is this normal?
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.
It looks like a new script has wp-polyfill as a dependency. I've a feeling it's one of the low-level packages that requires it and then ends up as a dependency for other packages.
This doesn't need to be a blocker here.
|
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. |
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.
I wonder if block-freeform is the right pattern. That would suggest block-library and block-editor are a library and editor block... So maybe not. Maybe block-type-freeform?
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.
I think you have a point. Also, what about freeform-block?
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.
I don't like this because when we do this for other blocks, they'll not fit the alphabetical order
|
Flaky tests detected in 247e819. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/16076572142
|
I'll try to take a look in the next couple of days and write some detailed testing instructions. |
dcalhoun
left a comment
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.
Thanks for sharing this PR.
I tested mobile and we should make some changes to avoid title-less fallback UI in the mobile editor. The issue can be seen in the recording below. I opened #70644 suggesting changes to resolve this issue.
Mobile editor title-less fallback recording
classic-block-after.mp4
| @@ -3,4 +3,4 @@ | |||
| */ | |||
| import { init } from './'; | |||
|
|
|||
| export default init(); | |||
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.
Why was the invocation removed? Is there value in this file without it?
It appears other init files in packages/block-library also included an invocation. Is that an oversight?
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.
Not an oversight, it's not the same init function
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.
Understood, regarding the absence of an oversight.
If you have time and are willing to elaborate, I welcome answers to my other questions to help me better understand:
Why was the invocation removed? Is there value in this file without it?
I'll rephrase my questions for clarity: is there a context where packages/block-freeform/src/init.js is used? If so, how is it used?
Thank you. 🙇🏻♂️
| textColumns, | ||
| verse, | ||
| video, | ||
| classic, |
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.
Yes, the changes to this file result in no longer registering the block type, which means the new packages/block-freeform/src/missing.native.js is never utilized.
I opened #70644 with suggestions to address this.
In the meantime, I'd test with these combinations:
|
What?
Moves the freeform block from the block library package to its own package.
Why?
How?
We extract the code to a new package. All
edit-packages that need it should be updated.We can make a back port PR after packages sync to core. Then adjust:
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast