mapbox / mapbox/mapbox-gl-js

Strip Expression#serialize from minified build

Open
#9,356 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Methods for serializing individual expression classes such as `Match#serialize` are only used for testing (see #6469 where they were introduced). We could strip them during minification like we do with `Debug.*` and `PerformanceUtils.*` methods — should give us ~700 bytes gzipped for free. cc @arindam1993

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 Expression#serialize and the minification handling already used for Debug.* and PerformanceUtils.* methods. Review issue #6469 for the testing rationale, then verify that the serialize methods are absent from the minified build and that the reported gzip size reduction is achieved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 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.