Skip to content

Commit

Permalink
Merge 2dc150b into 03ee7be
Browse files Browse the repository at this point in the history
  • Loading branch information
ajduberstein committed Nov 12, 2019
2 parents 03ee7be + 2dc150b commit 144d8c8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions dev-docs/RFCs/vNext/json-converter-keyword-handling-rfc.md
@@ -0,0 +1,29 @@
# RFC: Syntactic sugar for @deck.gl/json

* **Authors**: Andrew Duberstein (@ajduberstein)
* **Date**: October 10, 2019
* **Status**: Draft


## Overview

This is a proposal for adding syntactic sugar to the @deck.gl/json expression parser which will let the user distinguish
between the keyword `type` and a string named `type`.


## Motivation

The keyword `type` occurs as a field name in many data sets, and is also of course a Javascript keyword.
Users may want `type` to be interpreted as one or the other but currently can't specify which.

The GeoJSON standard includes type in the top-level JSON, so most GeoJSON data sets break when ingested by the deck.gl/json API.

## Prior Art

We should likely avoid conflicting with [JSON pointer syntax](https://www.baeldung.com/json-pointer) and JSON Paths. It seems like `_`, `__`, and `@@` would be acceptable characters. We are already using `__` in deck.gl to represent internal fields, so it seems like the least ambiguity comes from use of `@@`.

## Proposal

deck.gl/json will use `@@type` to indicate the Javascript `type` keyword.

Additionally, add a syntax for expressions, e.g, `@@=` prefix: `@@=[lng, lat]`, so that we didn't need to know any information about prop types to deduce which strings to parse as expressions.

0 comments on commit 144d8c8

Please sign in to comment.