Upgrade to maplibre 6.0#820
Open
digitaltom wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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-geocoderESM build. - Update Rails asset handling for
.mjs(Sprockets MIME registration) and loosen CSP to allowblob:images. - Update JS imports and MapLibre hooks (namespace import for
maplibre-gl, switch tosetMissingStyleImageResolver).
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.