wasm: patch wasm_exec.js and wasm_exec_node.js from Go 1.18+#5483
wasm: patch wasm_exec.js and wasm_exec_node.js from Go 1.18+#5483Darckfast wants to merge 3 commits into
Conversation
Port this commit golang/go@680caf1 removing polyfills from `wasm_exec.js`, now the environment is expected to provide all the required polyfills. `wasm_exec.js` now only provides stub fallbacks for globalThis.fs and globalThis.process. All NodeJS specific code is now in a separate file `wasm_exec_node.js` with its required polyfills.
|
@Darckfast thanks for working on this. Please note test failures: https://github.com/tinygo-org/tinygo/actions/runs/28388339892/job/84268546073?pr=5483 |
|
@deadprogram thx for the ping what happened is, on NodeJS 18 my question is, does it make sense to still provide support for NodeJS 18? or we could drop it in place of an LTS version (+22)? this way i could trim some polyfill down |
|
NodeJS 18 has EOL date more than a year ago (2025-04-30) - in my opinion, it could be dropped. |
I would agree. The current Node LTS v22 seems quite reasonable. |
|
i agree too, also it will be less code to maintain in the long run i will update the PR with these changes |
Drops official support for NodeJS 18 for WASM by removing the provided polyfills in the `wasm_exec.js`. Now the environment is expected to provide the polyfill if it is running on older NodeJS versions The new minimum required version for WASM is NodeJS 22+.
`wasm_exec_node.js` no longer contains the polyfill for NodeJS 18
|
bump'ed the node version to 22, but i couldn't find in the macOs, windows, and Linux CI where the node version is being set, only do you guys know where it gets installed from? |
|
Except for the Linux install, the default for that OS should be the only one installed, which is mostly 22.x See |
thx, then we should be good in that regard can i get some help with this failing test https://github.com/tinygo-org/tinygo/actions/runs/28546702015/job/84720226561?pr=5483 ? i took a look and i dont know why the |
|
|
Port these commits:
golang/go@680caf1 Removes polyfills from
wasm_exec.jsgolang/go@04d8d24 Enables ECMAScript strict mode on
wasm_exec.jsgolang/go@ff34676 Replace deprecated
substrwithsubstringthis fixes #5370
NOTE: i added some polyfill on
wasmexit.js,wasmfunc.jsandwasmfunc.jstests files to keep compatibility with node 18