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.
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
Script Modules API: Backport - Add import map polyfill #5947
Script Modules API: Backport - Add import map polyfill #5947
Changes from all commits
feee589
63f7021
4156afc
d7bca4b
ff4ce0d
c0381d2
90be4f9
ba6ea74
e046610
f648520
45987c3
82121a0
fcb8f74
dc78385
5c0cc0e
d4b232f
21a3bbe
cad52d7
35d249e
f76f80f
ea3ab1f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Sharing notes on this change that I co-authored with @c4rl0sbr4v0.
First, a minor change. We use
RegExp.test()
instead ofString.match()
. We don't care about the result of matching, we want to know "does this match," soRegExp.test()
(with its boolean result) is ideal.Second, and more important. The expression was not specific enough and was matching JavaScript source files that were, themselves, looking for sourcemap comments. In this PR is was matching this line from es-module-shims:
We change to better match a source map comment by anchoring the expression to the start of the line and matching the comment opening
//#
. This fixes the false positives and allows us to remove several files from the ignore list.Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
What would be the case when
$wp_scripts
is not set? I'm asking because I don't see it guarded anywhere else in the codebase?I see some
! empty( $wp_scripts )
checks.