Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move local type definitions out of flow-typed #7031

Merged
merged 5 commits into from
Jul 31, 2018
Merged

Conversation

anandthakker
Copy link
Contributor

Prepares for #6963

@anandthakker anandthakker requested a review from jfirebaugh July 26, 2018 16:00
@anandthakker
Copy link
Contributor Author

anandthakker commented Jul 26, 2018

Note also that I replaced our GeoJSON declarations with https://github.com/bigslycat/flow-geojson, which seems like a pretty well-written set of Flow types for GeoJSON -- this was primarily motivated by wanting vector-tile module and gl-js to reference a common set of type definitions.

@jfirebaugh
Copy link
Contributor

jfirebaugh commented Jul 26, 2018

Eh, I'm not a fan of those GeoJSON definitions. They're much more complicated than is necessary, and there are at least a couple of issues (feature geometry should be nullable, JSONArray type is wrong).

Edit: also properties should not be nullable.

@anandthakker
Copy link
Contributor Author

Dang, I missed those. Alright, alternative: we could keep the ones we had and publish them as a separate npm pacakge @mapbox/geojson-types

@anandthakker
Copy link
Contributor Author

Edit: also properties should not be nullable

@jfirebaugh looks like the spec allows null for properties:

 A Feature object has a member with the name "properties".  The
 value of the properties member is an object (any JSON object or a
 JSON null value).

https://tools.ietf.org/html/rfc7946#section-3.2

Anand Thakker added 3 commits July 30, 2018 15:48
Remaining declarations in flow-typed/ are exclusively for external
dependencies
@anandthakker anandthakker force-pushed the localize-flow-types branch from 519c780 to 33b3d62 Compare July 30, 2018 19:49
@anandthakker
Copy link
Contributor Author

@jfirebaugh updated

@@ -1,4 +1,6 @@
import type Pbf from 'pbf';
import type Point from '@mapbox/point-geometry';
import type { Feature } from 'flow-geojson';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch to @mapbox/geojson-types.

package.json Outdated
@@ -63,6 +64,7 @@
"execcommand-copy": "^1.1.0",
"flow-bin": "^0.69.0",
"flow-coverage-report": "^0.3.0",
"flow-geojson": "^2.0.6",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

@@ -13,6 +13,8 @@ import type Dispatcher from '../util/dispatcher';
import type Tile from './tile';
import type {Callback} from '../types/callback';
import type {PerformanceResourceTiming} from '../types/performance_resource_timing';
import type {GeoJSON, GeoJSONFeature} from '@mapbox/geojson-types';
import type {GeojsonSourceSpecification} from '../style-spec/types';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's special-case the generator so "GeoJSON" is capitalized consistently. (Looks like it already has a special-case for "DEM".)

@anandthakker anandthakker merged commit 5b9986d into master Jul 31, 2018
@anandthakker anandthakker deleted the localize-flow-types branch July 31, 2018 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants