Skip to content
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

Seedlet Blocks: Remove theme attributes from block templates #3045

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

jeyip
Copy link
Contributor

@jeyip jeyip commented Jan 15, 2021

Changes proposed in this Pull Request:

Remove theme attributes from seedlet blocks block templates

Context:

This PR was created as a follow-up to WordPress/gutenberg#28088. See the aforementioned PR description and code changes for more context.

Discussion:

  1. What this means for theme designers is that, when creating block templates, the theme attribute can be omitted from serialized wp_template_part blocks (like we've done in this PR). The logic for the Gutenberg full site editor will automatically add a theme attribute that matches the current, activated theme's stylesheet.
  2. New sites created for full site editing will not load template parts correctly until Template Parts: Fix loading issue WordPress/gutenberg#28088 and Avoid using auto-drafts for theme templates and template parts WordPress/gutenberg#27910 are added to a release, but to be fair, template parts are already broken on new FSE sites Site Editor: template parts not loading on Horizon wp-calypso#48145.

Testing:

  • Apply this PR
  • Run Gutenberg locally (see instructions here)
  • Install the seedlet-blocks theme by referencing it in .wp-env.override.json
      // .wp-env.override.json
    
      // Replace ~/work/theme-experiments/seedlet-blocks with 
      // the path to your locally installed seedlet-blocks theme
      {
           "mappings": {
               "wp-content/themes/seedlet-blocks": "~/work/themes/seedlet-blocks",
           }
      }```
  • npx wp-env start --update
  • Activate the seedlet-blocks theme
  • Open the front end and the site editor. FSE templates and template parts should load without issue.
  • Reinstall the seedlet-blocks theme in a subdirectory by modifying .wp-env.override.json
       // .wp-env.override.json
      
       // Add a test subdirectory in the mapping
       {
            "mappings": {
                "wp-content/themes/test/seedlet-blocks": "~/work/themes/seedlet-blocks",
            }
       }```
  • npx wp-env start --update
  • Activate seedlet-blocks.
  • Open the front end and the site editor. FSE templates and template parts should still load without issue.

Related issue(s):

Automattic/wp-calypso#48145

@jeyip jeyip self-assigned this Jan 15, 2021
@jeyip jeyip marked this pull request as ready for review January 16, 2021 00:38
Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! ✅

I just holding approval until I know themes folk get a chance to see this new format so we are all on the same page. 😁

@pbking
Copy link
Contributor

pbking commented Jan 21, 2021

Looks fine to me. Along with WordPress/theme-experiments#172 I advise against merging until the version of Gutenberg with WordPress/gutenberg#28088 ships.

@jeyip
Copy link
Contributor Author

jeyip commented Jan 21, 2021

This makes sense to me 👍 We can revisit this once Gutenberg v9.9 is released

Copy link
Member

@vindl vindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :shipit:

@jeyip
Copy link
Contributor Author

jeyip commented Jan 27, 2021

Quick update:
The Gutenberg v9.9 release is being pushed back to align with the release of WordPress v5.7 beta 1. Both are slated for release on February 2nd.

@jeyip
Copy link
Contributor Author

jeyip commented Feb 4, 2021

Merging this because the v9.9rc is available on Gutenberg edge sites now

@jeyip jeyip merged commit e9408a1 into trunk Feb 5, 2021
@jeyip jeyip deleted the update/block-template-theme-attributes branch February 5, 2021 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants