ci: test MapLibre v4/v5 and export GlobeControl - #2600
Merged
Conversation
…hr/test-maplibre-v4-v5
chrisgervang
commented
Jul 28, 2026
| ({mapLib}) => { | ||
| const GlobeControl = mapLib.GlobeControl; | ||
| if (!GlobeControl) { | ||
| throw new Error('GlobeControl is not supported by this version of MapLibre GL JS'); |
Contributor
Author
There was a problem hiding this comment.
GlobeControl exists only in MapLibre v5+
chrisgervang
commented
Jul 28, 2026
| TerrainControl as TerrainControlInstance, | ||
| LogoControl as LogoControlInstance, | ||
| LogoControlOptions, | ||
| GlobeControl as GlobeControlInstance, |
Contributor
Author
There was a problem hiding this comment.
Building against v4 produced three TypeScript errors: these two GlobeControl exports don't exist, and one incompatible MapLib assignment. The fix preserves v4 support while making GlobeControl explicitly optional and unavailable at runtime on versions that don’t provide it.
Wdyt, @Pessimistress? This was previously undetected since we don't run CI on v4 anymore
chrisgervang
commented
Jul 28, 2026
| ): null | string[] { | ||
| const missingExports: string[] = []; | ||
| for (const key of Components) { | ||
| if (!legacyComponents[key]) { |
Contributor
Author
There was a problem hiding this comment.
this seems to be an old typo. the module param was not used. Also expanded this to cover Maplibre-specific components
Pessimistress
approved these changes
Jul 28, 2026
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.
Adds a non-fail-fast CI matrix for MapLibre
^4.0.0and^5.0.0, with Coveralls uploading only from v5. Makes GlobeControl typing version-aware so v4 remains supported, exports GlobeControl and its props publicly, and documents its v5+ requirement. Adds an export regression test and corrects the helper so it checks each endpoint. Validated build, lint, and node tests against MapLibre 4.7.1 and 5.0.1.Fixes #2592
Note
Low Risk
Changes are CI matrix expansion, public exports, optional typing, and test fixes—no auth, security, or core map runtime behavior beyond explicit GlobeControl version checks.
Overview
CI now runs lint and tests against MapLibre
^4.0.0and^5.0.0in a non-fail-fast matrix; Coveralls uploads only from the v5 job, and a gate job fails the workflow if any matrix leg fails.GlobeControl is exported from the public MapLibre entry (component +
GlobeControlProps), with docs noting maplibre-gl v5+. Types treatGlobeControlonMapLibas optional and defineGlobeControlInstanceconditionally so v4 consumers still compile; runtime throws a clear error if the control class is missing.Export regression tests now check each endpoint against the right component list (including Terrain, Logo, and Globe for MapLibre), and the helper compares the passed module instead of always using legacy exports.
Reviewed by Cursor Bugbot for commit 4363759. Bugbot is set up for automated code reviews on this repo. Configure here.