mapbox / mapbox/mapbox-gl-draw

featuresAt should not be exposed as is in MapboxDraw.lib

Open
#1,156 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In #1100, [`featuresAt`](https://github.com/mapbox/mapbox-gl-draw/blob/d7234ee463b9d0259a117a083fa946c2a284467e/src/lib/features_at.js) was exposed through [`MapboxDraw.lib`](https://github.com/mapbox/mapbox-gl-draw/blob/d7234ee463b9d0259a117a083fa946c2a284467e/src/lib/index.js#L30), but `featuresAt` functions get `ctx` as input, and `ctx` is an internal object. Either `featuresAt` should be removed from `lib`, or it should be exposed differently.

@joel-daros [encountered this](https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/64239#discussioncomment-4918380) while writing the typings for `lib`.

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 src/lib/features_at.js and the MapboxDraw.lib export in src/lib/index.js, then compare the public API concern with the linked DefinitelyTyped discussion. Decide how featuresAt should be represented without exposing the internal ctx object, and confirm that the resulting public surface and typings no longer require consumers to use ctx directly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Refactor
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.