From 42d2a030844fd506a0582d4daa0657aa1953f91d Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Mon, 6 May 2024 14:56:43 +0800 Subject: [PATCH] viewer: bump MapLibre version to 4.x (#241) * viewer: bump MapLibre version to 4.x * fix types --- app/package-lock.json | 73 ++++++++++++++++++-------------- app/package.json | 2 +- app/src/MapViewComponent.tsx | 1 - app/src/VisualTestsComponent.tsx | 1 - 4 files changed, 42 insertions(+), 35 deletions(-) diff --git a/app/package-lock.json b/app/package-lock.json index d66b8918..4f307c5b 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -8,7 +8,7 @@ "name": "protomaps-basemaps-app", "version": "0.0.0", "dependencies": { - "maplibre-gl": "^3.4.1", + "maplibre-gl": "^4.1.3", "ol": "^8.1.0", "ol-mapbox-style": "^12.0.0", "ol-pmtiles": "^0.2.0", @@ -1065,13 +1065,13 @@ } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "19.3.2", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.2.tgz", - "integrity": "sha512-C2JAk64XUz9v78+bpyTk1zvgjjnDsB8CCjNumyAYdWK2dvdDtILzh1AGBMdS/llX3KaHjGYxAE5wOwfdwq4Pog==", + "version": "20.1.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.1.1.tgz", + "integrity": "sha512-z85ARNPCBI2Cs5cPOS3DSbraTN+ue8zrcYVoSWBuNrD/mA+2SKAJ+hIzI22uN7gac6jBMnCdpPKRxS/V0KSZVQ==", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", - "json-stringify-pretty-compact": "^3.0.0", + "json-stringify-pretty-compact": "^4.0.0", "minimist": "^1.2.8", "rw": "^1.3.3", "sort-object": "^3.0.3" @@ -1114,9 +1114,17 @@ } }, "node_modules/@types/geojson": { - "version": "7946.0.11", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz", - "integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==" + "version": "7946.0.14", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", + "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" + }, + "node_modules/@types/geojson-vt": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz", + "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==", + "dependencies": { + "@types/geojson": "*" + } }, "node_modules/@types/leaflet": { "version": "1.9.8", @@ -1127,14 +1135,14 @@ } }, "node_modules/@types/mapbox__point-geometry": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.2.tgz", - "integrity": "sha512-D0lgCq+3VWV85ey1MZVkE8ZveyuvW5VAfuahVTQRpXFQTxw03SuIf1/K4UQ87MMIXVKzpFjXFiFMZzLj2kU+iA==" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", + "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==" }, "node_modules/@types/mapbox__vector-tile": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.1.tgz", - "integrity": "sha512-RpwGE57xM4a/YCH6XWzfcPVRPAu/jiCll0bEGRn6a4iubN2k4xZizskQoRj8fuXyo9BpI7F3bwz3uxs0pWbGNw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", + "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", "dependencies": { "@types/geojson": "*", "@types/mapbox__point-geometry": "*", @@ -1148,9 +1156,9 @@ "dev": true }, "node_modules/@types/pbf": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.3.tgz", - "integrity": "sha512-hw6bDMjvm+QTvEC+pRLpnTknQXoPu8Fnf+A+zX9HB7j/7RfYajFSbdukabo3adPwvvEHhIMafQl0R0Tpej7clQ==" + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", + "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==" }, "node_modules/@types/prop-types": { "version": "15.7.5", @@ -1185,9 +1193,9 @@ "dev": true }, "node_modules/@types/supercluster": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.1.tgz", - "integrity": "sha512-dNK02GO1UApgo+1KpY4jOfm3uWb2eBCMB/VMM2y8cMoF49FiqVVcOawEg19wxYcaX7SvEs370incOuFtFGrVLg==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", + "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", "dependencies": { "@types/geojson": "*" } @@ -1847,9 +1855,9 @@ } }, "node_modules/json-stringify-pretty-compact": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz", - "integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", + "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==" }, "node_modules/json5": { "version": "2.2.3", @@ -1946,9 +1954,9 @@ "integrity": "sha512-f+NBjJJY4T3dHtlEz1wCG7YFlkODEjFIYlxDdLIDMNpkSksqTt+l/d4rjuwItxuzkuMFvPyrjzV2lxRM4ePcIA==" }, "node_modules/maplibre-gl": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.4.1.tgz", - "integrity": "sha512-RPcdaiZ52G3X+PaHQxqQ1d4I8iTIPRl4OXhPU/3o37kDf+ImLXpUVZj4p0qBCGm71n79daVzaCMG9QxfSSQbnQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.1.3.tgz", + "integrity": "sha512-nMy5h0kzq9Z66C6AIb3p2BvLIVHz75dGGQow22x+h9/VOihr0IPQI26ylAi6lHqvEy2VqjiRmKAMlFwt0xFKfQ==", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", @@ -1957,12 +1965,13 @@ "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^19.3.2", - "@types/geojson": "^7946.0.11", - "@types/mapbox__point-geometry": "^0.1.2", - "@types/mapbox__vector-tile": "^1.3.1", - "@types/pbf": "^3.0.3", - "@types/supercluster": "^7.1.1", + "@maplibre/maplibre-gl-style-spec": "^20.1.1", + "@types/geojson": "^7946.0.14", + "@types/geojson-vt": "3.2.5", + "@types/mapbox__point-geometry": "^0.1.4", + "@types/mapbox__vector-tile": "^1.3.4", + "@types/pbf": "^3.0.5", + "@types/supercluster": "^7.1.3", "earcut": "^2.2.4", "geojson-vt": "^3.2.1", "gl-matrix": "^3.4.3", diff --git a/app/package.json b/app/package.json index 82a105ee..8dfab240 100644 --- a/app/package.json +++ b/app/package.json @@ -11,7 +11,7 @@ "check": "biome check src test --javascript-formatter-indent-style=space --json-formatter-indent-style=space" }, "dependencies": { - "maplibre-gl": "^3.4.1", + "maplibre-gl": "^4.1.3", "ol": "^8.1.0", "ol-mapbox-style": "^12.0.0", "ol-pmtiles": "^0.2.0", diff --git a/app/src/MapViewComponent.tsx b/app/src/MapViewComponent.tsx index 31fd2cf5..ec6fa8b8 100644 --- a/app/src/MapViewComponent.tsx +++ b/app/src/MapViewComponent.tsx @@ -163,7 +163,6 @@ function MapLibreView(props: { if (maplibregl.getRTLTextPluginStatus() === "unavailable") { maplibregl.setRTLTextPlugin( "https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js", - () => {}, true, ); } diff --git a/app/src/VisualTestsComponent.tsx b/app/src/VisualTestsComponent.tsx index d8684326..af804143 100644 --- a/app/src/VisualTestsComponent.tsx +++ b/app/src/VisualTestsComponent.tsx @@ -214,7 +214,6 @@ export default function VisualTestsComponent() { if (maplibregl.getRTLTextPluginStatus() === "unavailable") { maplibregl.setRTLTextPlugin( "https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js", - () => {}, false, // we need to pre-load this, otherwise diffs will be flaky ); }