Skip to content

Upgrade to maplibre 6.0#820

Open
digitaltom wants to merge 4 commits into
mainfrom
maplibre6
Open

Upgrade to maplibre 6.0#820
digitaltom wants to merge 4 commits into
mainfrom
maplibre6

Conversation

@digitaltom

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 23, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the app’s MapLibre integration to MapLibre GL JS 6.0, updating vendored ESM assets and adapting the app code/config to MapLibre 6’s module/worker and missing-image APIs.

Changes:

  • Vendor MapLibre 6 worker chunk (maplibre-gl-worker.mjs) and switch to the official @maplibre/maplibre-gl-geocoder ESM build.
  • Update Rails asset handling for .mjs (Sprockets MIME registration) and loosen CSP to allow blob: images.
  • Update JS imports and MapLibre hooks (namespace import for maplibre-gl, switch to setMissingStyleImageResolver).

Reviewed changes

Copilot reviewed 8 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vendor/javascript/maplibre-gl-worker.mjs Adds the MapLibre 6 split-out worker module needed by the new ESM build.
vendor/javascript/maplibre-gl-geocoder.js Removes the previously vendored geocoder bundle in favor of the scoped package build.
vendor/javascript/@maplibre--maplibre-gl-geocoder.js Adds vendored @maplibre/maplibre-gl-geocoder ESM distribution.
vendor/javascript/@maplibre--maplibre-gl-directions.js Updates vendored directions file header comment for provenance/version.
config/initializers/mime_types.rb Ensures Sprockets serves .mjs with the correct JavaScript MIME type.
config/initializers/content_security_policy.rb Allows blob: in img-src to support MapLibre-related runtime URLs.
config/importmap.rb Updates pins/comments for MapLibre 6 and switches geocoder pin to scoped package file.
app/javascript/maplibre/styles/styles.js Updates missing-image loader callback signature and related caching keys.
app/javascript/maplibre/map.js Uses MapLibre 6 API (setMissingStyleImageResolver) and switches to namespace import.
app/javascript/maplibre/controls/shared.js Switches geocoder import to scoped package and simplifies proximity config.
app/javascript/maplibre/controls/geolocate.js Switches MapLibre import to namespace form compatible with ESM build.
app/javascript/deck.js Switches MapLibre import to namespace form compatible with ESM build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants