Repository navigation
WP Build Polyfills: describe the WordPress 7.0 floor in comments - #52503
Merged
Merged
Conversation
Several comments still argued from a WordPress 6.9 floor. At 7.0 only wp-private-apis and wp-rich-text replace Core's copies; Core already registers wp-theme, boot, route and a11y, and allowlists @wordpress/theme. Restate each rationale against 7.0, and correct two claims about registration: wp_default_scripts can fire twice, and $hooked is also set on the synchronous path. Comment-only. The README also gets Core's wp_default_scripts priority right (the default 10, not 0) and lists the widget-primitives module. Fixes JETPACK-2684 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Contributor
|
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 4 files.
|
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.
Fixes JETPACK-2684
Proposed changes
Comments and docs only. No behaviour change.
Every project now requires WordPress 7.0 (
MIN_WP_VERSIONin.github/versions.sh,JETPACK__MINIMUM_WP_VERSION), but comments acrosswp-build-polyfillsstill argued from a 6.9 floor, and several reached conclusions the code no longer does. Each rewritten claim was checked against the WordPress 7.0 tag source.wp-private-apisandwp-rich-textreplace Core's copies. Every other polyfill fills a gap in Core, or replaces a Gutenberg copy too old to use.SCRIPT_DEPENDENCIES: 7.0's private-apis allowlist omits@wordpress/viewsand@wordpress/compose. It does allow@wordpress/theme, and 7.0 registerswp-themeitself.$hooked: it means registration has run or been hooked, not "the hook has been added", which is false on the synchronous path.wp_default_scripts"fires once": it fires whenwp_scripts()creates the singleton, and again oninitif that happened earlier.wp-notices,wp-private-apisandwp-rich-textnow state the 7.0 facts.class-wp-build-admin-frame.php,webpack.config.js,bin/stamp-textdomains-lib.js,src/js/load-i18n-catalogs.ts, the rich-text private-APIs JS test, and one PHP test comment.wp_default_scriptscallback runs at the default priority 10, not 0. The module table now lists@wordpress/widget-primitives, the one module that can replace an older Gutenberg's copy instead of being ignored as a duplicate.One correction to the issue's own premise:
wp-viewsis not a no-op at 7.0. Core 7.0 doesn't register it, so the polyfill fills it in.Deliberately left alone:
register()'s docblock line "the highest threshold wins", which became true with #52470.Related product discussion/links
class-settings.php, the AI Hub page, Forms, mu-wpcom). They are not part of this PR.Does this pull request change what data or activity we track or use?
No.
Testing instructions
jp test php packages/wp-build-polyfillsandjp test js packages/wp-build-polyfills. Results should be unchanged.wp-includes/default-filters.php:wp_default_scriptsis added with no priority, so it runs at 10.wp-includes/class-wp-scripts.php: the constructor runsinit()and also hooks it toinitat priority 0.wp-includes/js/dist/private-apis.js: the allowlist includes@wordpress/themeand@wordpress/ui, but not@wordpress/viewsor@wordpress/compose.🤖 Generated with Claude Code