Script Modules: Allow scripts to depend on modules#10
Closed
Conversation
13417a6 to
f9c245c
Compare
This allows for script modules to be exposed in the import map regardless of being a dependency or enqueued. This will enable scripts to depend on script modules by requesting they be exposed.
f9c245c to
117fe60
Compare
gziolo
reviewed
Dec 16, 2024
| * | ||
| * @param string $id The identifier of the script module. | ||
| */ | ||
| public function expose( string $id ) { |
Collaborator
There was a problem hiding this comment.
This is a new concept in WordPress, so I wanted to share some alternatives to help find the final name:
add_to_import_mapinclude_in_import_map
Conceptually, the idea makes perfect sense to me. This method might also be useful when third-party code wants to ensure its dependency is listed in the import map, and they don't want to use all the tooling to generate dependencies for their script modules.
Owner
Author
|
Superseded by WordPress#8009. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Trac ticket:
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.