chore(android): remove unused map-polyfill.js and es6-shim.min.js polyfills

These files were copied in but never referenced in 19.0 source.

Fixes: #16583
Test-bot: skip
This commit is contained in:
Marc Durdin 2026-09-23 11:25:13 +02:00
parent 298fa3b233
commit 3c90c732e1
11 changed files with 3 additions and 86 deletions

2
android/.gitignore vendored
View file

@ -37,10 +37,8 @@ KMEA/**/assets/keymanandroid.js
KMEA/**/assets/keyman.js.map
KMEA/**/assets/keymanweb-webview.js
KMEA/**/assets/keymanweb-webview.js.map
KMEA/**/assets/map-polyfill.js
KMEA/**/assets/sentry.min.js
KMEA/**/assets/keyman-sentry.js
KMEA/**/assets/es6-shim.min.js
KMEA/**/assets/kmwosk.css
KMEA/**/assets/globe-hint.css
KMEA/**/assets/resources

View file

@ -380,9 +380,7 @@ public final class KMManager {
protected static final String KMFilename_KmwCss = "kmwosk.css";
protected static final String KMFilename_KmwGlobeHintCss = "globe-hint.css";
protected static final String KMFilename_Osk_Ttf_Font = "keymanweb-osk.ttf";
protected static final String KMFilename_JSPolyfill = "es6-shim.min.js";
protected static final String KMFilename_JSPolyfill2 = "other-polyfills.js";
protected static final String KMFilename_JSPolyfill3 = "map-polyfill.js";
// Deprecated by KeyboardController.KMFilename_Installed_KeyboardsList
public static final String KMFilename_KeyboardsList = "keyboards_list.dat";

View file

@ -55,16 +55,12 @@ do_build() {
builder_echo "Copying Keyman Web artifacts"
cp "$KEYMAN_ROOT/web/build/app/webview/$BUILDER_CONFIGURATION/keymanweb-webview.js" "$ENGINE_ASSETS/"
cp "$KEYMAN_ROOT/web/build/app/webview/$BUILDER_CONFIGURATION/keymanweb-webview.js.map" "$ENGINE_ASSETS/"
cp "$KEYMAN_ROOT/web/build/app/webview/$BUILDER_CONFIGURATION/map-polyfill.js" "$ENGINE_ASSETS/"
cp "$KEYMAN_ROOT/web/build/app/resources/osk/ajax-loader.gif" "$ENGINE_ASSETS/"
cp "$KEYMAN_ROOT/web/build/app/resources/osk/kmwosk.css" "$ENGINE_ASSETS/"
cp "$KEYMAN_ROOT/web/build/app/resources/osk/globe-hint.css" "$ENGINE_ASSETS/"
cp "$KEYMAN_ROOT/web/build/app/resources/osk/keymanweb-osk.ttf" "$ENGINE_ASSETS/"
cp "$KEYMAN_ROOT/common/web/sentry-manager/build/lib/index.js" "$ENGINE_ASSETS/keyman-sentry.js"
builder_echo "Copying es6-shim polyfill"
cp "$KEYMAN_ROOT/node_modules/es6-shim/es6-shim.min.js" "$ENGINE_ASSETS/"
builder_echo "BUILD_FLAGS $BUILD_FLAGS"
# Build without test

23
package-lock.json generated
View file

@ -2844,23 +2844,6 @@
"node": ">= 14"
}
},
"node_modules/@npmcli/agent/node_modules/debug": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz",
"integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==",
"dev": true,
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/@npmcli/agent/node_modules/https-proxy-agent": {
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz",
@ -7607,10 +7590,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/es6-shim": {
"version": "0.35.6",
"license": "MIT"
},
"node_modules/esbuild": {
"version": "0.28.1",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
@ -15286,7 +15265,6 @@
"@keymanapp/keyman-version": "*",
"@keymanapp/models-templates": "*",
"@keymanapp/models-wordbreakers": "*",
"es6-shim": "^0.35.5",
"string.prototype.codepointat": "^0.2.1"
},
"devDependencies": {
@ -15302,7 +15280,6 @@
"@keymanapp/keyman-version": "*",
"@keymanapp/models-templates": "*",
"@keymanapp/models-wordbreakers": "*",
"es6-shim": "^0.35.5",
"string.prototype.codepointat": "^0.2.1",
"string.prototype.startswith": "^0.2.0"
},

View file

@ -83,8 +83,6 @@ compile_and_copy() {
"$script" "$sourcemap" --clean
done
node map-polyfill-bundler.js
# For dependent test pages.
builder_launch /web/src/test/manual/embed/android-harness/build.sh configure,build
}

View file

@ -1,35 +0,0 @@
/*
* Note: while this file is not meant to exist long-term, it provides a nice
* low-level proof-of-concept for esbuild bundling of the various Web submodules.
*
* Add some extra code at the end of src/index.ts and run it to verify successful bundling!
*/
import esbuild from 'esbuild';
import { iifeConfiguration, prepareTslibTreeshaking } from '../../../../common/tools/es-bundling/build/index.mjs';
const commonConfig = {
...iifeConfiguration,
entryPoints: {
'index': '../../../build/app/webview/obj/polyfill/map.js',
},
outfile: '../../../build/app/webview/debug/map-polyfill.js',
// `esbuild`'s sourcemap output puts relative paths to the original sources from the
// directory of the build output. The following keeps repo structure intact and
// puts our code under a common 'namespace' of sorts.
sourceRoot: '@keymanapp/keyman/web/build/app/webview/debug/'
};
await prepareTslibTreeshaking(commonConfig, /worker-main\.wrapped(?:\.min)?\.js/);
await esbuild.build(commonConfig);
await esbuild.build({
...commonConfig,
minify: true,
outfile: '../../../build/app/webview/release/map-polyfill.js',
// `esbuild`'s sourcemap output puts relative paths to the original sources from the
// directory of the build output. The following keeps repo structure intact and
// puts our code under a common 'namespace' of sorts.
sourceRoot: '@keymanapp/keyman/web/build/app/webview/release/'
});

View file

@ -1,11 +0,0 @@
// A separate build-product needed to support KMW when running in legacy ES5 mode for
// non-updated Chrome WebViews (like with Android API 21 / 5.0)
// @ts-ignore
import { default as Map } from "core-js/stable/map";
// @ts-ignore
import { default as Symbol } from "core-js/stable/symbol";
// @ts-ignore
Window['Symbol'] = Symbol;
// @ts-ignore
Window['Map'] = Map;

View file

@ -47,10 +47,9 @@
"typescript": "^5.4.5"
},
"dependencies": {
"@keymanapp/keyman-version": "*",
"@keymanapp/models-templates": "*",
"@keymanapp/models-wordbreakers": "*",
"@keymanapp/keyman-version": "*",
"es6-shim": "^0.35.5",
"string.prototype.codepointat": "^0.2.1"
}
}

View file

@ -39,7 +39,6 @@
"@keymanapp/keyman-version": "*",
"@keymanapp/models-templates": "*",
"@keymanapp/models-wordbreakers": "*",
"es6-shim": "^0.35.5",
"string.prototype.codepointat": "^0.2.1",
"string.prototype.startswith": "^0.2.0"
}

View file

@ -311,9 +311,8 @@ export class ActiveKeyBase {
// And now for generalized type validation. -----------------------------------------
// WARNING: Object.values and Object.entries is NOT polyfilled by es6-shim and thus
// is NOT available within the Android app in extremely early APIs.
// Object.entries requires Android 54.
// WARNING: Object.values and Object.entries is NOT available within the
// Android app in extremely early APIs. Object.entries requires Android 54.
for(const key of Object.keys(KeyTypesOfKeyMap)) {
const value = KeyTypesOfKeyMap[key as keyof typeof KeyTypesOfKeyMap];

View file

@ -46,7 +46,6 @@ if builder_start_action build; then
# We shouldn't rely on a prior Android build for these files! We can retrieve them separately.
cp "$KEYMAN_ROOT/common/web/sentry-manager/build/lib/index.js" "host/keyman-sentry.js"
cp "$KEYMAN_ROOT/node_modules/es6-shim/es6-shim.min.js" "host/es6-shim.min.js"
# Test keyboards