Skip to content

Commit

Permalink
fix wasm by setting the minimum node version to 18
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jun 26, 2024
1 parent 34649fe commit c8d1c4e
Show file tree
Hide file tree
Showing 28 changed files with 30 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

# Note: These tests break with node version 18. Something about WebAssembly.
- name: Rollup Tests
run: make test-rollup

Expand All @@ -87,7 +88,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

- name: Setup Deno 1.40.0
uses: denoland/setup-deno@main
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Unreleased

* Drop support for older versions of Windows ([#3802](https://github.com/evanw/esbuild/issues/3802))
* Drop support for older platforms ([#3802](https://github.com/evanw/esbuild/issues/3802))

This release drops support for the following operating systems:

Expand All @@ -22,6 +22,8 @@
./esbuild.exe --version
```
In addition, this release increases the minimum required node version for esbuild's JavaScript API from node 12 to node 18. Node 18 is the oldest version of node that is still being supported (see node's [release schedule](https://nodejs.org/en/about/previous-releases) for more information). This increase is because of an incompatibility between the JavaScript that the Go compiler generates for the `esbuild-wasm` package and versions of node before node 17.4 (specifically the `crypto.getRandomValues` function).
## 0.21.5
* Fix `Symbol.metadata` on classes without a class decorator ([#3781](https://github.com/evanw/esbuild/issues/3781))
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/aix-ppc64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"aix"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/android-arm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"android"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/android-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"android"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/android-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"android"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/freebsd-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"freebsd"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/freebsd-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"freebsd"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-arm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-ia32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-loong64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-mips64el/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-ppc64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-riscv64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-s390x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/linux-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"linux"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/netbsd-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"license": "MIT",
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"netbsd"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/openbsd-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"openbsd"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/sunos-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"sunos"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/win32-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"win32"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/win32-ia32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"win32"
Expand Down
2 changes: 1 addition & 1 deletion npm/@esbuild/win32-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "MIT",
"preferUnplugged": true,
"engines": {
"node": ">=12"
"node": ">=18"
},
"os": [
"win32"
Expand Down
11 changes: 0 additions & 11 deletions npm/esbuild-wasm/bin/esbuild
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,5 @@ for (let key in process.env) {
}
}

// Node v19 introduced "globalThis.crypto" https://github.com/nodejs/node/pull/44897.
// This broke Go's WebAssembly shim: https://github.com/golang/go/issues/56860.
// Hack around this breakage by resetting "globalThis.crypto" to "writable".
// Just to be safe, also make it "configurable" in case Go updates their
// compiler such that it tries to reconfigure "globalThis.crypto" itself.
Object.defineProperty(globalThis, 'crypto', {
value: globalThis.crypto || require('crypto').webcrypto,
writable: true,
configurable: true,
});

process.argv.splice(2, 0, esbuild_wasm);
wrapper(module_.createRequire(wasm_exec_node), Object.assign(Object.create(WebAssembly), { instantiate }));
2 changes: 1 addition & 1 deletion npm/esbuild-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"license": "MIT",
"engines": {
"node": ">=12"
"node": ">=18"
},
"main": "lib/main.js",
"browser": "lib/browser.js",
Expand Down
2 changes: 1 addition & 1 deletion npm/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"main": "lib/main.js",
"types": "lib/main.d.ts",
"engines": {
"node": ">=12"
"node": ">=18"
},
"bin": {
"esbuild": "bin/esbuild"
Expand Down

0 comments on commit c8d1c4e

Please sign in to comment.