WordPress.org

Make WordPress Core

Opened 7 weeks ago

Closed 6 weeks ago

Last modified 4 days ago

#54335 closed task (blessed) (fixed)

Add FSE infrastructure from Gutenberg plugin into Core

Reported by: noisysocks Owned by: bernhard-reiter
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

  • Make it so that a block theme can be activated and render correctly on the frontend.
  • Add site editing REST API endpoints.
  • Add necessary PHP helpers (WP_Block_Template, etc.)

https://github.com/WordPress/gutenberg/tree/trunk/lib/full-site-editing

Change History (42)

This ticket was mentioned in PR #1796 on WordPress/wordpress-develop by ockham.


6 weeks ago

  • Keywords has-patch added

Work in progress. Attempts to add the required infrastructure to render block-based themes to Core.

Trac ticket: https://core.trac.wordpress.org/ticket/54335

#2 @prbot
6 weeks ago

youknowriad commented on PR #1796:

I've merged template-part utils and template utils because the template-utils already worked for both. We just missed some functions.

#3 @prbot
6 weeks ago

youknowriad commented on PR #1796:

Add minified CSS to Template Part block.

What is this item about @ockham I think there's no stylesheet for this block if I'm not wrong?

#4 @prbot
6 weeks ago

youknowriad commented on PR #1796:

Ok, I think this one is actually ready, the only issue is the manual modifications to the template part blocks which is breaking some tests (unit, e2e tests, npm).

#5 @prbot
6 weeks ago

noisysocks commented on PR #1796:

Ok, I think this one is actually ready, the only issue is the manual modifications to the template part blocks which is breaking some tests (unit, e2e tests, npm).

It's a bit of a chicken and egg problem because https://github.com/WordPress/wordpress-develop/pull/1804 which updates the blocks properly depends on this PR 🙂

I guess we will need to just skip the tests or commit this with failing tests and then immediately follow up with commits for https://core.trac.wordpress.org/ticket/54336 and https://core.trac.wordpress.org/ticket/54337.

#6 @prbot
6 weeks ago

youknowriad commented on PR #1796:

@noisysocks yeah, I'm also fine if we include this patch in the packages update one, whatever works for you.

#7 @prbot
6 weeks ago

hellofromtonya commented on PR #1796:

My comments/suggestions in the tests are not blockers as I can be update them after the merge.

#8 @prbot
6 weeks ago

hellofromtonya commented on PR #1796:

My comments/suggestions in the tests are not blockers as I can be update them after the merge.

#9 @prbot
6 weeks ago

hellofromtonya commented on PR #1796:

Whoopsie didn't mean to close this. Reopening.

#10 @prbot
6 weeks ago

hellofromtonya commented on PR #1796:

In the tests, there are improvements that can be made which are not blockers to merge this PR:

  • With PHP getting more and more strict, an effort is ongoing to replace all assertEquals with assertSame.
  • With multiple assertions in a single test, if one fails, the other assertions do not run and it can be difficult to know which assertion failed. An effort is ongoing to add custom messages to each of these assertions to help with debugging.

I deleted all of the code suggestions for the tests (too much noise). I'll check after merge for any improvements, which BTW can happen after feature freeze.

This ticket was mentioned in PR #1825 on WordPress/wordpress-develop by noisysocks.


6 weeks ago

https://github.com/WordPress/wordpress-develop/pull/1796 and https://github.com/WordPress/wordpress-develop/pull/1804 depend on each other for tests to pass, so this PR merges both of those PRs into a single big branch. Hopefully that means we can fix tests and commit.

Trac ticket:
https://core.trac.wordpress.org/ticket/54335
https://core.trac.wordpress.org/ticket/54337

#12 @prbot
6 weeks ago

desrosj commented on PR #1825:

I've changed the base of this PR to trunk. This is now the default branch going forward. See the original proposal that is finally being put in place.

#13 @prbot
6 weeks ago

ockham commented on PR #1796:

After rebasing, TT1 Blocks fatals on the frontend since get_query_pagination_arrow is missing. That function is indeed absent from Core; whereas in GB, it’s defined in the WP 5.8 compat layer. I’m a bit confused; I thought that means that it’s been present in Core since 5.8?

#14 @prbot
6 weeks ago

ockham commented on PR #1796:

FWIW, get_query_pagination_arrow was added to GB by this PR: https://github.com/WordPress/gutenberg/pull/33656

#15 @prbot
6 weeks ago

ntsekouras commented on PR #1796:

After rebasing, TT1 Blocks fatals on the frontend since get_query_pagination_arrow is missing. That function is indeed absent from Core; whereas in GB, it’s defined in the WP 5.8 compat layer. I’m a bit confused; I thought that means that it’s been present in Core since 5.8?

That's my bad, sorry 😞 . I will have a PR for adding this in 5.9 for GB. It needs to be added in core as well.

#16 @prbot
6 weeks ago

ntsekouras commented on PR #1796:

Added get_query_pagination_arrow in blocks.php.

#17 @prbot
6 weeks ago

ockham commented on PR #1796:

No worries! Thanks a lot for the fix, Nik!

#18 @prbot
6 weeks ago

ockham commented on PR #1796:

Thanks to everyone who has worked on this, by adding and improving code, or reviewing!

I think we've addressed all feedback, so I'm setting this PR to ready for review. All that's left is some final approval now 😄

#19 @prbot
6 weeks ago

ockham commented on PR #1796:

Ah, rebasing on trunk (which now includes https://github.com/WordPress/wordpress-develop/pull/1808) introduced a conflict (duplicated get_custom_templates()). I'll fix...

#20 @prbot
6 weeks ago

ockham commented on PR #1796:

Ah, rebasing on trunk (which now includes https://github.com/WordPress/wordpress-develop/pull/1808) introduced a conflict (duplicated get_custom_templates()). I'll fix...

#21 @noisysocks
6 weeks ago

  • Owner set to bernhard-reiter
  • Status changed from new to assigned

#22 @prbot
6 weeks ago

noisysocks commented on PR #1796:

Thanks @bernie! I'll rebase and commit this.

#23 @prbot
6 weeks ago

noisysocks commented on PR #1796:

Going to ignore the lint failures as they are failing on trunk too.

https://wordpress.slack.com/archives/C02RQBWTW/p1636411775055600

#24 @noisysocks
6 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 52062:

Editor: Add block theme infrastructure

Adds the required infrastructure to render block-based themes. This is sourced
from the Gutenberg plugin.

Fixes #54335.
Props bernhard-reiter, youknowriad, ntsekouras, hellofromtonya.

This ticket was mentioned in Slack in #core-editor by noisysocks. View the logs.


6 weeks ago

#26 @desrosj
5 weeks ago

In 52110:

Docs: Avoid using “CPT” instead of “custom post type”.

Additionally, when referring to built in Core post types, “custom” is unnecessary.

This also adds a period to the end of the wp_global_styles post type description.

Follow up to [38829], [51003], [52041], [52049], [52062].

See #53399, #54335, #54336.

#27 @SergeyBiryukov
3 weeks ago

In 52266:

Tests: Replace assertEquals() with assertSame() in block template tests.

This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using assertSame(), assertSameSets(), or assertSameSetsWithIndex() should generally be preferred, to make the tests more reliable.

Follow-up to [51003], [51079], [52062], [52265].

See #53364, #53363, #54335.

This ticket was mentioned in PR #2020 on WordPress/wordpress-develop by youknowriad.


10 days ago

This backports a change that was missed during the initial backports related to the templates list shown in the post editor.
It's a change from the following Gutenberg PR https://github.com/WordPress/gutenberg/pull/35802

Trac ticket: https://core.trac.wordpress.org/ticket/54335

Testing instructions

Make sure the post editor only shows custom page templates in the template list and not hierarchy templates (index, single...)

cc @Mamaduka

This ticket was mentioned in PR #2020 on WordPress/wordpress-develop by youknowriad.


10 days ago

This backports a change that was missed during the initial backports related to the templates list shown in the post editor.
It's a change from the following Gutenberg PR https://github.com/WordPress/gutenberg/pull/35802

Trac ticket: https://core.trac.wordpress.org/ticket/54335

Testing instructions

Make sure the post editor only shows custom page templates in the template list and not hierarchy templates (index, single...)

cc @Mamaduka

This ticket was mentioned in PR #2021 on WordPress/wordpress-develop by youknowriad.


10 days ago

This backports a Gutenberg change that was missed during the last backport session.
It's a change from the following Gutenberg PR https://github.com/WordPress/gutenberg/pull/36000

Trac ticket: https://core.trac.wordpress.org/ticket/54335

cc @jameskoster

#31 @youknowriad
10 days ago

In 52331:

Site Editor: Update the block template descriptions.

Align the template descriptions with the latest changes from the Gutenberg plugin.

Props jameskoster, SergeyBiryukov.
See #54335.

#33 @youknowriad
10 days ago

In 52334:

Block Editor: Only list custom block templates in the template selector.

Previously all block templates including the hierarchy templates were being shown in the CPT template selector.

Props mamaduka.
See #54335.

#36 @prbot
10 days ago

noisysocks commented on PR #2021:

Thank you!

This ticket was mentioned in PR #2031 on WordPress/wordpress-develop by Mamaduka.


9 days ago

Follow-up for #2020.

This method calls get_block_templates once and uses block template properties directly for filtering. This way, we can avoid hitting the database for each public post type.

The previous method is useful when we already know the current post type we request templates for, like when using REST API.

Trac ticket: https://core.trac.wordpress.org/ticket/54335

---
Cc @youknowriad @noisysocks @hellofromtonya

This ticket was mentioned in PR #2035 on WordPress/wordpress-develop by youknowriad.


8 days ago

Block themes without theme.json file didn't have block templates support enabled in Core by default while they did with the Gutenberg plugin, this fixes that.

Trac ticket: https://core.trac.wordpress.org/ticket/54335

#39 @youknowriad
8 days ago

In 52347:

Themes: Auto-enable block-templates support for all block themes.

Block themes without theme.json file used to have block-templates support disabled.
This commit brings this in sync with the behavior in the gutenberg plugin.

See #54335.

#41 @noisysocks
4 days ago

In 52365:

Filter custom block templates with PHP

This method calls get_block_templates once and uses block template properties
directly for filtering. This way, we can avoid hitting the database for each
public post type.

The previous method is useful when we already know the current post type we
request templates for, like when using REST API.

Follows [52334].
See #54335.
Props mamaduka, youknowriad.

Note: See TracTickets for help on using tickets.