Commit 7dd2a0a
committed
chore(deps): bump maplibre-gl to 6.0.0
Clears blocker 2 of #1489 and carries the GeoLibre-side
migration. Blocker 1's two external packages are handled by a temporary shim
rather than being waited on, so the whole tree builds, tests, and runs on v6
today.
v6 is ESM-only with no default export and no CJS build.
**Blocker 2 — the frontend suite.** The plugin packages' `exports` maps are
correct; the problem was our own module scope. Every workspace package is
`"type": "module"`, but the root package.json is not, so tsx compiled all 256
test files to CJS, which selects the `require` condition and loads `.cjs`
entries that `require("maplibre-gl")`. `tests/package.json` puts them in ESM
scope, and the 29 ERR_PACKAGE_PATH_NOT_EXPORTED failures go to zero. This is a
swap, not an addition — v5 ships no ESM build, so it cannot land without the
bump.
**Blocker 1 — the two external packages.** `@esri/maplibre-arcgis` and
`@geoman-io/maplibre-geoman-free` still default-import maplibre-gl in their
published ESM. Both are rewritten to namespace imports at load: a Vite plugin
for the app build, a Node loader hook for `node --test` (Vite cannot reach the
test runner), and an `optimizeDeps.exclude` entry because the dependency
optimizer runs outside the plugin pipeline. The two lists are kept in step by
`tests/maplibre-shim-parity.test.ts`, and the Vite plugin errors if a package
stops matching, so a package that ships a fix cannot be silently shimmed
forever.
**The worker.** v6 ships its worker as a separate file located at runtime with
`new URL("./maplibre-gl-worker.mjs", import.meta.url)` — a computed string no
bundler can see. The asset was never emitted, and the URL resolved next to the
hashed app chunk, where the SPA fallback answered with index.html, so the
request hung instead of 404ing. Tile parsing was silently degraded: the same
25s window pulled 39 tiles before the fix and 68 after. Fixed by emitting the
worker through Vite and pointing `setWorkerUrl` at it.
Also:
- 30 files migrated to `import * as maplibregl from "maplibre-gl"`.
- Root `overrides` pin, because `@maplibre/maplibre-gl-directions` still peers
`^5.0.0` and would otherwise resolve a second hoisted copy, making `Map` a
different nominal type across package boundaries.
- `packages/map/src/dynamic-style-property.ts` holds the casts for property
names computed at runtime, now that set/getPaint/LayoutProperty are generic
over `keyof AllPaintProperties`.
- Geoman's `gm:*` events need a cast: `Map#on`/`off`'s catch-all overload
narrowed from `type: string` to `keyof MapEventType`.
- `GeoAgentSyncableTools`' map slice uses method syntax so a real `Map` still
satisfies it under `strictFunctionTypes`.
- GeolocateControl is constructed through a factory so tests can substitute a
fake — the sealed v6 namespace rejects assignment (same root cause as #1509).
- jsPDF is imported by name: its `node` export condition resolves a CJS bundle
whose default is the module object, which only surfaced once the tests moved
to ESM scope.
Verified: test:frontend 4236 passed / 0 failed, coverage 86.93/84.15/71.13,
tsc -b + vite build clean, lint 0 errors, test:worker clean. e2e 19/23 locally
with all four failures reproducing on this machine independent of the bump
(each passes in isolation). Dev server, production build, Geoman's toolbar and
the Esri package all verified in a browser.1 parent a3de391 commit 7dd2a0a
49 files changed
Lines changed: 405 additions & 133 deletions
File tree
- apps/geolibre-desktop
- src
- components
- layout
- panels
- storymap
- hooks
- lib
- assistant
- vite-plugins
- packages
- map
- src
- plugins
- src
- plugins
- tests
- hooks
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments