mapbox / mapbox/mapbox-gl-js

Remove ["properties"] expression

Open
#6,291 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api :memo: breaking change :warning: cross-platform :tv:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

The existence of the ["properties"] expression means that the Feature interface we use must provide access to a full map of a feature's properties, rather than just a getPropertyValue(key). This could be a deceptively costly operation. Removing this expression would let us to narrow the feature interface and avoid an unnecessary trap for expression authors. Are there any use cases that can only be served by a ["properties"] expression (instead of just ["get", key] and ["has", key])?

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

Start by tracing the ["properties"] expression and the Feature interface to identify any use cases that cannot be handled by ["get", key] or ["has", key]. Review the four existing comments for decisions or constraints, then consider the work complete only when supported use cases are resolved and the interface can be narrowed without breaking them.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.