From 688dde7bf69a913fb60458823514b8ab999e4d33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 16:26:38 +0530 Subject: [PATCH] build(dev): ignore removing private fields --- packages/dev/scripts/polkadot-dev-build-ts.mjs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/dev/scripts/polkadot-dev-build-ts.mjs b/packages/dev/scripts/polkadot-dev-build-ts.mjs index a11709bb..215111fe 100755 --- a/packages/dev/scripts/polkadot-dev-build-ts.mjs +++ b/packages/dev/scripts/polkadot-dev-build-ts.mjs @@ -71,17 +71,7 @@ async function compileJs (compileType, type) { // split src prefix, replace .ts extension with .js const outFile = path.join(buildDir, filename.split(/[\\/]/).slice(1).join('/').replace(/\.tsx?$/, '.js')); - // Until we hit the es2022 target, all private fields are compiled to using - // WeakMap with less than stellar performannce of get/set on the polyfill. We - // replace usages of these with TS-only private fields. - // - // As used these are internal-only, completely hidden fields should be done via - // closures, see e.g. the common keypairs where this is done - const source = fs - .readFileSync(filename, 'utf-8') - .replace(/(this|other|source)\.#/g, '$1.__internal__') - .replace(/ {2}(async|readonly) #/g, ' private $1 __internal__') - .replace(/ {2}#/g, ' private __internal__'); + const source = fs.readFileSync(filename, 'utf-8'); // compile with the options aligning with our tsconfig const { outputText } = ts.transpileModule(source, {