Skip to content

Commit

Permalink
v2.3.1 additional cherry-picks (#10790)
Browse files Browse the repository at this point in the history
* Migrate github size chekcer app and aws creds to mbx-ci (#10719)

* Fix collision boxes for text with variable placement (#10709)

* Add 10709 to changelog

Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>
  • Loading branch information
rreusser and Arindam Bose committed Jun 21, 2021
1 parent 90c6675 commit c377a90
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 155 deletions.
52 changes: 27 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ jobs:
<<: *defaults
steps:
- checkout
- run:
name: Install mbx-ci
command: |
curl -Ls https://mapbox-release-engineering.s3.amazonaws.com/mbx-ci/latest/mbx-ci-linux-amd64 > ~/mbx-ci &&
chmod 755 ~/mbx-ci &&
~/mbx-ci aws setup
- restore_cache:
keys:
- v4-yarn-{{ checksum "yarn.lock" }}
Expand All @@ -133,15 +139,19 @@ jobs:
- '~/.yarn'
- 'node_modules'
- persist_to_workspace:
root: .
root: ~/
paths:
- .
- mapbox-gl-js
- .ssh
- .aws
- mbx-ci


lint:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- restore_cache:
keys:
- v2-lint-{{ .Branch }}
Expand All @@ -158,7 +168,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- run: yarn run build-prod-min
- run: yarn run build-prod
- run: yarn run build-csp
Expand All @@ -171,42 +181,34 @@ jobs:
name: Check bundle size
command: |
node build/check-bundle-size.js
- deploy:
name: Trigger memory metrics when merging to main
command: |
if [ -n "${WEB_METRICS_TOKEN}" ]; then
if [[ $CIRCLE_BRANCH == main ]]; then
curl -X POST https://circleci.com/api/v1.1/project/github/mapbox/web-metrics/build?circle-token=${WEB_METRICS_TOKEN}
fi
fi
- store_artifacts:
path: "dist"
- store_artifacts:
path: "test/release"
- persist_to_workspace:
root: .
root: ~/
paths:
- dist
- mapbox-gl-js/dist

test-flow:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- run: yarn run test-flow

test-unit:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- run: yarn run test-unit

test-render:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- browser-tools/install-chrome
- run: yarn run test-render
- store_test_results:
Expand All @@ -218,7 +220,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- browser-tools/install-chrome
- run: yarn run test-render-prod
- store_test_results:
Expand All @@ -230,7 +232,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- browser-tools/install-chrome
- run: yarn run test-query
- store_test_results:
Expand All @@ -242,7 +244,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- run:
name: Build Webpack
command: |
Expand All @@ -257,7 +259,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- browser-tools/install-chrome
- run:
name: Collect performance stats
Expand All @@ -271,7 +273,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- browser-tools/install-browser-tools
- run: yarn run build-dev
- run: yarn run build-token
Expand All @@ -292,14 +294,14 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- run: yarn run test-expressions

deploy-benchmarks:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- run:
name: Build
command: BENCHMARK_VERSION="${CIRCLE_TAG:-$CIRCLE_BRANCH} $(git rev-parse --short=7 HEAD)" yarn run build-benchmarks
Expand All @@ -315,7 +317,7 @@ jobs:
<<: *defaults
steps:
- attach_workspace:
at: .
at: ~/
- aws-cli/install
- run:
name: Check build file for correct SDK version
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 🐞 Bug fixes

* Fix fog flickering when the map option `optimizeForTerrain` is set to false ([#10763](https://github.com/mapbox/mapbox-gl-js/pull/10767))
* Fix collision boxes which were not correctly updated for symbols with `text-variable-anchor` ([#10709](https://github.com/mapbox/mapbox-gl-js/pull/10709))

## 2.3.0

Expand Down
13 changes: 2 additions & 11 deletions build/check-bundle-size.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node

import { Octokit } from "@octokit/rest";
import { createAppAuth } from "@octokit/auth-app";
import prettyBytes from 'pretty-bytes';
import fs from 'fs';
import {execSync} from 'child_process';
Expand All @@ -14,14 +13,11 @@ process.on('unhandledRejection', error => {
process.exit(1)
});

const SIZE_CHECK_APP_ID = 14028;
const SIZE_CHECK_APP_INSTALLATION_ID = 229425;

const FILES = [
['JS', "dist/mapbox-gl.js"],
['CSS', "dist/mapbox-gl.css"]
];
const PK = process.env['SIZE_CHECK_APP_PRIVATE_KEY'];
const PK = process.env['MBX_CI_DOMAIN'];
if (!PK) {
console.log('Fork PR; not computing size.');
process.exit(0);
Expand All @@ -32,12 +28,7 @@ const repo = 'mapbox-gl-js';
(async () => {
// Initialize github client
const github = new Octokit({
authStrategy: createAppAuth,
auth: {
appId: SIZE_CHECK_APP_ID,
privateKey: Buffer.from(PK, 'base64').toString('binary'),
installationId: SIZE_CHECK_APP_INSTALLATION_ID
}
auth: execSync('~/mbx-ci github notifier token').toString().trim()
});

//get current sizes
Expand Down
72 changes: 0 additions & 72 deletions cloudformation/ci.template

This file was deleted.

33 changes: 15 additions & 18 deletions src/data/array_types.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,11 @@ register('StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48', StructArrayLayout2i2ui3ul3u
* [0]: Int16[8]
* [16]: Uint16[15]
* [48]: Uint32[1]
* [52]: Float32[4]
* [52]: Float32[3]
*
* @private
*/
class StructArrayLayout8i15ui1ul4f68 extends StructArray {
class StructArrayLayout8i15ui1ul3f64 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
uint16: Uint16Array;
Expand All @@ -620,15 +620,15 @@ class StructArrayLayout8i15ui1ul4f68 extends StructArray {
this.float32 = new Float32Array(this.arrayBuffer);
}

emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number, v27: number) {
emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number) {
const i = this.length;
this.resize(i + 1);
return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
}

emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number, v27: number) {
const o2 = i * 34;
const o4 = i * 17;
emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number) {
const o2 = i * 32;
const o4 = i * 16;
this.int16[o2 + 0] = v0;
this.int16[o2 + 1] = v1;
this.int16[o2 + 2] = v2;
Expand Down Expand Up @@ -656,13 +656,12 @@ class StructArrayLayout8i15ui1ul4f68 extends StructArray {
this.float32[o4 + 13] = v24;
this.float32[o4 + 14] = v25;
this.float32[o4 + 15] = v26;
this.float32[o4 + 16] = v27;
return i;
}
}

StructArrayLayout8i15ui1ul4f68.prototype.bytesPerElement = 68;
register('StructArrayLayout8i15ui1ul4f68', StructArrayLayout8i15ui1ul4f68);
StructArrayLayout8i15ui1ul3f64.prototype.bytesPerElement = 64;
register('StructArrayLayout8i15ui1ul3f64', StructArrayLayout8i15ui1ul3f64);

/**
* Implementation of the StructArray layout:
Expand Down Expand Up @@ -998,7 +997,6 @@ class SymbolInstanceStruct extends Struct {
numVerticalIconVertices: number;
useRuntimeCollisionCircles: number;
crossTileID: number;
textBoxScale: number;
textOffset0: number;
textOffset1: number;
collisionCircleDiameter: number;
Expand Down Expand Up @@ -1027,20 +1025,19 @@ class SymbolInstanceStruct extends Struct {
get useRuntimeCollisionCircles() { return this._structArray.uint16[this._pos2 + 22]; }
get crossTileID() { return this._structArray.uint32[this._pos4 + 12]; }
set crossTileID(x: number) { this._structArray.uint32[this._pos4 + 12] = x; }
get textBoxScale() { return this._structArray.float32[this._pos4 + 13]; }
get textOffset0() { return this._structArray.float32[this._pos4 + 14]; }
get textOffset1() { return this._structArray.float32[this._pos4 + 15]; }
get collisionCircleDiameter() { return this._structArray.float32[this._pos4 + 16]; }
get textOffset0() { return this._structArray.float32[this._pos4 + 13]; }
get textOffset1() { return this._structArray.float32[this._pos4 + 14]; }
get collisionCircleDiameter() { return this._structArray.float32[this._pos4 + 15]; }
}

SymbolInstanceStruct.prototype.size = 68;
SymbolInstanceStruct.prototype.size = 64;

export type SymbolInstance = SymbolInstanceStruct;

/**
* @private
*/
export class SymbolInstanceArray extends StructArrayLayout8i15ui1ul4f68 {
export class SymbolInstanceArray extends StructArrayLayout8i15ui1ul3f64 {
/**
* Return the SymbolInstanceStruct at the given location in the array.
* @param {number} index The index of the element.
Expand Down Expand Up @@ -1152,7 +1149,7 @@ export {
StructArrayLayout2ub2f12,
StructArrayLayout3ui6,
StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48,
StructArrayLayout8i15ui1ul4f68,
StructArrayLayout8i15ui1ul3f64,
StructArrayLayout1f4,
StructArrayLayout3i6,
StructArrayLayout1ul3ui12,
Expand Down
1 change: 0 additions & 1 deletion src/data/bucket/symbol_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export const symbolInstance = createLayout([
{type: 'Uint16', name: 'numVerticalIconVertices'},
{type: 'Uint16', name: 'useRuntimeCollisionCircles'},
{type: 'Uint32', name: 'crossTileID'},
{type: 'Float32', name: 'textBoxScale'},
{type: 'Float32', components: 2, name: 'textOffset'},
{type: 'Float32', name: 'collisionCircleDiameter'},
]);
Expand Down
Loading

0 comments on commit c377a90

Please sign in to comment.