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

Bump minimum required WP to 6.3 #7816

Merged
merged 65 commits into from
Jun 24, 2024
Merged

Bump minimum required WP to 6.3 #7816

merged 65 commits into from
Jun 24, 2024

Conversation

thelovekesh
Copy link
Collaborator

@thelovekesh thelovekesh commented Jun 6, 2024

Summary

  • Bump minimum required WordPress version to 6.3.
  • Update all NPM packages to the latest versions.
  • Remove legacy code used to maintain compatibility with WP < 6.3.
  • Add polyfill for new React JSX runtime. See https://make.wordpress.org/core/2024/06/06/jsx-in-wordpress-6-6/ and https://make.wordpress.org/core/2024/06/06/jsx-in-wordpress-6-6/#comment-46779.
  • Remove legacy classes like AMP_Block_Uniqid_Sanitizer, and BlockUniqidTransformer and their test case files.
  • Remove object and page caching site health tests. Also removed notice to purge page cache from assets/src/settings-page/settings-footer.js.
  • Remove the amp_page_cache_good_response_time_threshold filter which was deprecated in AMP 2.5.0 in favor of WP's site_status_good_response_time_threshold.
  • Convert SVG icons to React components using @wordpress/primitives.

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@thelovekesh thelovekesh marked this pull request as ready for review June 12, 2024 16:32
@thelovekesh thelovekesh changed the title Update NPM deps; Fix errors due to updated deps Bump minimum require WP to 6.3 Jun 12, 2024
@thelovekesh thelovekesh changed the title Bump minimum require WP to 6.3 Bump minimum required WP to 6.3 Jun 12, 2024
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 77.08%. Comparing base (22012c5) to head (a16b1dc).

Current head a16b1dc differs from pull request most recent head ac43705

Please upload reports for the commit ac43705 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #7816      +/-   ##
=============================================
- Coverage      77.21%   77.08%   -0.14%     
+ Complexity      6910     6777     -133     
=============================================
  Files            210      276      +66     
  Lines          21518    22303     +785     
=============================================
+ Hits           16616    17193     +577     
- Misses          4902     5110     +208     
Flag Coverage Δ
javascript 65.29% <89.28%> (?)
php 77.76% <75.00%> (+0.55%) ⬆️
unit 77.76% <75.00%> (+0.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
amp.php 0.00% <ø> (ø)
...validation/components/amp-document-status/index.js 94.73% <ø> (ø)
...s/amp-validation-status/revalidate-notification.js 90.90% <ø> (ø)
...nents/amp-validation-status/status-notification.js 95.00% <ø> (ø)
...block-validation/components/error/error-content.js 100.00% <ø> (ø)
...ock-validation/components/error/error-type-icon.js 100.00% <ø> (ø)
...sets/src/block-validation/components/icon/index.js 100.00% <ø> (ø)
includes/admin/class-amp-post-meta-box.php 90.17% <ø> (-0.09%) ⬇️
includes/admin/class-amp-template-customizer.php 95.50% <ø> (-0.02%) ⬇️
includes/amp-post-template-functions.php 100.00% <100.00%> (+2.43%) ⬆️
... and 18 more

... and 61 files with indirect coverage changes

Copy link
Contributor

github-actions bot commented Jun 12, 2024

Plugin builds for f508f83 are ready 🛎️!

Checksums
# Development build checksums
a9632cbfb85a7d813e0c783ba2af02586d7eb8937955a4604b71954bb3e91965 *amp.zip

# Production build checksums
fad6c24abb0990b4edd3b3b00655420501d35574b3ed1a4c26beb89f1936e9ab *amp.zip

Warning

These builds are for testing purposes only and should not be used in production.

Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

So much goodness! Just a few areas where I have questions.

README.md Outdated Show resolved Hide resolved
src/BackgroundTask/MonitorCssTransientCaching.php Outdated Show resolved Hide resolved
src/Admin/SupportLink.php Outdated Show resolved Hide resolved
src/BackgroundTask/MonitorCssTransientCaching.php Outdated Show resolved Hide resolved

/**
* The minimum version of WordPress supported.
*
* @var string
*/
const WP_MIN_VERSION = '5.6';
const WP_MIN_VERSION = '6.3';
Copy link
Member

Choose a reason for hiding this comment

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

Since the plugin as a whole requires WP 6.3 now, should the DependencySupport class just be removed entirely now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've been thinking about it, and this class helps us manage service initialization effectively, especially if we need to support any dependencies in the future. I believe we should keep it to maintain standardization and be prepared for any future needs.

) {
$this->enable_css_transient_caching();
}
$this->enable_css_transient_caching();
Copy link
Member

Choose a reason for hiding this comment

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

Since previously this was only called when updating from 1.5.0 or 1.5.1 or ir the block_uniq_transformer is relevant, then I wonder if this call is even relevant anymore? Should the entire handle_plugin_update be removed instead?

Comment on lines 389 to 401
// Replace `data-wp-on--click` or `data-wp-on-async--click` with AMP state on submenu open button.
if ( false !== strpos( $new_block_content, 'wp-block-navigation__responsive-container-open' ) ) {
$new_block_content = preg_replace(
'/\sdata-wp-on--click="[^"]+"/',
'/\sdata-wp-on-(?:-click|async--click)="[^"]+"/',
sprintf( ' on="tap:AMP.setState({ %1$s: !%1$s })"', esc_attr( $modal_state_property ) ),
$new_block_content
);
}

// Replace `data-wp-on--click` with AMP state on submenu close button.
// Replace `data-wp-on--click` or `data-wp-on-async--click` with AMP state on submenu close button.
if ( false !== strpos( $new_block_content, 'wp-block-navigation__responsive-container-close' ) ) {
$new_block_content = preg_replace(
'/\sdata-wp-on--click="[^"]+"/',
'/\sdata-wp-on-(?:-click|async--click)="[^"]+"/',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New changes in navigation block with interactivity API enabled.

@westonruter westonruter added this to the v2.5.4 milestone Jun 24, 2024
Co-authored-by: Weston Ruter <westonruter@google.com>
Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

Epic!

@thelovekesh
Copy link
Collaborator Author

@westonruter There is a flaky end-to-end test that we can ignore for now; I'll address it separately. Currently, there's an issue where the AMP preview button in the post editor is sometimes not visible when the editor is first opened. It becomes visible only when the editor is in an editable state, such as when someone clicks on it. I can replicate this on WordPress 6.5, but not on the trunk version.

return root.current
? createPortal(<AmpPreviewButton />, root.current)
: null;

@thelovekesh thelovekesh merged commit fa0a9f2 into develop Jun 24, 2024
35 of 37 checks passed
@thelovekesh thelovekesh deleted the update/wp-deps branch June 24, 2024 17:25
@pavanpatil1
Copy link

Verified it with WordPress v6.3,v6.5,v6.6RC2 and it is working fine. Checked the settings and related options those are working fine ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants