Skip to content

Plugin downloads use core Alpine version, causing 404s / mismatches #2

Description

@elabx

cc @markusthomas

In AlpineJS::downloadAlpineFiles($version), plugin downloads reuse the core Alpine version:

foreach (self::$pluginsList as $name => $filename) {
    $url = "https://unpkg.com/@alpinejs/{$name}@{$version}/dist/{$filename}";
    ...
}

Alpine plugins are versioned independently on npm — @alpinejs/mask, @alpinejs/persist, etc. each have their own release cadence. Reusing the core version will often:

  • 404 when no plugin release exists at that version
  • Pull a mismatched version when one happens to exist but isn't actually paired with that core release

Failures are silently logged as warnings via $this->warning(), so users won't necessarily notice their plugins didn't download.

Proposed fix

Resolve each plugin's latest version individually via the npm registry, similar to how getRemoteVersion() already works for core:

https://registry.npmjs.org/@alpinejs/{name}/latest

Then download from unpkg.com/@alpinejs/{name}@{resolved_version}/dist/cdn.min.js.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions