Hello guys, with the latest Node.js v22 release, W...
# webassembly
g
Hello guys, with the latest Node.js v22 release, WasmGC is enable by default. With that said, code like:
Copy code
rootProject.extensions.findByType<NodeJsRootExtension>()?.apply {
    version = "v22.0.0-v8-canary20240219209428711c"
    downloadBaseUrl = "<https://nodejs.org/download/v8-canary>"
}
can be removed. I’ve Node.js 22 installed:
Copy code
➜ ~ node -v
v22.0.0
➜ ~ npm -v 
10.5.1
But if I run my wasm target, inside
user/.gradle/nodejs
folder, I’ll find node-v20.10.0-darwin-arm64 instead of node-v22.0.0-darwin-arm64 which only gets installed if I specify it:
Copy code
rootProject.extensions.findByType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>()?.apply {
    version = "22.0.0"
}
So, which default setting (
wasmJsBrowserDevelopmentRun
?) is responsible for using Node.js v20 instead of system version? @bashor any idea?
a
So, the extension is responsible for the Node version:
Copy code
rootProject.extensions.findByType<NodeJsRootExtension>()?.apply {
    version = ...
}
By default we are using Node.js 20, but it's only for right now, we are working on the migration to v22
👍 1
g
Btw, shouldn’t the download option be false by default and system node version used instead, and only download if not compatible with Wasm or if inexistent? 🤔
b
cc @Ilya Goncharov [JB]