From 2d2e98ad2833ab9b8d1e4986d23f0684d4c99191 Mon Sep 17 00:00:00 2001 From: Volodymyr Agafonkin Date: Fri, 14 Apr 2023 11:45:00 +0300 Subject: [PATCH] v2.14.1 (#12661) * Forbid class fields to fix transpilation errors with Vite/ESBuild (#12658) * forbid class fields to fix transpilation errors with vite/esbuild * fix flow * v2.14.1 version bump + changelog update --- .eslintrc | 3 +++ CHANGELOG.md | 8 +++++++- package.json | 2 +- src/style/style_layer/line_style_layer.js | 2 +- test/unit/util/util.test.js | 3 ++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.eslintrc b/.eslintrc index 651d53dba00..7e27f1b687d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -27,6 +27,9 @@ "no-duplicate-imports": "off", "import/no-duplicates": "error", + // prevent issues with esbuild/vite https://github.com/mapbox/mapbox-gl-js/issues/12656 + "no-restricted-syntax": ["error", "ClassProperty[value]"], + // ensure compatibility with Node's native ESM "import/extensions": ["error", { "js": "always", diff --git a/CHANGELOG.md b/CHANGELOG.md index d75f4cbc2f9..e8318935035 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ +## 2.14.1 + +### Bug fixes 🐞 + +* Fix a bug where certain bundling configurations involving Vite or ESBuild could produce a broken build. [#12658](https://github.com/mapbox/mapbox-gl-js/pull/12658) + ## 2.14.0 ### Features ✨ and improvements 🏁 * Support `referrerPolicy` option for the `transformRequest` function when using fetch ([#12590](https://github.com/mapbox/mapbox-gl-js/pull/12590)) (h/t [robertcepa](https://github.com/robertcepa)) -## Bug fixes 🐞 +### Bug fixes 🐞 * Enable anisotropic filtering on tiles beyond 20 degrees pitch to prevent it from compromising image crispness on flat or low-tilted maps. ([#12577](https://github.com/mapbox/mapbox-gl-js/pull/12577)) * Fix LngLatBounds.extend() with literal LngLat object. ([#12605](https://github.com/mapbox/mapbox-gl-js/pull/12605)) diff --git a/package.json b/package.json index 46684edb35d..00a2635772d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mapbox-gl", "description": "A WebGL interactive maps library", - "version": "2.14.0", + "version": "2.14.1", "main": "dist/mapbox-gl.js", "style": "dist/mapbox-gl.css", "license": "SEE LICENSE IN LICENSE.txt", diff --git a/src/style/style_layer/line_style_layer.js b/src/style/style_layer/line_style_layer.js index 12e61cd04fe..08a66d2c97a 100644 --- a/src/style/style_layer/line_style_layer.js +++ b/src/style/style_layer/line_style_layer.js @@ -22,7 +22,7 @@ import type {TilespaceQueryGeometry} from '../query_geometry.js'; import type {IVectorTileFeature} from '@mapbox/vector-tile'; class LineFloorwidthProperty extends DataDrivenProperty { - useIntegerZoom = true; + useIntegerZoom: ?boolean; possiblyEvaluate(value, parameters) { parameters = new EvaluationParameters(Math.floor(parameters.zoom), { diff --git a/test/unit/util/util.test.js b/test/unit/util/util.test.js index 450426176a6..a790c2f0377 100644 --- a/test/unit/util/util.test.js +++ b/test/unit/util/util.test.js @@ -69,13 +69,14 @@ test('util', (t) => { this.name = 'Tom'; } - ontimer = () => { + ontimer() { t.equal(this.name, 'Tom'); t.end(); } } const my = new MyClass(); + // $FlowFixMe[method-unbinding] setTimeout(my.ontimer, 0); });