Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core, test] Bump GL JS pin to bring gl-native back in sync with gl-js.
Browse files Browse the repository at this point in the history
Requires changing `generate-style-code` to treat 'formatted' as being the same as 'string' until gl-native gets 'formatted' support with #12624.
To make nitpick happy, PropertyFunction.java uses the latest "text-field" description from v8.json. It's technically correct, just kind of pointless since the "If a plain `string` is provided" clause will always be true.
  • Loading branch information
ChrisLoer committed Aug 21, 2018
1 parent ea73094 commit 0a67f80
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mapbox-gl-js
Submodule mapbox-gl-js updated 233 files
Expand Up @@ -2055,7 +2055,7 @@ public static PropertyValue<Expression> textRotationAlignment(Expression value)
}

/**
* Value to use for a text label.
* Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
*
* @param value a String value
* @return property wrapper around String
Expand All @@ -2065,7 +2065,7 @@ public static PropertyValue<String> textField(String value) {
}

/**
* Value to use for a text label.
* Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.
*
* @param value a String value
* @return property wrapper around String
Expand Down
7 changes: 7 additions & 0 deletions platform/android/scripts/generate-style-code.js
Expand Up @@ -55,6 +55,7 @@ global.propertyType = function propertyType(property) {
return 'Boolean';
case 'number':
return 'Float';
case 'formatted':
case 'string':
return 'String';
case 'enum':
Expand All @@ -74,6 +75,7 @@ global.propertyJavaType = function propertyType(property) {
return 'boolean';
case 'number':
return 'float';
case 'formatted':
case 'string':
return 'String';
case 'enum':
Expand Down Expand Up @@ -121,6 +123,7 @@ global.propertyNativeType = function (property) {
return 'bool';
case 'number':
return 'float';
case 'formatted':
case 'string':
return 'std::string';
case 'enum':
Expand Down Expand Up @@ -155,6 +158,7 @@ global.defaultExpressionJava = function(property) {
return 'boolean';
case 'number':
return 'number';
case 'formatted':
case 'string':
return "string";
case 'enum':
Expand All @@ -179,6 +183,7 @@ global.defaultValueJava = function(property) {
return 'true';
case 'number':
return '0.3f';
case 'formatted':
case 'string':
return '"' + property['default'] + '"';
case 'enum':
Expand All @@ -187,6 +192,7 @@ global.defaultValueJava = function(property) {
return '"rgba(0, 0, 0, 1)"';
case 'array':
switch (property.value) {
case 'formatted':
case 'string':
return '[' + property['default'] + "]";
case 'number':
Expand Down Expand Up @@ -301,6 +307,7 @@ global.evaluatedType = function (property) {
return 'bool';
case 'number':
return 'float';
case 'formatted':
case 'string':
return 'std::string';
case 'enum':
Expand Down
11 changes: 10 additions & 1 deletion platform/darwin/scripts/generate-style-code.js
Expand Up @@ -102,6 +102,7 @@ global.objCTestValue = function (property, layerType, arraysAsStructs, indent) {
return property.default ? '@"false"' : '@"true"';
case 'number':
return '@"1"';
case 'formatted':
case 'string':
return `@"'${_.startCase(propertyName)}'"`;
case 'enum':
Expand Down Expand Up @@ -146,6 +147,7 @@ global.mbglTestValue = function (property, layerType) {
return property.default ? 'false' : 'true';
case 'number':
return '1.0';
case 'formatted':
case 'string':
return `"${_.startCase(propertyName)}"`;
case 'enum': {
Expand Down Expand Up @@ -218,6 +220,7 @@ global.testHelperMessage = function (property, layerType, isFunction) {
return 'testBool' + fnSuffix;
case 'number':
return 'testNumber' + fnSuffix;
case 'formatted':
case 'string':
return 'testString' + fnSuffix;
case 'enum':
Expand Down Expand Up @@ -385,6 +388,7 @@ global.describeType = function (property) {
return 'Boolean';
case 'number':
return 'numeric';
case 'formatted':
case 'string':
return 'string';
case 'enum':
Expand Down Expand Up @@ -428,6 +432,7 @@ global.describeValue = function (value, property, layerType) {
return value ? '`YES`' : '`NO`';
case 'number':
return 'the float ' + '`' + formatNumber(value) + '`';
case 'formatted':
case 'string':
if (value === '') {
return 'the empty string';
Expand Down Expand Up @@ -509,6 +514,7 @@ global.propertyType = function (property) {
return 'NSNumber *';
case 'number':
return 'NSNumber *';
case 'formatted':
case 'string':
return 'NSString *';
case 'enum':
Expand Down Expand Up @@ -539,7 +545,8 @@ global.isInterpolatable = function (property) {
const type = property.type === 'array' ? property.value : property.type;
return type !== 'boolean' &&
type !== 'enum' &&
type !== 'string';
type !== 'string' &&
type !== 'formatted';
};

global.valueTransformerArguments = function (property) {
Expand All @@ -549,6 +556,7 @@ global.valueTransformerArguments = function (property) {
return ['bool', objCType];
case 'number':
return ['float', objCType];
case 'formatted':
case 'string':
return ['std::string', objCType];
case 'enum':
Expand Down Expand Up @@ -582,6 +590,7 @@ global.mbglType = function(property) {
return 'bool';
case 'number':
return 'float';
case 'formatted':
case 'string':
return 'std::string';
case 'enum': {
Expand Down
12 changes: 12 additions & 0 deletions platform/node/test/ignores.json
@@ -1,5 +1,9 @@
{
"expression-tests/collator/accent-equals-de": "Locale-specific behavior changes based on platform.",
"expression-tests/formatted/basic": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
"expression-tests/formatted/to-string": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
"expression-tests/interpolate-hcl/linear": "https://github.com/mapbox/mapbox-gl-native/issues/8720",
"expression-tests/interpolate-lab/linear": "https://github.com/mapbox/mapbox-gl-native/issues/8720",
"expression-tests/is-supported-script/default": "This tests RTL text plugin behavior specific to GL JS",
"expression-tests/resolved-locale/basic": "Even the 'en' locale may not be present on some test systems.",
"query-tests/geometry/multilinestring": "needs investigation",
Expand All @@ -9,12 +13,16 @@
"query-tests/world-wrapping/point": "skip - needs issue",
"query-tests/circle-radius/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/circle-stroke-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/fill-extrusion-translate/multiple-layers": "https://github.com/mapbox/mapbox-gl-native/issues/12701",
"query-tests/fill-translate/multiple-layers": "https://github.com/mapbox/mapbox-gl-native/issues/12701",
"query-tests/line-gap-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/line-offset/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/line-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/feature-state/default": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"query-tests/regressions/mapbox-gl-js#6555": "skip - no querySourceFeatures in mbgl-node; needs issue",
"render-tests/background-color/transition": "https://github.com/mapbox/mapbox-gl-native/issues/10619",
"render-tests/basic-v9/z0-wide": "https://github.com/mapbox/mapbox-gl-native/pull/12611",
"render-tests/bright-v9/z0-wide": "https://github.com/mapbox/mapbox-gl-native/pull/12611",
"render-tests/collator/resolved-locale": "Some test platforms don't resolve 'en' locale",
"render-tests/collator/default": "Some test platforms don't resolve 'en' locale",
"render-tests/debug/collision": "https://github.com/mapbox/mapbox-gl-native/issues/3841",
Expand Down Expand Up @@ -56,9 +64,13 @@
"render-tests/runtime-styling/image-add-sdf": "https://github.com/mapbox/mapbox-gl-native/issues/9847",
"render-tests/runtime-styling/paint-property-fill-flat-to-extrude": "https://github.com/mapbox/mapbox-gl-native/issues/6745",
"render-tests/runtime-styling/set-style-paint-property-fill-flat-to-extrude": "https://github.com/mapbox/mapbox-gl-native/issues/6745",
"render-tests/satellite-v9/z0-wide": "https://github.com/mapbox/mapbox-gl-native/pull/12611",
"render-tests/symbol-cross-fade/chinese": "https://github.com/mapbox/mapbox-gl-native/issues/10619",
"render-tests/symbol-placement/line-overscaled": "https://github.com/mapbox/mapbox-gl-js/issues/5654",
"render-tests/symbol-visibility/visible": "https://github.com/mapbox/mapbox-gl-native/issues/10409",
"render-tests/text-field/formatted-arabic": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
"render-tests/text-field/formatted-line": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
"render-tests/text-field/formatted": "skip - https://github.com/mapbox/mapbox-gl-native/pull/12624",
"render-tests/text-no-cross-source-collision/default": "skip - gl-js only",
"render-tests/text-pitch-alignment/auto-text-rotation-alignment-map": "https://github.com/mapbox/mapbox-gl-native/issues/9732",
"render-tests/text-pitch-alignment/map-text-rotation-alignment-map": "https://github.com/mapbox/mapbox-gl-native/issues/9732",
Expand Down
2 changes: 2 additions & 0 deletions scripts/generate-style-code.js
Expand Up @@ -37,6 +37,7 @@ global.evaluatedType = function (property) {
return 'bool';
case 'number':
return 'float';
case 'formatted':
case 'string':
return 'std::string';
case 'enum':
Expand Down Expand Up @@ -120,6 +121,7 @@ global.defaultValue = function (property) {
switch (property.type) {
case 'number':
return property.default;
case 'formatted':
case 'string':
return JSON.stringify(property.default || "");
case 'enum':
Expand Down

0 comments on commit 0a67f80

Please sign in to comment.