diff --git a/.eslintrc b/.eslintrc index 33183f43c81..e9e4b7b8166 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,7 +14,6 @@ ], "settings": { "import/ignore": [ - "@mapbox/gl-matrix", "@mapbox/shelf-pack", "@mapbox/whoots-js" ] diff --git a/build/rollup_plugins.js b/build/rollup_plugins.js index bd83ab47597..c91587ceede 100644 --- a/build/rollup_plugins.js +++ b/build/rollup_plugins.js @@ -30,7 +30,6 @@ export const plugins = () => [ }), commonjs({ namedExports: { - '@mapbox/gl-matrix': ['vec3', 'vec4', 'mat2', 'mat3', 'mat4'], '@mapbox/whoots-js': ['getTileBBox'] } }), diff --git a/package.json b/package.json index e5be3e4b917..e90e51aca8f 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "node": ">=6.4.0" }, "dependencies": { - "@mapbox/gl-matrix": "^0.0.1", "@mapbox/jsonlint-lines-primitives": "^2.0.1", "@mapbox/mapbox-gl-supported": "^1.3.1", "@mapbox/point-geometry": "^0.1.0", @@ -27,6 +26,7 @@ "earcut": "^2.1.3", "geojson-rewind": "^0.3.0", "geojson-vt": "^3.1.2", + "gl-matrix": "^2.6.1", "gray-matter": "^3.0.8", "grid-index": "^1.0.0", "minimist": "0.0.8", diff --git a/src/geo/transform.js b/src/geo/transform.js index b25b5277181..5346f11402c 100644 --- a/src/geo/transform.js +++ b/src/geo/transform.js @@ -9,11 +9,7 @@ import {number as interpolate} from '../style-spec/util/interpolate'; import tileCover from '../util/tile_cover'; import { CanonicalTileID, UnwrappedTileID } from '../source/tile_id'; import EXTENT from '../data/extent'; -import glmatrix from '@mapbox/gl-matrix'; - -const vec4 = glmatrix.vec4, - mat4 = glmatrix.mat4, - mat2 = glmatrix.mat2; +import { vec4, mat4, mat2 } from '@mapbox/gl-matrix'; /** * A single transform, generally used for a single tile to be diff --git a/src/render/draw_debug.js b/src/render/draw_debug.js index 8c64df02438..cf75441a33c 100644 --- a/src/render/draw_debug.js +++ b/src/render/draw_debug.js @@ -2,7 +2,7 @@ import browser from '../util/browser'; -import { mat4 } from '@mapbox/gl-matrix'; +import { mat4 } from 'gl-matrix'; import EXTENT from '../data/extent'; import VertexArrayObject from './vertex_array_object'; import { PosArray } from '../data/array_types'; diff --git a/src/render/draw_fill_extrusion.js b/src/render/draw_fill_extrusion.js index 977eff7fcd9..a5b47939cae 100644 --- a/src/render/draw_fill_extrusion.js +++ b/src/render/draw_fill_extrusion.js @@ -1,6 +1,6 @@ // @flow -import glMatrix from '@mapbox/gl-matrix'; +import { mat3, mat4, vec3 } from 'gl-matrix'; import { isPatternMissing, @@ -10,9 +10,6 @@ import { import Texture from './texture'; import Color from '../style-spec/util/color'; import DepthMode from '../gl/depth_mode'; -const mat3 = glMatrix.mat3; -const mat4 = glMatrix.mat4; -const vec3 = glMatrix.vec3; import StencilMode from '../gl/stencil_mode'; import type Painter from './painter'; diff --git a/src/render/draw_heatmap.js b/src/render/draw_heatmap.js index cb902029142..0b95f92b9e1 100644 --- a/src/render/draw_heatmap.js +++ b/src/render/draw_heatmap.js @@ -1,6 +1,6 @@ // @flow -import { mat4 } from '@mapbox/gl-matrix'; +import { mat4 } from 'gl-matrix'; import Texture from './texture'; import pixelsToTileUnits from '../source/pixels_to_tile_units'; diff --git a/src/render/draw_hillshade.js b/src/render/draw_hillshade.js index 4a51cc06b73..683158e4c9a 100644 --- a/src/render/draw_hillshade.js +++ b/src/render/draw_hillshade.js @@ -3,7 +3,7 @@ import Coordinate from '../geo/coordinate'; import Texture from './texture'; import EXTENT from '../data/extent'; -import { mat4 } from '@mapbox/gl-matrix'; +import { mat4 } from 'gl-matrix'; import StencilMode from '../gl/stencil_mode'; import DepthMode from '../gl/depth_mode'; diff --git a/src/render/draw_symbol.js b/src/render/draw_symbol.js index 7445e7a9391..f731d5298b2 100644 --- a/src/render/draw_symbol.js +++ b/src/render/draw_symbol.js @@ -5,7 +5,7 @@ import drawCollisionDebug from './draw_collision_debug'; import pixelsToTileUnits from '../source/pixels_to_tile_units'; import * as symbolProjection from '../symbol/projection'; import * as symbolSize from '../symbol/symbol_size'; -import { mat4 } from '@mapbox/gl-matrix'; +import { mat4 } from 'gl-matrix'; const identityMat4 = mat4.identity(new Float32Array(16)); import properties from '../style/style_layer/symbol_style_layer_properties'; const symbolLayoutProperties = properties.layout; diff --git a/src/render/painter.js b/src/render/painter.js index 0873be7beef..459491b6775 100644 --- a/src/render/painter.js +++ b/src/render/painter.js @@ -2,7 +2,7 @@ import browser from '../util/browser'; -import { mat4 } from '@mapbox/gl-matrix'; +import { mat4 } from 'gl-matrix'; import SourceCache from '../source/source_cache'; import EXTENT from '../data/extent'; import pixelsToTileUnits from '../source/pixels_to_tile_units'; diff --git a/src/style/style_layer/circle_style_layer.js b/src/style/style_layer/circle_style_layer.js index d868a30ac4c..36cc1b401e8 100644 --- a/src/style/style_layer/circle_style_layer.js +++ b/src/style/style_layer/circle_style_layer.js @@ -7,7 +7,7 @@ import { multiPolygonIntersectsBufferedPoint } from '../../util/intersection_tes import { getMaximumPaintValue, translateDistance, translate } from '../query_utils'; import properties from './circle_style_layer_properties'; import { Transitionable, Transitioning, PossiblyEvaluated } from '../properties'; -import {vec4} from '@mapbox/gl-matrix'; +import { vec4 } from 'gl-matrix'; import Point from '@mapbox/point-geometry'; import type { FeatureState } from '../../style-spec/expression'; diff --git a/src/symbol/collision_index.js b/src/symbol/collision_index.js index 3b8d1fc44d8..7e85a680815 100644 --- a/src/symbol/collision_index.js +++ b/src/symbol/collision_index.js @@ -4,9 +4,7 @@ import Point from '@mapbox/point-geometry'; import * as intersectionTests from '../util/intersection_tests'; import Grid from './grid_index'; -import glmatrix from '@mapbox/gl-matrix'; - -const mat4 = glmatrix.mat4; +import { mat4 } from 'gl-matrix'; import * as projection from '../symbol/projection'; diff --git a/src/symbol/placement.js b/src/symbol/placement.js index c0e798c3af2..da0454c8531 100644 --- a/src/symbol/placement.js +++ b/src/symbol/placement.js @@ -14,7 +14,7 @@ import type Transform from '../geo/transform'; import type StyleLayer from '../style/style_layer'; import type Tile from '../source/tile'; import type SymbolBucket from '../data/bucket/symbol_bucket'; -import type mat4 from '@mapbox/gl-matrix'; +import type {mat4} from 'gl-matrix'; import type {CollisionBoxArray, CollisionVertexArray} from '../data/array_types'; import type FeatureIndex from '../data/feature_index'; import type {OverscaledTileID} from '../source/tile_id'; diff --git a/src/symbol/projection.js b/src/symbol/projection.js index a00b045ebd1..d565b1ff025 100644 --- a/src/symbol/projection.js +++ b/src/symbol/projection.js @@ -2,7 +2,7 @@ import Point from '@mapbox/point-geometry'; -import { mat4, vec4 } from '@mapbox/gl-matrix'; +import { mat4, vec4 } from 'gl-matrix'; import * as symbolSize from './symbol_size'; import { addDynamicAttributes } from '../data/bucket/symbol_bucket'; import properties from '../style/style_layer/symbol_style_layer_properties'; diff --git a/yarn.lock b/yarn.lock index 59f2d2f6531..e021ae17e26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -97,10 +97,6 @@ dependencies: wgs84 "0.0.0" -"@mapbox/gl-matrix@^0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@mapbox/gl-matrix/-/gl-matrix-0.0.1.tgz#e5126aab4d64c36b81c7a97d0ae0dddde5773d2b" - "@mapbox/jsonlint-lines-primitives@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.1.tgz#bc4c1593e2ec2371e2771c518068d6eab8eeae58" @@ -4460,6 +4456,10 @@ github-slugger@1.2.0, github-slugger@^1.0.0, github-slugger@^1.1.1: dependencies: emoji-regex ">=6.0.0 <=6.1.1" +gl-matrix@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-2.6.1.tgz#1bc7f7b396f4ae80abdb4db9a98cd07d170b9004" + gl@^4.0.1: version "4.0.4" resolved "https://registry.yarnpkg.com/gl/-/gl-4.0.4.tgz#46745f365a230672b2f988d85018f737e64c3343"