-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Allow classic scripts to depend on modules #8024
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
sirreal
wants to merge
59
commits into
WordPress:trunk
from
sirreal:scripts/allow-script-module-dependency
+597
−162
Closed
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
39a11a8
Add "expose" logic to script modules
sirreal 65fd1df
Make get_src return nullable
sirreal 843e1e0
Rework, rename, add tests
sirreal 2e180cf
Remove uniqueness checks
sirreal 7fc42d2
Replace excessively prescriptive comment
sirreal 5144a90
Add test for correct merge with regular dependencies
sirreal d83ea4b
Fix overwriting array keys
sirreal 9125683
Working proposal with caveats
sirreal 5ddc2dd
Revert preveious approach at module dependencies
sirreal 9e976bb
Inspect wp_scripts and extract module deps from scripts on the page
sirreal 591e3b5
Fix regression printing enqueued modules in importmap
sirreal d1d8c43
Check for WP_Scripts instance
sirreal 10c3a02
Fix possible unset module id in script modules
sirreal a444ffa
Fix lint
sirreal b0f579b
Update and improve tests with classic scripts
sirreal 8366f45
Improve variable name and array push of many values
sirreal 45cacbb
Remove a loop from importmap checking
sirreal 14ae089
Merge branch 'trunk' into scripts/allow-script-module-dependency
sirreal 6122621
Merge trunk into scripts/allow-script-module-dependency
westonruter b77dbc7
Remove merge conflict markers
westonruter 1d12174
Fix test_included_module_appears_in_importmap
westonruter 64e67b8
Fix test_included_modules_concat_with_enqueued_dependencies
westonruter fda5f17
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter f2f72a6
Pass module dependencies via args insead of deps
westonruter d926e8f
Ensure module_dependencies is an array before iterating over
westonruter 1a1df99
Optimize classic script module dependency resolution
westonruter 6b56f5f
Improve variable naming, add comment, and add phpdoc
westonruter cf8f813
Restore WP_Script_Modules::get_src() only returning string
westonruter 34867df
Warn when script is enqueued with missing script module dependency
westonruter babe954
Use array_pop() instead of array_shift() to avoid re-indexing
westonruter b450826
Validate module_dependencies in WP_Scripts::add_data()
westonruter 269c4c7
Validate extra args in wp_register_script() and wp_enqueue_script()
westonruter 3c2c84b
Refactor wp_register_script() and wp_enqueue_script() to avoid code d…
westonruter 354f42d
Standardize wp_scripts global handling in script module tests
westonruter ae642f4
Use PHP 7.4 class member types
westonruter 8a782ac
Fix variable alignment
westonruter 6a3141a
Use globals consistently
westonruter 07ab8d6
Add descriptions to script module dependency tests
westonruter 907cb0d
Refactor and simplify script module dependency tests
westonruter 23e2a33
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter 7f53642
Add comment explaining why a classic script with a missing dynamic sc…
westonruter 7ddcdd7
Improve phrasing
westonruter 0cb95e0
Improve param default value description
westonruter ce5124f
Avoid calling _wp_scripts_add_args_data() with empty args
westonruter 083287a
Use WP_Scripts::add_data() instead of WP_Scripts::add() for _doing_it…
westonruter 9acd7f0
Update test_wp_scripts_doing_it_wrong_for_missing_script_module_depen…
westonruter a97279c
Merge branch 'trunk' into scripts/allow-script-module-dependency
sirreal 2f95af0
Merge branch 'trunk' into scripts/allow-script-module-dependency
sirreal 681472c
Improve specificity of $deps param
westonruter c82565c
Allow passing script modules as arrays for module_dependencies
westonruter bf143fc
fixup! Allow passing script modules as arrays for module_dependencies
westonruter 23fc17d
fixup! Allow passing script modules as arrays for module_dependencies
westonruter 9924b07
Add tests for passing array module specifiers
westonruter 6b29352
Improve variable name
westonruter e1ad3c7
Update tear_down logic order
westonruter 12adf99
Merge branch 'trunk' into scripts/allow-script-module-dependency
westonruter 2b3ddf8
Script Loader: Remove $function_name argument from _wp_scripts_add_ar…
westonruter 8ff8e43
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develo…
westonruter 3a67800
List the supported keys after the unrecognized keys in the notice
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
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.
Uh oh!
There was an error while loading. Please reload this page.