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

chore: Upgrade to node@22 #3057

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
node-version: [22]

steps:
- uses: actions/[email protected]
Expand All @@ -25,7 +25,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Bootstrap
- name: Install dependencies
run: |
yarn

Expand Down
1 change: 1 addition & 0 deletions docs/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Upgrading to v4.3 (In development)

- Now requires Node.js v18.20 or higher (needs support for `import ... with { ... }` syntax)
- Note: internal tile index in `Source` classes has changed from `tileIndex.zoom` to `tileIndex.z`. Should not impact most applications.

## Upgrading to v4.2
Expand Down
3 changes: 2 additions & 1 deletion docs/whats-new.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A minor release that includes:
- **[`Source`](/docs/developer-guide/using-sources) support** - Improvements for multi-step data loading.
- **examples** - modernized to latest React and minimized boilerplate code.
- **website** - more format examples are now available.
- **Node.js v18.20+, v20 & v22** - Supports the current set of Node.js LTS releases.

**@loaders.gl/core**

Expand All @@ -21,7 +22,7 @@ A minor release that includes:

**@loaders.gl/textures**

- [`Comp[ressedTextureLoader]`](/docs/modules/textures/api-reference/compressed-texture-loader) - Now supports mipmaps in KTX2 textures.
- [`CompressedTextureLoader`](/docs/modules/textures/api-reference/compressed-texture-loader) - Now supports mipmaps in KTX2 textures.


## v4.2
Expand Down
2 changes: 1 addition & 1 deletion modules/crypto/test/lib/crc32c-hash.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import test from 'tape-promise/tape';
import {fetchFile} from '@loaders.gl/core';
import {CRC32CHash, encodeNumber} from '@loaders.gl/crypto';
import TEST_CASES from './crc32c-test-cases.json' assert {type: 'json'};
import TEST_CASES from './crc32c-test-cases.json' with {type: 'json'};

test('crc32c#additional tests', async (t) => {
for (const type in TEST_CASES) {
Expand Down
2 changes: 1 addition & 1 deletion modules/crypto/test/lib/utils/digest-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import test from 'tape-promise/tape';
import {encodeNumber, encodeHex, encodeBase64} from '@loaders.gl/crypto';
import TEST_CASES from '../crc32c-test-cases.json' assert {type: 'json'};
import TEST_CASES from '../crc32c-test-cases.json' with {type: 'json'};

test('encodeHexToBase64#crc32 test cases', (t) => {
for (const type in TEST_CASES) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

import {_ClarinetParser} from '@loaders.gl/json';

import BASIC from '../../data/clarinet/basic.json' assert {type: 'json'};
import BASIC from '../../data/clarinet/basic.json' with {type: 'json'};

export default function clarinetBench(bench) {
const STRING = JSON.stringify(BASIC);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

/* eslint-disable */
// @ts-nocheck
import test from 'tape-promise/tape';
Expand Down
8 changes: 4 additions & 4 deletions modules/mvt/test/lib/utils/geometry-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import test from 'tape-promise/tape';
import {classifyRingsFlat} from '@loaders.gl/mvt/lib/utils/geometry-utils';

// Rings
import ringsSingleRing from '@loaders.gl/mvt/test/data/rings/rings_single_ring.json' assert {type: 'json'};
import ringsRingAndHole from '@loaders.gl/mvt/test/data/rings/rings_ring_and_hole.json' assert {type: 'json'};
import ringsTwoRings from '@loaders.gl/mvt/test/data/rings/rings_two_rings.json' assert {type: 'json'};
import ringsZeroSizeHole from '@loaders.gl/mvt/test/data/rings/rings_zero_size_hole.json' assert {type: 'json'};
import ringsSingleRing from '@loaders.gl/mvt/test/data/rings/rings_single_ring.json' with {type: 'json'};
import ringsRingAndHole from '@loaders.gl/mvt/test/data/rings/rings_ring_and_hole.json' with {type: 'json'};
import ringsTwoRings from '@loaders.gl/mvt/test/data/rings/rings_two_rings.json' with {type: 'json'};
import ringsZeroSizeHole from '@loaders.gl/mvt/test/data/rings/rings_zero_size_hole.json' with {type: 'json'};

test('classifyRingsFlat#single ring', async (t) => {
const geom = {...ringsSingleRing};
Expand Down
8 changes: 4 additions & 4 deletions modules/mvt/test/mvt-loader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const WITH_FEATURE_ID = '@loaders.gl/mvt/test/data/mvt/with_feature_id.mvt';
// Geometry Array Results

// // GeoJSON Results
import decodedPolygonsGeometry from '@loaders.gl/mvt/test/data/mvt-results/decoded_mvt_polygons_array.json' assert {type: 'json'};
import decodedPolygonsGeometry from '@loaders.gl/mvt/test/data/mvt-results/decoded_mvt_polygons_array.json' with {type: 'json'};

// GeoJSON Results
import decodedPointsGeoJSON from '@loaders.gl/mvt/test/data/mvt-results/decoded_mvt_points.json' assert {type: 'json'};
import decodedLinesGeoJSON from '@loaders.gl/mvt/test/data/mvt-results/decoded_mvt_lines.json' assert {type: 'json'};
import decodedPolygonsGeoJSON from '@loaders.gl/mvt/test/data/mvt-results/decoded_mvt_polygons.json' assert {type: 'json'};
import decodedPointsGeoJSON from '@loaders.gl/mvt/test/data/mvt-results/decoded_mvt_points.json' with {type: 'json'};
import decodedLinesGeoJSON from '@loaders.gl/mvt/test/data/mvt-results/decoded_mvt_lines.json' with {type: 'json'};
import decodedPolygonsGeoJSON from '@loaders.gl/mvt/test/data/mvt-results/decoded_mvt_polygons.json' with {type: 'json'};

setLoaderOptions({
_workerType: 'test'
Expand Down
2 changes: 1 addition & 1 deletion modules/wms/src/lib/parsers/xml/parse-xml-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function getXMLArray(xmlValue: any): any[] {
export function getXMLStringArray(xmlValue: any): string[] {
const xmlArray = getXMLArray(xmlValue);
if (xmlArray.length > 0 && xmlArray.every((_) => typeof _ === 'string')) {
return xmlArray as string[];
return xmlArray;
}
// TODO - error handling?
return [];
Expand Down
18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
"build": "ocular-clean && ocular-build && lerna run pre-build",
"cover": "ocular-test cover",
"lint": "ocular-lint",
"publish": "ocular-publish",
"publish-beta": "ocular-publish beta",
"publish-prod": "ocular-publish prod",
"test": "ocular-test",
"test-ci": "ocular-lint && ocular-test node && ocular-test cover",
"test-ci": "ocular-lint && ocular-test node && ocular-test cover && yarn test-website",
"test-website": "cd website && yarn && yarn build && cd ..",
"test-fast": "ocular-test fast",
"pre-commit": "yarn lint",
"pre-push": "yarn lint",
Expand All @@ -56,10 +58,16 @@
],
"resolutions": {
"apache-arrow": "^15.0.0",
"typescript": "^5.3.0"
"typescript": "^5.5.0"
},
"volta": {
"node": "18.19.0",
"yarn": "4.2.2"
"node": "22.6.0",
"yarn": "4.4.0"
},
"engines_comment": {
"node": "Requires support for import ... with ... syntax"
},
"engines": {
"node": ">=18.20"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"module": "esnext",
"strict": true,
"noImplicitAny": false,
"allowJs": true,
Expand Down
4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"node": ">=18.0"
},
"volta": {
"node": "18.18.2",
"yarn": "4.2.1"
"node": "22.6.0",
"yarn": "4.4.0"
}
}
15 changes: 4 additions & 11 deletions website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9194,17 +9194,10 @@ __metadata:
languageName: node
linkType: hard

"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001449, caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001541, caniuse-lite@npm:^1.0.30001565":
version: 1.0.30001580
resolution: "caniuse-lite@npm:1.0.30001580"
checksum: 10c0/f3a41bb5a820640a60071ed69d464f20d783d9a51cc2fd8916c7b0c187b25a8062e11986d04f531bdc1798d0bc37dfb0f90dcfa90fa3227bd49691efd4272c03
languageName: node
linkType: hard

"caniuse-lite@npm:^1.0.30001587, caniuse-lite@npm:^1.0.30001599":
version: 1.0.30001616
resolution: "caniuse-lite@npm:1.0.30001616"
checksum: 10c0/4c29f0a6c65ec888fadf5112cffc3b162872b74dce6ca4964d242c1c0fd05ab284f8e500f85739d5c96573589cf6e0e911424646b1009440a7c142ef6a5187ce
"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001449, caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001541, caniuse-lite@npm:^1.0.30001565, caniuse-lite@npm:^1.0.30001587, caniuse-lite@npm:^1.0.30001599":
version: 1.0.30001651
resolution: "caniuse-lite@npm:1.0.30001651"
checksum: 10c0/7821278952a6dbd17358e5d08083d258f092e2a530f5bc1840657cb140fbbc5ec44293bc888258c44a18a9570cde149ed05819ac8320b9710cf22f699891e6ad
languageName: node
linkType: hard

Expand Down
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5592,9 +5592,9 @@ __metadata:
linkType: hard

"caniuse-lite@npm:^1.0.30001449":
version: 1.0.30001546
resolution: "caniuse-lite@npm:1.0.30001546"
checksum: 10c0/a0a6567226bd3ce1d5aec94c7b25b3a76bd503c49cb0f1bfb742329367634e06dd0fb3224a06d0974a276981c2b857377ec62fa7712dbbbde6e96673aac2cbe5
version: 1.0.30001651
resolution: "caniuse-lite@npm:1.0.30001651"
checksum: 10c0/7821278952a6dbd17358e5d08083d258f092e2a530f5bc1840657cb140fbbc5ec44293bc888258c44a18a9570cde149ed05819ac8320b9710cf22f699891e6ad
languageName: node
linkType: hard

Expand Down Expand Up @@ -14661,23 +14661,23 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^5.3.0":
version: 5.4.3
resolution: "typescript@npm:5.4.3"
"typescript@npm:^5.5.0":
version: 5.5.4
resolution: "typescript@npm:5.5.4"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/22443a8760c3668e256c0b34b6b45c359ef6cecc10c42558806177a7d500ab1a7d7aac1f976d712e26989ddf6731d2fbdd3212b7c73290a45127c1c43ba2005a
checksum: 10c0/422be60f89e661eab29ac488c974b6cc0a660fb2228003b297c3d10c32c90f3bcffc1009b43876a082515a3c376b1eefcce823d6e78982e6878408b9a923199c
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^5.3.0#optional!builtin<compat/typescript>":
version: 5.4.3
resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin<compat/typescript>::version=5.4.3&hash=5adc0c"
"typescript@patch:typescript@npm%3A^5.5.0#optional!builtin<compat/typescript>":
version: 5.5.4
resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin<compat/typescript>::version=5.5.4&hash=379a07"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/6e51f8b7e6ec55b897b9e56b67e864fe8f44e30f4a14357aad5dc0f7432db2f01efc0522df0b6c36d361c51f2dc3dcac5c832efd96a404cfabf884e915d38828
checksum: 10c0/73409d7b9196a5a1217b3aaad929bf76294d3ce7d6e9766dd880ece296ee91cf7d7db6b16c6c6c630ee5096eccde726c0ef17c7dfa52b01a243e57ae1f09ef07
languageName: node
linkType: hard

Expand Down