-
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
Reorganize core supported blocks into top-level blocks directory #399
Conversation
6f9fc56
to
2e198ab
Compare
Need to sort through a failing test at |
|
||
const Editable = wp.blocks.Editable; | ||
const { html, prop } = wp.blocks.query; | ||
const { html, prop } = query; |
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.
That we can't destructure query
here is a little disappointing. Might be worth a rethink on exporting hpq
as wp.blocks.query
, either renaming the property or simply assuming dependent plugins refer to hpq directly.
Incompatibillity with “export * from” and runtime transform babel/babel#2877 (comment) A bit uncertain why this would have no impact on non-test environments (would it?)
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.
We should probably merge this asap to avoid conflicts. The changes look good for me. Curious to know how did you fix the tests? Is it the transform-runtime
removal?
Yes, let's get this in. Thanks @aduth :) |
Yes, there's some more detail in the extended description of a71bea2. I'm still not entirely sure why the runtime polyfill works fine in the browser but not in Node. |
This pull request seeks to explore a restructuring of blocks to colocate implementations with the API in an effort to provide better control mechanisms over when and how blocks are enabled in an editor. In subsequent pull requests, this will be expanded to revise behavior of registration such that a block will no longer automatically be enabled as an option in all cases, but rather made available in a bucket of all known block types from which the editor can cherry-pick.
Potential cases where this may be useful:
The idea being that all core blocks are always registered, and a server-side-filtered array of desired block slugs will be provided for the editor at initialization time.