Skip to content

Update maplibre-gl to 6.x - #61

Merged
trasher merged 1 commit into
developfrom
feature/maplibre-gl-6
Sep 3, 2026
Merged

Update maplibre-gl to 6.x#61
trasher merged 1 commit into
developfrom
feature/maplibre-gl-6

Conversation

@trasher

@trasher trasher commented Sep 3, 2026

Copy link
Copy Markdown
Member

Following #55

maplibre-gl ships ES modules only since 6.0, with no UMD build left to concatenate, so the GL bundle is rolled up by esbuild instead. It still exposes the maplibregl global, and Leaflet is aliased to the instance the page already loaded rather than embedded a second time.

The tile parsing worker can no longer be inlined; it is built beside the bundle as maps-gl.worker.min.js, and the bundle points maplibre at it from its own script URL, so no template has to know where plugin resources are served from.

Also, keep the bundler sources out of released archives

maplibre-gl ships ES modules only since 6.0, with no UMD build left to
concatenate, so the GL bundle is rolled up by esbuild instead. It still
exposes the `maplibregl` global, and Leaflet is aliased to the instance
the page already loaded rather than embedded a second time.

The tile parsing worker can no longer be inlined; it is built beside the
bundle as maps-gl.worker.min.js, and the bundle points maplibre at it
from its own script URL, so no template has to know where plugin
resources are served from.

Keep the bundler sources out of released archives
@trasher
trasher requested a review from gagnieray September 3, 2026 06:43

@gagnieray gagnieray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So esbuild is a more performant alternative to webpack 👍

The goal is therefore to use ESM modules without modifying the existing standard JS code.

At first glance, everything seems logical and correct to me.
In any case, it does the job well and works properly 😃

(Additional remark regarding JS management in Galette after digging into this PR: it would be really great to find a way to remove all the JS code from the twig templates and let the controllers load only the JS files they need, rather than concatenating everything into large JS bundles. Easier said than done, of course 😅)

@trasher

trasher commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

At first glance, everything seems logical and correct to me. In any case, it does the job well and works properly 😃

That was my point too :)

(Additional remark regarding JS management in Galette after digging into this PR: it would be really great to find a way to remove all the JS code from the twig templates and let the controllers load only the JS files they need, rather than concatenating everything into large JS bundles. Easier said than done, of course 😅)

Yes... We probably should talk about that, and what would be possible - to be honest I almost have no idea what would be the better approach.

@trasher
trasher merged commit 082aa41 into develop Sep 3, 2026
13 checks passed
@trasher
trasher deleted the feature/maplibre-gl-6 branch September 3, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants