mapbox / mapbox/mapbox-gl-draw

Eliminate dependence on Map#fire – breaking change in mapbox-gl-js

Open
#766 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug refactor
Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
8d 9h
Merged PRs (30d)
5

Description

mapbox-gl-js recently changed the function signature for `fire`, so our most recent beta release (https://github.com/mapbox/mapbox-gl-js/pull/6549) breaks compatibility with this library. see change log here https://github.com/mapbox/mapbox-gl-js/releases/tag/v0.45.0-beta.1

mapbox-gl-draw shouldn't be relying on `Map#fire` because it is not a public method, but if that is impossible, another option would be to call `fire` with an object that has a `type` attribute `{type: 'error', message: 'somethingbad', //... rest of the payload properties }`. We may also consider making the `Event` class public so third party libraries like this can use that constructor.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review mapbox-gl-draw's uses of Map#fire alongside the mapbox-gl-js v0.45.0-beta.1 signature change described in the issue. Determine whether the dependency can be removed or whether the event-object alternative is required, then verify compatibility with the affected beta release.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.