Convert the How To block and the FAQ block to the Blocks V3 API#21329
Merged
Convert the How To block and the FAQ block to the Blocks V3 API#21329
Conversation
* Change enqueue method to newer `enqueue_block_assets`. This also affects the frontend, which we do not want, hence the `is_admin` check * Add styling dependencies on `dashicons` and `forms`, these are missing in the site editor: not sure if a WP components bug, but this solves it * Add fieldset (`.schema-how-to-duration`) styling (copied from WP common), removing the border around the duration
For the block registration, we need access to the `block.json` file. Therefore, we need to ensure the path is the same in development and production (zip). This commit solves that by effectively making the root blocks folder the "dist" or "build" folder for our block.json files. When bundling, any `block.json` files found (within our entry scripts) are copied over to the root blocks folder. Keeping the folder structure in place from `packages/js/src` onwards. When creating an artifact, the blocks root folder is copied to the artifact folder. Note: the webpack copy currently has no support for any CSS or JS alongside, but the artifact copy ignore extensions already.
* Using block.json file in both server and client side * Refactor `block.js` to use the `block.json` and add it as entry point for client side * Point to the `block.js` entry script in the server side block registration
18 tasks
Pull Request Test Coverage Report for Build 4211b05368a5e8b10057c8f6d470bae92d69d010Details
💛 - Coveralls |
Contributor
igorschoester
left a comment
There was a problem hiding this comment.
CR ❓
Detected a possible follow-up with the stylesheets and a minor fix/circumvention for the eslint-disable.
Member
|
Acc: ✅ |
This was referenced May 2, 2024
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Summary
This PR can be summarized in the following changelog entry:
\Yoast\WP\SEO\Integrations\Blocks\Structured_Data_Blocks::enqueue_block_editor_assets().Relevant technical choices:
structured-data-blocks.jsfile (used to register the blocks) is now unnecessary, so it's been deletedwpseo_enable_structured_data_blockshas been moved before the blocks registration, while the original method to enqueue the script and the style has been deprecated.context. This means that even if the strings are the same, existing translations won't be automatically used. In the RC time we'll check whether the translation memory sets the existing translations as suggestions for the new string+context pairs, so PTE will just need to approve them.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
New blocks
HowTosection with the info you added.FAQPagewithmainEntityset to theQuestionpiecesAnalysis check
Add a related keyphrase "pet food"from these instructionsComparison
Upgrading
Site editor
Language support
Also check #21369
Relevant test scenarios
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
UI changes
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
Innovation
innovationlabel.Fixes #