-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add support for printing script modules in footer #9867
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
b1ink0
wants to merge
52
commits into
WordPress:trunk
from
b1ink0:enhancement/63486-script-modules-footer-support
+989
−204
Closed
Changes from 34 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
b64aab8
Enhancement: Add 'in_footer' argument to script module functions for …
b1ink0 1caf38a
Split printing into head/footer passes with printed script module tra…
b1ink0 4115360
Skip printing script modules in head if dependencies are set to print…
b1ink0 05584fc
Sort script module identifiers by dependencies before printing
b1ink0 ac4973c
Fix failing tests caused by tracking of printed script modules
b1ink0 040c249
Fix PHPCS warnings
b1ink0 e55cf3e
Improve documentation and add type hints
b1ink0 c794fad
Consolidate multi-line assignment to single expression
b1ink0 acaeceb
Use Reflection API to access done property in tests
b1ink0 8bc8f69
Remove unnecessary checks for `done` array
b1ink0 43bb39b
Add tests for head/footer placement and dependency ordering
b1ink0 377989d
Fix formatting by removing trailing comma
b1ink0 09897f5
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
b1ink0 8dfc49a
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter 45a40a3
Simplify script module printing methods
b1ink0 c8ccf33
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter 5aef0c7
Move done member up next to queue member
westonruter 3e96498
Address majority of PHPStan level 10 issues in class-wp-script-module…
westonruter 9915940
Remove unused get_marked_for_enqueue() method
westonruter 858ef91
Further refine types
westonruter 4203864
Allow empty src for script module for the sake of Tests_Blocks_Regist…
westonruter 8c71e84
Use more specific types
westonruter e60e4fa
Re-work get_dependencies() to return an array of script module IDs
westonruter dbdd3a1
Account for empty src for script module
westonruter 78c7e7a
Simplify get_recursive_dependents() to remove closure
westonruter 40e1260
Refactor get_sorted_dependencies() to eliminate closure
westonruter aeb22f0
Add missing '>'
westonruter 9ba920a
Use get_sorted_dependencies() when printing preloads and only for sta…
westonruter 60fd75f
Reduce nesting in print_script_module_preloads()
westonruter 2438a12
Disregard the done array when getting sorted item dependencies
westonruter 6b62d90
Remove the need for set_printed_script_modules() in test
westonruter 1bba6a3
Ensure core script modules and iAPI script modules are printed in foo…
westonruter 2c35487
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter 2a695c5
Add test case for static dependency on dynamic which depends on anoth…
westonruter 47a0013
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter b652fdd
Extract repeated wp_is_block_theme() calls into variable
westonruter de83bd2
Restore $position variable containing action name
westonruter 379cba0
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter 7c2e9c5
Remove PHPStan annotations
westonruter b1b7043
Add tests for enqueue and register with empty string for ID
westonruter 58044f1
Improve empty src handling in get_src() and add test
westonruter 0c46399
Merge branch 'trunk' into enhancement/63486-script-modules-footer-sup…
westonruter 49c3d5b
Add missing WP_Script_Modules::set_in_footer() method
westonruter 2950c7d
Add ticket references
westonruter 4459c6f
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter cde9ccf
Replace non-empty-string with string to amend 7c2e9c5ff3
westonruter 04ec8ac
Restore private get_marked_for_enqueue() method since used via Reflec…
westonruter 4fc5e27
Fix phpcs
westonruter bf733b2
Make note that in_footer only applies to block themes
westonruter 922dcf0
Remove redundant array_unique()
westonruter d91f8c3
Remove another redundant array_unique()
westonruter c0179e6
Use multi-line comment
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
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
Oops, something went wrong.
Oops, something went wrong.
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 key change that is done en lieu of
in_footerbeing set viablocks.jsonper Core-54018.