-
Notifications
You must be signed in to change notification settings - Fork 794
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
Refactor production blocks registration 4 #33667
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
c0f755f
to
ab580cc
Compare
const FEATURE_NAME = 'pinterest'; | ||
const BLOCK_NAME = 'jetpack/' . FEATURE_NAME; | ||
const URL_PATTERN = '#^https?://(?:www\.)?(?:[a-z]{2}\.)?pinterest\.[a-z.]+/pin/(?P<pin_id>[^/]+)/?#i'; // Taken from AMP plugin, originally from Jetpack. | ||
const URL_PATTERN = '#^https?://(?:www\.)?(?:[a-z]{2}\.)?pinterest\.[a-z.]+/pin/(?P<pin_id>[^/]+)/?#i'; // Taken from AMP plugin, originally from Jetpack. |
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.
Is it the same as URL_REGEX
in constants
? Could it be reused?
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.
Oh, or it's the one below
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.
Would this be a rebase issue with #33604? The Payments button is modified there.
@@ -69,7 +69,7 @@ const PodcastPlayerEdit = ( { | |||
replaceWithEmbedBlock, | |||
} ) => { | |||
// Validated attributes. | |||
const validatedAttributes = getValidatedAttributes( attributesValidation, attributes ); | |||
const validatedAttributes = getValidatedAttributes( metadata.attributes, attributes ); |
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.
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 believe this may be causing a notice:
Warning: Undefined array key "ratingStyle" in /wp-content/plugins/jetpack-dev/extensions/blocks/rating-star/rating-meta.php on line 123
@@ -65,5 +65,5 @@ | |||
"type": "string" | |||
} | |||
}, | |||
"editorScript": "file:../editor.js" | |||
"parent": [ "jetpack/payment-buttons" ] |
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.
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.
ab580cc
to
2bf0f75
Compare
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.
Looks like the tests in extensions/blocks/rating-star/test/validate.js
will need to be updated?
a4d1be2
to
4d6da24
Compare
4d6da24
to
f9834de
Compare
This reverts commit 4329dd4.
Proposed changes:
Registers the following production blocks by specifying the path to their block.json file: Paywall, Pinterest, Podcast Player, Rating Star, Recurring Payments.
This was made possible by #32697. The goal is to avoid the duplication of block metadata and use block.json as the source of truth.
In more details, for each block (when needed):
editorScript
property fromblock.json
(automatically added during the build)icon
property ofblock.json
icon.js
shared-extension-utils
packageblock.json
index.js
toblock.json
andeditor.js
and delete the fileattributes.js
toblock.json
and delete the fileOther information:
Jetpack product discussion
pedMtX-RS-p2
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
trunk
. This PR shouldn't change anything from a user's standpoint. You'll need to activate subscriptions to test the Paywall block.Note: I couldn't test the Recurring Payments block.