Make Expressions fully deserializable
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, `CompoundExpression#_evaluate` doesn't survive serialization/deserialization via our web worker transfer scheme: https://github.com/mapbox/mapbox-gl-js/blob/f87d7e3401af5902a1d9e6ded2600aa21e4c633f/src/util/web_worker_transfer.js#L101
This was fine until now, because we only evaluate a `{Source,Composite}Binder`'s expression on the worker side, during `populatePaintArray` https://github.com/mapbox/mapbox-gl-js/blob/f87d7e3401af5902a1d9e6ded2600aa21e4c633f/src/data/program_configuration.js#L139
For https://github.com/mapbox/mapbox-gl-js/issues/6020, however, we'll need to evaluate again on the main thread when making updates, and so we should refactor `CompoundExpression` so that it can be fully rehydrated on the main thread.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the web worker transfer scheme in src/util/web_worker_transfer.js and the expression evaluation path in src/data/program_configuration.js, especially populatePaintArray. Trace how CompoundExpression#_evaluate is transferred and identify what must remain available after deserialization. Done means CompoundExpression can be fully rehydrated on the main thread for the update flow described in issue #6020.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100