Skip to content

[AssetMapper] Fixing import parsing from jsdelivr #51065

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

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

weaverryan
Copy link
Member

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets None - thanks to conversation with @bendavies on Slack!
License MIT
Doc PR n/a

Found with: https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/+esm

With the importmap:require --download option, we parse those import statements to discover which dependencies we also need to download. If a package required 2 imports and both do not have an @ in their name (i.e. a namespaced package), the regex matched both package strings as a single package - so it would see the package name as jquery@3.7.0/+esm";import e from"/npm/popper.js@1.16.1/+esm.

Cheers!

If a package imported 2x other packages, both where the package had no
namespace (i.e. no "@" in the name), the 2 packages would be matched as one incorrectly.
@bendavies
Copy link
Contributor

nice!

@nicolas-grekas
Copy link
Member

Thank you @weaverryan.

@nicolas-grekas nicolas-grekas merged commit 93f53fe into symfony:6.3 Jul 21, 2023
@weaverryan weaverryan deleted the asset-mapper-jsdelivr-regex branch July 21, 2023 17:52
@fabpot fabpot mentioned this pull request Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants