Skip to content

Commit 0c13f10

Browse files
Update dev setup to support modern JS syntax (visgl#5517)
1 parent f7af504 commit 0c13f10

File tree

12 files changed

+164
-85
lines changed

12 files changed

+164
-85
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ module.exports = {
2222
rules: {
2323
'guard-for-in': 0,
2424
'no-inline-comments': 0,
25+
// eslint treats optional chaining as unused expressions
26+
'no-unused-expressions': 0,
2527
camelcase: 0,
2628
'react/forbid-prop-types': 0,
2729
'react/no-deprecated': 0,
2830
'import/no-unresolved': ['error', {ignore: ['test']}],
2931
'import/no-extraneous-dependencies': ['error', {devDependencies: false, peerDependencies: true}]
3032
},
3133
parserOptions: {
32-
ecmaVersion: 2018
34+
ecmaVersion: 2020
3335
}
3436
};

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Use Node.js
1818
uses: actions/setup-node@v1
1919
with:
20-
node-version: '12.x'
20+
node-version: '14.x'
2121

2222
- name: Install dependencies
2323
run: |

.github/workflows/website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Use Node.js
2424
uses: actions/setup-node@v1
2525
with:
26-
node-version: '12.x'
26+
node-version: '14.x'
2727

2828
- name: Get version
2929
id: get-version

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PRs and bug reports are welcome, and we are actively looking for new maintainers
99

1010
The **master** branch is the active development branch.
1111

12-
Building deck.gl locally from the source requires node.js `>=10`. Further limitations on the Node version may be imposed by [puppeteer](https://github.com/puppeteer/puppeteer#usage) and [headless-gl](https://github.com/stackgl/headless-gl#supported-platforms-and-nodejs-versions).
12+
Building deck.gl locally from the source requires node.js `>=14`. Further limitations on the Node version may be imposed by [puppeteer](https://github.com/puppeteer/puppeteer#usage) and [headless-gl](https://github.com/stackgl/headless-gl#supported-platforms-and-nodejs-versions).
1313
We use [yarn](https://yarnpkg.com/en/docs/install) to manage the dependencies of deck.gl.
1414

1515
```bash

modules/jupyter-widget/src/playground/create-deck.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
/* eslint-disable no-console */
33
import {CSVLoader} from '@loaders.gl/csv';
44
import {registerLoaders} from '@loaders.gl/core';
5-
import GL from '@luma.gl/constants';
5+
// Avoid calling it GL - would be removed by babel-plugin-inline-webgl-constants
6+
import GLConstants from '@luma.gl/constants';
67

78
import makeTooltip from './widget-tooltip';
89

@@ -30,7 +31,7 @@ const jsonConverterConfiguration = {
3031
// Will be resolved as `<enum-name>.<enum-value>`
3132
enumerations: {
3233
COORDINATE_SYSTEM: deck.COORDINATE_SYSTEM,
33-
GL
34+
GL: GLConstants
3435
}
3536
};
3637

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"workspaces": [
1717
"modules/*"
1818
],
19+
"resolutions": {
20+
"acorn": "7.4.1"
21+
},
1922
"scripts": {
2023
"bootstrap": "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn && ocular-bootstrap",
2124
"clean": "ocular-clean",
@@ -41,6 +44,7 @@
4144
"jsdom": false
4245
},
4346
"devDependencies": {
47+
"@babel/register": "^7.13.0",
4448
"@loaders.gl/csv": "^2.3.9",
4549
"@loaders.gl/polyfills": "^2.3.9",
4650
"@luma.gl/test-utils": "^8.4.1",
@@ -67,11 +71,13 @@
6771
"react": "^16.2.0",
6872
"react-dom": "^16.2.0",
6973
"react-map-gl": "^5.1.0",
70-
"reify": "^0.18.1",
7174
"s2-geometry": "^1.2.10"
7275
},
7376
"pre-commit": [
7477
"test-fast",
7578
"bindings-precommit-tests"
76-
]
79+
],
80+
"engines": {
81+
"node": ">=14"
82+
}
7783
}

test/bench/layer.bench.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export default function layerBench(suite) {
126126
.add('calculate instance picking colors', () => {
127127
const numInstances = 1e6;
128128
const target = new Uint8ClampedArray(numInstances * 3);
129+
testLayer.internalState = {};
129130
testLayer.calculateInstancePickingColors({value: target, size: 3}, {numInstances});
130131
});
131132
}

test/bench/node.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
require('reify');
1+
require('@babel/register')({
2+
presets: [
3+
[
4+
'@babel/env',
5+
{
6+
targets: {node: '14'}
7+
}
8+
]
9+
]
10+
});
211

312
require('./index');

test/modules/google-maps/mock-maps-api.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,8 @@ export class OverlayView {
143143
}
144144

145145
setMap(map) {
146-
if (this.map) {
147-
this.map._removeOverlay(this);
148-
}
149-
if (map) {
150-
map._addOverlay(this);
151-
}
146+
this.map?._removeOverlay(this);
147+
map?._addOverlay(this);
152148
this.map = map;
153149
}
154150

test/modules/json/json-configuration-for-deck.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {COORDINATE_SYSTEM, MapView, FirstPersonView, MapController} from '@deck.gl/core';
2-
import GL from '@luma.gl/constants';
2+
import GLConstants from '@luma.gl/constants';
33

44
export const log = console; // eslint-disable-line
55

@@ -17,7 +17,7 @@ export default {
1717
// Will be resolved as `<enum-name>.<enum-value>`
1818
enumerations: {
1919
COORDINATE_SYSTEM,
20-
GL
20+
GL: GLConstants
2121
},
2222
constants: {
2323
MapController

0 commit comments

Comments
 (0)