refactor: Register jetpack-connection scripts absolutely#42468
refactor: Register jetpack-connection scripts absolutely#42468
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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! 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. |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
e83a397 to
6634899
Compare
sergeymitr
left a comment
There was a problem hiding this comment.
Works well, thanks for taking care of that.
Reverts: - #39604 - #39870 Conditional registration was added to address *perceived* performance issues, rather than *actual* performance issues. While enqueueing assets comes at a network cost, registration should not, in theory, incur such cost. Registration is light-weight operation. Conditionally registered assets are problematic as they are difficult to query globally. If an asset is conditionally registered within a specific context, it will be unavailable outside of that context. E.g., a REST API endpoint is unable to query an asset conditionally registered with WP Admin.
6634899 to
78cbdb6
Compare
Proposed changes:
Revert #39604.
Conditional registration was added to address perceived performance
issues, rather than actual performance issues. The changes were made
to reduce the total number of Jetpack hooks and associated functions.
While unnecessarily enqueueing assets comes at a network cost,
registration should not, in theory, incur such a cost. Registration is a
light-weight operation.
Conditionally registered assets are problematic as they are difficult to
query globally. If an asset is conditionally registered within a
specific context, it will be unavailable outside of that context. E.g.,
a REST API endpoint is unable to query an asset conditionally registered
within WP Admin.
Other information:
Jetpack product discussion
N/A, none available.
Does this pull request change what data or activity we track or use?
No
Testing instructions:
Perform the testing outlined in the following relevant PRs: