-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[AssetMapper] Using ?specifier=* does not match unstable packages on jsdelivr #52119
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
[AssetMapper] Using ?specifier=* does not match unstable packages on jsdelivr #52119
Conversation
@@ -32,9 +32,6 @@ final class JsDelivrEsmResolver implements PackageResolverInterface | |||
|
|||
public function __construct( | |||
HttpClientInterface $httpClient = null, | |||
private readonly string $versionUrlPattern = self::URL_PATTERN_VERSION, | |||
private readonly string $distUrlPattern = self::URL_PATTERN_DIST, | |||
private readonly string $distUrlCssPattern = self::URL_PATTERN_DIST_CSS |
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.
Unrelated: but it really doesn't make sense to have these URLs configurable. We are hitting very exact URLs.
f1b6ca8
to
4d6f72e
Compare
4d6f72e
to
370f6dc
Compare
Thank you @weaverryan. |
I put this in the PR, but it probably belongs here in the issue instead. Installing the bootstrap styling of datatables.net is failing for me. symfony new assetmapper-bug --webapp --version=next --php=8.2 && cd assetmapper-bug
composer config extra.symfony.allow-contrib true
composer req symfony/asset-mapper:^6.4
bin/console importmap:require datatables.net-bs5 |
I'm on it - thanks :) |
… import then export are adjacent (weaverryan) This PR was merged into the 6.4 branch. Discussion ---------- [AssetMapper] Fixing bug of bad parsing of imports when an import then export are adjacent | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | See #52119 (comment) though this appears to be unrelated to that PR | License | MIT There should be a finite number of import statement formats. `@tacman` found a new one! :) Cheers! Commits ------- e5bd7d0 [AssetMapper] Fixing bug of bad parsing of imports when an import then export are adjacent
To find which version of a package to grab, we use this API endpoint - https://data.jsdelivr.com/v1/packages/npm/@tabler/core/resolved. If a version constraint is specified (e.g.
importmap:require 'bootstrap@^5'
), we add a?specifier=5
. If no version is specified, previously we added?specifier=*
. However, this seems to ignore beta releases (returningnull
for@table/core
, whose only has a 1.0 beta). Omitting?specifier
seems to grab the latest, no matter what it is.Also, if for some reason, we still can't find a
version
, we know blow up with a much clearer exception.Cheers!