mapbox / mapbox/mapbox-gl-js

Include information about offending expression in runtime evaluation warnings

Open
#6,345 1 comment 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When evaluating an expression against data properties that don't match the expected type, we currently produce warnings like:

Expected value to be of type number, but found null instead

This provides developers no way to track down which particular expression (and which particular data property) the error came from. At the very least, we should probably include a serialized representation of the offending expression, but even better would be to also, when possible, specifically name the data property whose type was unexpected.

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

The issue names no files, tests, or entry points, so first locate the runtime expression evaluation code that emits the type-mismatch warning. Done means the warning identifies the offending expression and, when possible, the data property with the unexpected type.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.