-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add support for Speculative Loading WP Core API, loading the plugin's own API implementation conditionally #1883
base: trunk
Are you sure you want to change the base?
Conversation
… on API implementation conditionally while maintaining compatibility on plugin-specific filters.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Yedfree. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
* | ||
* @since 1.0.0 | ||
*/ | ||
function plsr_print_speculation_rules(): void { |
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.
Note for reviewers: This function was moved without any changes to the plugin-api.php
file.
/** | ||
* @covers ::plsr_print_speculation_rules | ||
*/ | ||
public function test_plsr_print_speculation_rules_without_html5_support(): void { |
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.
Note for reviewers: These tests for the plsr_print_speculation_rules()
function were moved to test-speculation-rules-plugin-api.php
without any changes.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #1883 +/- ##
==========================================
+ Coverage 66.70% 66.79% +0.08%
==========================================
Files 88 89 +1
Lines 7029 7044 +15
==========================================
+ Hits 4689 4705 +16
+ Misses 2340 2339 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
These changes look good to me.
Summary
Following the WordPress Core merge of speculative loading last week, this PR ensures the Speculative Loading plugin uses the WP Core API when available, and only loads its own API implementation if not.
Relevant technical choices
PLSR_URL_Pattern_Prefixer
class), and only add the relevant hooks.The fact that WP Core
trunk
tests pass with this is a good indicator this works as expected. Also check in the PHPUnit test run usingtrunk
on GitHub Actions that for Speculative Loading (50 tests) it makes 1 assertion more than for the other WordPress versions (104 instead of 103) because of the one additional hook checked.