-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Script Loader: Bump fetchpriority for dependencies to be as high as recursive dependents for scripts and script modules
#9770
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
Closed
westonruter
wants to merge
22
commits into
WordPress:trunk
from
westonruter:add/dependent-fetchpriority-harmony
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ee14eb6
Script Modules: Bump fetchpriority for dependencies to be as high as …
westonruter 0222ca9
Add missing phpdoc param
westonruter e2d4676
Explicitly set a11y module to have fetchpriority=low
westonruter c76ceb0
Add support for fetchpriority bumping in WP_Scripts
westonruter e652cbd
Account for whether a dependent script is actually enqueued
westonruter 3dd0e0f
Add tests for complex dependency graphs
westonruter c59f440
Let fetchpriority of script module be determined be enqueued module
westonruter e453a53
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter 546e7a7
Stop iterating once highest priority found
westonruter a03337a
Simplify get_recursive_dependents() with better defensive coding
westonruter 0b0f328
Merge branch 'trunk' into add/dependent-fetchpriority-harmony
westonruter 334a82b
Better harmonize get_highest_fetchpriority implementations
westonruter cf809c8
Merge branch 'trunk' into add/dependent-fetchpriority-harmony
westonruter 3f5ae8d
Update _WP_Dependency::$ver to allow null in addition to string|false
westonruter 4dd633f
Account for directly printed scripts without enqueueing
westonruter 95789ba
Ensure fetchpriority is processed for scripts without extra key set
westonruter 86c13c9
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter 98abb51
Switch back to enqueue
westonruter eada641
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter 05e3173
Restore array_unique()
westonruter ed8a53f
Add test for wp_default_script_modules()
westonruter 9d021ae
Test that high priority dependent of default script modules causes de…
westonruter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add support for fetchpriority bumping in WP_Scripts
- Loading branch information
commit c76ceb09a87dfc0654e1874a53eec212699fe003
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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.
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.
This is the same functionality but implemented differently from in modules:
https://github.com/westonruter/wordpress-develop/blob/c59f440dfda0d1d23825e28e587bd5cfb15de45b/src/wp-includes/class-wp-script-modules.php#L296-L312
Notably, there the
array_searchhappens in the loop to get a numeric value for fetchpriority comparison.I'd like implementations to match.
There's also an opportunity to exit the loop as soon once a high priority is found (I commented similarly on the modules implementation).
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.
How about 334a82b?