diff --git a/@here/harp-datasource-protocol/lib/ThreeBufferUtils.ts b/@here/harp-datasource-protocol/lib/ThreeBufferUtils.ts index 0f0f94ded2..5e114a2ca4 100644 --- a/@here/harp-datasource-protocol/lib/ThreeBufferUtils.ts +++ b/@here/harp-datasource-protocol/lib/ThreeBufferUtils.ts @@ -7,8 +7,7 @@ import { BufferAttribute as ThreeBufferAttribute, BufferGeometry as ThreeBufferGeometry, - InterleavedBufferAttribute as ThreeInterleavedBufferAttribute, - TypedArray + InterleavedBufferAttribute as ThreeInterleavedBufferAttribute } from "three"; import { @@ -26,7 +25,7 @@ import { * See also [[CustomDatasourceExample]]. */ export namespace ThreeBufferUtils { - export function getBufferElementType(buffer: TypedArray): BufferElementType { + export function getBufferElementType(buffer: ArrayBufferView): BufferElementType { if (buffer instanceof Int8Array) { return "int8"; } else if (buffer instanceof Uint8Array) { @@ -49,7 +48,7 @@ export namespace ThreeBufferUtils { export function fromThreeBufferAttribute( bufferAttribute: ThreeBufferAttribute ): BufferAttribute { - const buffer = (bufferAttribute.array as any) as TypedArray; + const buffer = (bufferAttribute.array as any) as ArrayBufferView; return { name: bufferAttribute.name, buffer: buffer.buffer, diff --git a/@here/harp-datasource-protocol/package.json b/@here/harp-datasource-protocol/package.json index c88e628b6f..876a15efe4 100644 --- a/@here/harp-datasource-protocol/package.json +++ b/@here/harp-datasource-protocol/package.json @@ -33,16 +33,17 @@ "@here/harp-test-utils": "^0.23.0", "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "ts-json-schema-generator": "^0.68.1", "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-debug-datasource/package.json b/@here/harp-debug-datasource/package.json index e56c367d52..481e5bcaa5 100644 --- a/@here/harp-debug-datasource/package.json +++ b/@here/harp-debug-datasource/package.json @@ -33,6 +33,7 @@ "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", @@ -40,7 +41,7 @@ "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-examples/package.json b/@here/harp-examples/package.json index 991d41d427..1e1afc49e6 100644 --- a/@here/harp-examples/package.json +++ b/@here/harp-examples/package.json @@ -43,6 +43,7 @@ "@here/harp-webtile-datasource": "^0.23.0", "@types/dat.gui": "^0.7.1", "@types/long": "^4.0.1", + "@types/three": "^0.126.0", "copy-webpack-plugin": "^7.0.0", "cross-env": "^7.0.2", "css-loader": "^5.0.1", @@ -53,7 +54,7 @@ "stats.js": "^0.17.0", "style-loader": "^2.0.0", "suncalc": "^1.8.0", - "three": "^0.125.0", + "three": "^0.126.0", "ts-loader": "^8.0.7", "typescript": "^4.1.2", "webpack": "^5.12.3", diff --git a/@here/harp-features-datasource/package.json b/@here/harp-features-datasource/package.json index 449889e8ab..d0bc3dfd7c 100644 --- a/@here/harp-features-datasource/package.json +++ b/@here/harp-features-datasource/package.json @@ -29,6 +29,7 @@ "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", @@ -37,7 +38,7 @@ "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-geojson-datasource/package.json b/@here/harp-geojson-datasource/package.json index 118e1ff7b4..34b3e62ed7 100644 --- a/@here/harp-geojson-datasource/package.json +++ b/@here/harp-geojson-datasource/package.json @@ -32,12 +32,13 @@ "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", "sinon": "^9.2.2", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "typescript": "^4.1.2" }, "publishConfig": { diff --git a/@here/harp-geometry/package.json b/@here/harp-geometry/package.json index 6cfea7bd01..7601c5d8aa 100644 --- a/@here/harp-geometry/package.json +++ b/@here/harp-geometry/package.json @@ -28,17 +28,18 @@ "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", "@types/sinon": "^9.0.10", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "earcut": "^2.2.2", "mocha": "^8.2.1", "sinon": "^9.2.2", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "dependencies": { "@here/harp-geoutils": "^0.23.0", diff --git a/@here/harp-geoutils/package.json b/@here/harp-geoutils/package.json index 08a330c5c3..4d0607b9b5 100644 --- a/@here/harp-geoutils/package.json +++ b/@here/harp-geoutils/package.json @@ -23,16 +23,17 @@ "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", "@types/sinon": "^9.0.10", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", "sinon": "^9.2.2", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-lines/package.json b/@here/harp-lines/package.json index 6d4e6d2792..31c93ad55c 100644 --- a/@here/harp-lines/package.json +++ b/@here/harp-lines/package.json @@ -32,15 +32,16 @@ "@here/harp-utils": "^0.23.0", "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-map-controls/package.json b/@here/harp-map-controls/package.json index 6531db245f..c65251d3d7 100644 --- a/@here/harp-map-controls/package.json +++ b/@here/harp-map-controls/package.json @@ -33,16 +33,17 @@ "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", "@types/sinon": "^9.0.10", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", "sinon": "^9.2.2", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-mapview/lib/DecodedTileHelpers.ts b/@here/harp-mapview/lib/DecodedTileHelpers.ts index 34b1340787..86ae5a1ae0 100644 --- a/@here/harp-mapview/lib/DecodedTileHelpers.ts +++ b/@here/harp-mapview/lib/DecodedTileHelpers.ts @@ -128,7 +128,7 @@ export function createMaterial( } if (isExtrudedPolygonTechnique(technique)) { - material.flatShading = true; + (material as MapMeshStandardMaterial).flatShading = true; } material.depthTest = isExtrudedPolygonTechnique(technique) && technique.depthTest !== false; @@ -838,7 +838,7 @@ function getBaseColorPropName(technique: Technique): string | undefined { function getTextureBuffer( buffer: ArrayBuffer, textureDataType: THREE.TextureDataType | undefined -): THREE.TypedArray { +): BufferSource { if (textureDataType === undefined) { return new Uint8Array(buffer); } diff --git a/@here/harp-mapview/lib/TileObjectsRenderer.ts b/@here/harp-mapview/lib/TileObjectsRenderer.ts index f75933c697..43b4756e91 100644 --- a/@here/harp-mapview/lib/TileObjectsRenderer.ts +++ b/@here/harp-mapview/lib/TileObjectsRenderer.ts @@ -11,7 +11,6 @@ import { MapEnv, Pickability } from "@here/harp-datasource-protocol"; -import { Object3D, Vector3 } from "three"; import { BackgroundDataSource } from "./BackgroundDataSource"; import { SolidLineMesh } from "./geometry/SolidLineMesh"; @@ -44,8 +43,8 @@ export class TileObjectRenderer { tile: Tile, storageLevel: number, zoomLevel: number, - cameraPosition: Vector3, - rootNode: Object3D + cameraPosition: THREE.Vector3, + rootNode: THREE.Object3D ) { const worldOffsetX = tile.computeWorldOffsetX(); if (tile.willRender(storageLevel)) { @@ -157,7 +156,9 @@ export class TileObjectRenderer { return stableSort(a, b); }; - this.m_renderer.setOpaqueSort(painterSortStable); + // Temporary workaround due to incorrect comparator type definition: + // https://github.com/three-types/three-ts-types/issues/41 + this.m_renderer.setOpaqueSort((painterSortStable as any) as () => void); } private updateStencilRef(object: TileObject) { diff --git a/@here/harp-mapview/package.json b/@here/harp-mapview/package.json index 5b7a321d6b..90fe5ce331 100644 --- a/@here/harp-mapview/package.json +++ b/@here/harp-mapview/package.json @@ -51,6 +51,7 @@ "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", "@types/sinon": "^9.0.10", + "@types/three": "^0.126.0", "chai": "^4.0.2", "chai-as-promised": "^7.1.1", "copyfiles": "^2.2.0", @@ -58,11 +59,11 @@ "mocha": "^8.2.1", "sinon": "^9.2.2", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-materials/lib/MapMeshMaterials.ts b/@here/harp-materials/lib/MapMeshMaterials.ts index a2fd0b2a1d..206710093b 100644 --- a/@here/harp-materials/lib/MapMeshMaterials.ts +++ b/@here/harp-materials/lib/MapMeshMaterials.ts @@ -1114,7 +1114,6 @@ export class MapMeshDepthMaterial extends THREE.MeshDepthMaterial implements Ext // outputs of the vertex shader not used in the pixel shader, the properties in question // are `vExtrusionRatio` and `vExtrusionAxis`. this.applyExtrusionParameters({ ...params, zFightingWorkaround: false }); - this.flatShading = false; } // Only here to make the compiler happy, these methods will be overriden: The actual diff --git a/@here/harp-materials/package.json b/@here/harp-materials/package.json index 09efbaf1e3..9870fc4179 100644 --- a/@here/harp-materials/package.json +++ b/@here/harp-materials/package.json @@ -26,15 +26,16 @@ "devDependencies": { "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-omv-datasource/package.json b/@here/harp-omv-datasource/package.json index 768af12647..0b561d1a05 100644 --- a/@here/harp-omv-datasource/package.json +++ b/@here/harp-omv-datasource/package.json @@ -38,6 +38,7 @@ "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", "@types/sinon": "^9.0.10", + "@types/three": "^0.126.0", "chai": "^4.0.2", "copyfiles": "^2.2.0", "cross-env": "^7.0.2", @@ -47,7 +48,7 @@ "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-test-utils/package.json b/@here/harp-test-utils/package.json index 988df4be0e..5ca4bfdc7e 100644 --- a/@here/harp-test-utils/package.json +++ b/@here/harp-test-utils/package.json @@ -28,7 +28,7 @@ "glob": "^7.1.3", "pixelmatch": "^5.2.0", "sinon": "^9.2.2", - "three": "^0.125.0", + "three": "^0.126.0", "ua-parser-js": "^0.7.21", "xml2js": "^0.4.23" }, @@ -42,6 +42,7 @@ "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", "@types/serve-static": "^1.13.4", + "@types/three": "^0.126.0", "body-parser": "^1.18.3", "cross-env": "^7.0.2", "express": "^4.17.1", diff --git a/@here/harp-text-canvas/package.json b/@here/harp-text-canvas/package.json index 3c5b1908c8..504cd6144d 100644 --- a/@here/harp-text-canvas/package.json +++ b/@here/harp-text-canvas/package.json @@ -28,17 +28,18 @@ "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", + "@types/three": "^0.126.0", "chai": "^4.0.2", "cross-env": "^7.0.2", "mocha": "^8.2.1", "sinon": "^9.2.2", "source-map-support": "^0.5.19", - "three": "^0.125.0", + "three": "^0.126.0", "ts-node": "^9.1.1", "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-vectortile-datasource/package.json b/@here/harp-vectortile-datasource/package.json index bd83e52b77..860aec528c 100644 --- a/@here/harp-vectortile-datasource/package.json +++ b/@here/harp-vectortile-datasource/package.json @@ -52,6 +52,7 @@ "@types/mocha": "^8.2.0", "@types/node": "^14.0.5", "@types/sinon": "^9.0.10", + "@types/three": "^0.126.0", "chai": "^4.0.2", "copyfiles": "^2.2.0", "cross-env": "^7.0.2", @@ -61,7 +62,7 @@ "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp-webtile-datasource/package.json b/@here/harp-webtile-datasource/package.json index 85233e7fff..a4a70b8797 100644 --- a/@here/harp-webtile-datasource/package.json +++ b/@here/harp-webtile-datasource/package.json @@ -33,6 +33,7 @@ "devDependencies": { "@types/chai": "^4.2.14", "@types/mocha": "^8.2.0", + "@types/three": "^0.126.0", "chai": "^4.0.2", "copyfiles": "^2.2.0", "cross-env": "^7.0.2", @@ -41,7 +42,7 @@ "typescript": "^4.1.2" }, "peerDependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "publishConfig": { "access": "public" diff --git a/@here/harp.gl/package.json b/@here/harp.gl/package.json index 39f86ba0cb..4e2bf07769 100644 --- a/@here/harp.gl/package.json +++ b/@here/harp.gl/package.json @@ -31,7 +31,7 @@ }, "license": "Apache-2.0", "dependencies": { - "three": "^0.125.0" + "three": "^0.126.0" }, "devDependencies": { "@here/harp-datasource-protocol": "^0.23.0", @@ -53,6 +53,7 @@ "@here/harp-vectortile-datasource": "^0.23.0", "@here/harp-webtile-datasource": "^0.23.0", "@microsoft/api-extractor": "^7.8.10", + "@types/three": "^0.126.0", "ts-loader": "^8.0.7", "typescript": "^4.1.2", "webpack": "^5.12.3", diff --git a/package.json b/package.json index a887a4b2c3..1718f1b2eb 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@types/glob": "^7.1.3", "@types/semver": "^7.3.4", "@types/stats.js": "^0.17.0", + "@types/three": "^0.126.0", "@typescript-eslint/eslint-plugin": "^4.11.1", "@typescript-eslint/parser": "^4.11.1", "chai": "^4.2.0", @@ -48,7 +49,7 @@ "nyc": "^15.0.1", "prettier": "^2.2.1", "semver": "^7.3.2", - "three": "^0.125.0", + "three": "^0.126.0", "ts-mocha": "^8.0.0", "typedoc": "^0.17.7", "typescript": "^4.1.2", diff --git a/test/performance/package.json b/test/performance/package.json index 6481af7f58..73e8c18f25 100644 --- a/test/performance/package.json +++ b/test/performance/package.json @@ -15,8 +15,9 @@ "@here/harp-test-utils": "^0.23.0", "@here/harp-vectortile-datasource": "^0.23.0", "@types/chai": "^4.2.14", + "@types/three": "^0.126.0", "chai": "^4.2.0", - "three": "^0.125.0" + "three": "^0.126.0" }, "license": "Apache-2.0" } diff --git a/test/rendering/package.json b/test/rendering/package.json index 6b5e8436d8..4ef45bcdc3 100644 --- a/test/rendering/package.json +++ b/test/rendering/package.json @@ -18,8 +18,9 @@ "@here/harp-utils": "^0.23.0", "@here/harp-vectortile-datasource": "^0.23.0", "@types/chai": "^4.2.14", + "@types/three": "^0.126.0", "chai": "^4.2.0", - "three": "^0.125.0" + "three": "^0.126.0" }, "license": "Apache-2.0" } diff --git a/www/package.json b/www/package.json index 73c4b48e84..5e4a96da7e 100644 --- a/www/package.json +++ b/www/package.json @@ -29,7 +29,7 @@ "mini-css-extract-plugin": "^1.3.2", "node-fetch": "^2.6.1", "script-ext-html-webpack-plugin": "^2.1.4", - "three": "^0.125.0", + "three": "^0.126.0", "ts-loader": "^8.0.7", "typescript": "^4.1.2", "webpack": "^5.12.3", diff --git a/yarn.lock b/yarn.lock index b8a9a804e1..830c15d7d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1847,6 +1847,11 @@ resolved "https://registry.yarnpkg.com/@types/stats.js/-/stats.js-0.17.0.tgz#0ed81d48e03b590c24da85540c1d952077a9fe20" integrity sha512-9w+a7bR8PeB0dCT/HBULU2fMqf6BAzvKbxFboYhmDtDkKPiyXYbjoe2auwsXlEFI7CFNMF1dCv3dFH5Poy9R1w== +"@types/three@^0.126.0": + version "0.126.0" + resolved "https://registry.yarnpkg.com/@types/three/-/three-0.126.0.tgz#58f80e13ab5f8084741e8a9d7e804b9a31039043" + integrity sha512-C7cFOWQpcGQAJ0PJSdU6ncZFn51fWKaV8o1Dz2fvikFRGWY8cI5/M/q5JHX7/TzCfMRadLP690Ksh8QvanSW8Q== + "@types/ua-parser-js@^0.7.32": version "0.7.33" resolved "https://registry.yarnpkg.com/@types/ua-parser-js/-/ua-parser-js-0.7.33.tgz#4a92089511574e12928a7cb6b99a01831acd1dd7" @@ -9336,10 +9341,10 @@ textextensions@^2.5.0: resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-2.6.0.tgz#d7e4ab13fe54e32e08873be40d51b74229b00fc4" integrity sha512-49WtAWS+tcsy93dRt6P0P3AMD2m5PvXRhuEA0kaXos5ZLlujtYmpmFsB+QvWUSxE1ZsstmYXfQ7L40+EcQgpAQ== -three@^0.125.0: - version "0.125.2" - resolved "https://registry.yarnpkg.com/three/-/three-0.125.2.tgz#dcba12749a2eb41522e15212b919cd3fbf729b12" - integrity sha512-7rIRO23jVKWcAPFdW/HREU2NZMGWPBZ4XwEMt0Ak0jwLUKVJhcKM55eCBWyGZq/KiQbeo1IeuAoo/9l2dzhTXA== +three@^0.126.0: + version "0.126.1" + resolved "https://registry.yarnpkg.com/three/-/three-0.126.1.tgz#cf4e4e52060fd952f6f0d5440cbd422c66bc4be7" + integrity sha512-eOEXnZeE1FDV0XgL1u08auIP13jxdN9LQBAEmlErYzMxtIIfuGIAZbijOyookALUhqVzVOx0Tywj6n192VM+nQ== through2@^2.0.1, through2@~2.0.0: version "2.0.5"