From 763fa6249e517d7490f53cbeca2128abf77f98a4 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 28 Jul 2022 18:28:32 +0200 Subject: [PATCH 1/3] Generate code for the ES6 target --- bin/wasm-node/CHANGELOG.md | 4 ++++ bin/wasm-node/javascript/tsconfig-cjs.json | 4 ++-- bin/wasm-node/javascript/tsconfig-mjs.json | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/wasm-node/CHANGELOG.md b/bin/wasm-node/CHANGELOG.md index 1d7ad5b33e..70d7d09cc5 100644 --- a/bin/wasm-node/CHANGELOG.md +++ b/bin/wasm-node/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Changed + +- The JavaScript code now targets ES6. This should ensure compatibility on a wider range of platforms. + ## 0.6.26 - 2022-07-20 ### Added diff --git a/bin/wasm-node/javascript/tsconfig-cjs.json b/bin/wasm-node/javascript/tsconfig-cjs.json index d3c03e1211..cf52f034dc 100644 --- a/bin/wasm-node/javascript/tsconfig-cjs.json +++ b/bin/wasm-node/javascript/tsconfig-cjs.json @@ -2,9 +2,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "lib": [ - "es2015" + "es6" ], - "target": "es2015", + "target": "es6", "module": "commonjs", "outDir": "./dist/cjs", }, diff --git a/bin/wasm-node/javascript/tsconfig-mjs.json b/bin/wasm-node/javascript/tsconfig-mjs.json index fbcf0562de..707392a1ee 100644 --- a/bin/wasm-node/javascript/tsconfig-mjs.json +++ b/bin/wasm-node/javascript/tsconfig-mjs.json @@ -2,10 +2,10 @@ "extends": "./tsconfig.json", "compilerOptions": { "lib": [ - "es2020" + "es6", ], - "target": "es2020", - "module": "es2020", + "target": "es6", + "module": "es6", "outDir": "./dist/mjs", } } From 5878e9747e6fa5feda56e9977976015f7ef1cb1a Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 28 Jul 2022 18:29:37 +0200 Subject: [PATCH 2/3] PR number --- bin/wasm-node/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/wasm-node/CHANGELOG.md b/bin/wasm-node/CHANGELOG.md index 70d7d09cc5..0d08058851 100644 --- a/bin/wasm-node/CHANGELOG.md +++ b/bin/wasm-node/CHANGELOG.md @@ -4,7 +4,7 @@ ### Changed -- The JavaScript code now targets ES6. This should ensure compatibility on a wider range of platforms. +- The JavaScript code now targets ES6. This should ensure compatibility on a wider range of platforms. ([#2565](https://github.com/paritytech/smoldot/pull/2565)) ## 0.6.26 - 2022-07-20 From 6957038a5fb361fb820bfcd0ad433ace4d8b9c5a Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 28 Jul 2022 18:32:10 +0200 Subject: [PATCH 3/3] Also enable downlevelIteration --- bin/wasm-node/javascript/tsconfig-cjs.json | 1 + bin/wasm-node/javascript/tsconfig-mjs.json | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/wasm-node/javascript/tsconfig-cjs.json b/bin/wasm-node/javascript/tsconfig-cjs.json index cf52f034dc..052d0ad10e 100644 --- a/bin/wasm-node/javascript/tsconfig-cjs.json +++ b/bin/wasm-node/javascript/tsconfig-cjs.json @@ -6,6 +6,7 @@ ], "target": "es6", "module": "commonjs", + "downlevelIteration": true, "outDir": "./dist/cjs", }, } diff --git a/bin/wasm-node/javascript/tsconfig-mjs.json b/bin/wasm-node/javascript/tsconfig-mjs.json index 707392a1ee..d7a08123f1 100644 --- a/bin/wasm-node/javascript/tsconfig-mjs.json +++ b/bin/wasm-node/javascript/tsconfig-mjs.json @@ -6,6 +6,7 @@ ], "target": "es6", "module": "es6", + "downlevelIteration": true, "outDir": "./dist/mjs", } }