mapbox / mapbox/mapbox-gl-js

De-duplicate array enums for symbol layer properties when parsing the style

Open
#8,445 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api :memo: refactoring :building_construction:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Moved from https://github.com/mapbox/mapbox-gl-js/pull/8399#discussion_r299234134

`text-variable-anchor` values are not currently de-duped.
In #8399, `text-writing-mode` values are de-duped for every bucket.

The array of values for `text-variable-anchor` and `text-writing-mode` should be de-duplicated as part of parsing the style. This would do it just once, allow better style diffing, and reduce per-bucket work.

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 locating the style-parsing entry point that handles the text-variable-anchor and text-writing-mode properties, then compare where each array is currently de-duplicated. The work is done when both arrays are de-duplicated during style parsing rather than per bucket, with style diffing and bucket processing reflecting the parsed values.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.