From 3c90c732e1b992b7976104f15bb51a2cc3f684af Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 23 Sep 2026 11:25:13 +0200 Subject: [PATCH] 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 --- android/.gitignore | 2 -- .../java/com/keyman/engine/KMManager.java | 2 -- android/KMEA/build.sh | 4 --- package-lock.json | 23 ------------ web/src/app/webview/build.sh | 2 -- web/src/app/webview/map-polyfill-bundler.js | 35 ------------------- web/src/app/webview/src/polyfill/map.ts | 11 ------ .../predictive-text/worker-main/package.json | 3 +- .../worker-thread/package.json | 1 - .../src/keyboard/keyboards/activeLayout.ts | 5 ++- .../manual/embed/android-harness/build.sh | 1 - 11 files changed, 3 insertions(+), 86 deletions(-) delete mode 100644 web/src/app/webview/map-polyfill-bundler.js delete mode 100644 web/src/app/webview/src/polyfill/map.ts diff --git a/android/.gitignore b/android/.gitignore index e822a25c2b..7c298cad5c 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -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 diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java index 80701ad683..b0e8661b95 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java @@ -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"; diff --git a/android/KMEA/build.sh b/android/KMEA/build.sh index 66471c0bbb..14dc821f19 100755 --- a/android/KMEA/build.sh +++ b/android/KMEA/build.sh @@ -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 diff --git a/package-lock.json b/package-lock.json index 88b8c7f08b..e473b783b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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" }, diff --git a/web/src/app/webview/build.sh b/web/src/app/webview/build.sh index cce218ba6d..dceaf19715 100755 --- a/web/src/app/webview/build.sh +++ b/web/src/app/webview/build.sh @@ -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 } diff --git a/web/src/app/webview/map-polyfill-bundler.js b/web/src/app/webview/map-polyfill-bundler.js deleted file mode 100644 index 257f897e70..0000000000 --- a/web/src/app/webview/map-polyfill-bundler.js +++ /dev/null @@ -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/' -}); \ No newline at end of file diff --git a/web/src/app/webview/src/polyfill/map.ts b/web/src/app/webview/src/polyfill/map.ts deleted file mode 100644 index a9299df769..0000000000 --- a/web/src/app/webview/src/polyfill/map.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/web/src/engine/predictive-text/worker-main/package.json b/web/src/engine/predictive-text/worker-main/package.json index dc6301e113..1ae13a4011 100644 --- a/web/src/engine/predictive-text/worker-main/package.json +++ b/web/src/engine/predictive-text/worker-main/package.json @@ -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" } } diff --git a/web/src/engine/predictive-text/worker-thread/package.json b/web/src/engine/predictive-text/worker-thread/package.json index 7263f20b7c..af87bce811 100644 --- a/web/src/engine/predictive-text/worker-thread/package.json +++ b/web/src/engine/predictive-text/worker-thread/package.json @@ -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" } diff --git a/web/src/engine/src/keyboard/keyboards/activeLayout.ts b/web/src/engine/src/keyboard/keyboards/activeLayout.ts index 0aad7376fd..8952ba8ebc 100644 --- a/web/src/engine/src/keyboard/keyboards/activeLayout.ts +++ b/web/src/engine/src/keyboard/keyboards/activeLayout.ts @@ -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]; diff --git a/web/src/test/manual/embed/android-harness/build.sh b/web/src/test/manual/embed/android-harness/build.sh index 81d141bc23..e67d359e7a 100755 --- a/web/src/test/manual/embed/android-harness/build.sh +++ b/web/src/test/manual/embed/android-harness/build.sh @@ -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