From 0fdcb97575fb9c8b13e6fc6a54d679e2cfb929f7 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Sun, 12 Oct 2025 21:46:09 -0500 Subject: [PATCH] [Dev] Add polyfill for ES2025 iterator (#6654) --- package.json | 1 + pnpm-lock.yaml | 8 ++++++++ src/polyfills.ts | 7 ++++++- tsconfig.json | 7 ++++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6bc858ec2d6..c0b5b26757b 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "dependencies": { "@material/material-color-utilities": "^0.3.0", "compare-versions": "^6.1.1", + "core-js": "^3.46.0", "crypto-js": "^4.2.0", "i18next": "^25.5.3", "i18next-browser-languagedetector": "^8.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eaa1cad1a7f..133ee8b85b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: compare-versions: specifier: ^6.1.1 version: 6.1.1 + core-js: + specifier: ^3.46.0 + version: 3.46.0 crypto-js: specifier: ^4.2.0 version: 4.2.0 @@ -961,6 +964,9 @@ packages: resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} engines: {node: '>= 0.6'} + core-js@3.46.0: + resolution: {integrity: sha512-vDMm9B0xnqqZ8uSBpZ8sNtRtOdmfShrvT6h2TuQGLs0Is+cR0DYbj/KWP6ALVNbWPpqA/qPLoOuppJN07humpA==} + core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -2800,6 +2806,8 @@ snapshots: cookie@0.7.2: {} + core-js@3.46.0: {} + core-util-is@1.0.3: {} cross-fetch@4.0.0: diff --git a/src/polyfills.ts b/src/polyfills.ts index 8666629fceb..b36c31b5d1b 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -1,5 +1,5 @@ /* -Manual rolling of polyfills desired by the project. +Manual rolling or other polyfills desired by the project. IMPORTANT: When adding / removing polyfills, ensure that typescript becomes aware of their existence, either by creating `src/typings/polyfills.d.ts` @@ -19,3 +19,8 @@ if (typeof Promise.withResolvers === "undefined") { return { promise, resolve, reject }; }; } + +import "core-js/stable/set"; +import "core-js/stable/iterator"; +import "core-js/stable/map/group-by"; +import "core-js/stable/object/group-by"; diff --git a/tsconfig.json b/tsconfig.json index 6b06c8c78b9..bf42d7204ea 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,12 @@ "DOM.AsyncIterable", "DOM.Iterable", "ScriptHost", - "WebWorker.ImportScripts" + "WebWorker.ImportScripts", + "ES2024.Object", + // NOTE: Be *very* mindful of these when updating typescript versions, + // as their definitions may change in breaking ways + "ESNext.Iterator", + "ESNext.Collection" ], "skipLibCheck": true, // Safe and almost always beneficial "moduleResolution": "bundler",