Skip to content

Commit 58afcc2

Browse files
mhdawsondanielleadams
authored andcommitted
wasi: no longer require flag to enable wasi
- no longer require flag to enable experimental wasi feature - wasi is still documented as experimental Signed-off-by: Michael Dawson <[email protected]> PR-URL: #47286 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent b1bcdce commit 58afcc2

17 files changed

+8
-84
lines changed

doc/api/cli.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,10 @@ added:
466466
- v13.3.0
467467
- v12.16.0
468468
changes:
469+
- version: REPLACEME
470+
pr-url: https://github.com/nodejs/node/pull/47286
471+
description: This option is no longer required as WASI is
472+
enabled by default, but can still be passed.
469473
- version: v13.6.0
470474
pr-url: https://github.com/nodejs/node/pull/30980
471475
description: changed from `--experimental-wasi-unstable-preview0` to

doc/api/wasi.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ Use [wabt](https://github.com/WebAssembly/wabt) to compile `.wat` to `.wasm`
103103
$ wat2wasm demo.wat
104104
```
105105

106-
The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
107-
example to run.
108-
109106
## Class: `WASI`
110107

111108
<!-- YAML

doc/node.1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ Select extension resolution algorithm for ES Modules; either 'explicit' (default
179179
Enable experimental ES module support in VM module.
180180
.
181181
.It Fl -experimental-wasi-unstable-preview1
182-
Enable experimental WebAssembly System Interface support.
182+
Enable experimental WebAssembly System Interface support. This
183+
flag is no longer required as WASI is enabled by default.
183184
.
184185
.It Fl -experimental-wasm-modules
185186
Enable experimental WebAssembly module support.

lib/internal/process/pre_execution.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ function prepareExecution(options) {
7070
initializeReport();
7171
initializeSourceMapsHandlers();
7272
initializeDeprecations();
73-
initializeWASI();
7473
require('internal/dns/utils').initializeDns();
7574

7675
if (isMainThread) {
@@ -532,13 +531,6 @@ function readPolicyFromDisk() {
532531
}
533532
}
534533

535-
function initializeWASI() {
536-
const { BuiltinModule } = require('internal/bootstrap/loaders');
537-
const mod = BuiltinModule.map.get('wasi');
538-
mod.canBeRequiredByUsers =
539-
getOptionValue('--experimental-wasi-unstable-preview1');
540-
}
541-
542534
function initializeCJSLoader() {
543535
const CJSLoader = require('internal/modules/cjs/loader');
544536
if (!getEmbedderOptions().noGlobalSearchPaths) {

src/node_options.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
428428
kAllowedInEnvvar);
429429
AddOption("--experimental-worker", "", NoOp{}, kAllowedInEnvvar);
430430
AddOption("--experimental-report", "", NoOp{}, kAllowedInEnvvar);
431-
AddOption("--experimental-wasi-unstable-preview1",
432-
"experimental WASI support",
433-
&EnvironmentOptions::experimental_wasi,
434-
kAllowedInEnvvar);
431+
AddOption(
432+
"--experimental-wasi-unstable-preview1", "", NoOp{}, kAllowedInEnvvar);
435433
AddOption("--expose-internals", "", &EnvironmentOptions::expose_internals);
436434
AddOption("--frozen-intrinsics",
437435
"experimental frozen intrinsics support",

src/node_options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ class EnvironmentOptions : public Options {
185185

186186
bool syntax_check_only = false;
187187
bool has_eval_string = false;
188-
bool experimental_wasi = false;
189188
std::string eval_string;
190189
bool print_eval = false;
191190
bool force_repl = false;

test/parallel/test-repl-built-in-modules.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

test/wasi/test-return-on-exit.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-wasi-unstable-preview1
21
'use strict';
32
const common = require('../common');
43
const assert = require('assert');

test/wasi/test-wasi-initialize-validation.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-wasi-unstable-preview1
21
'use strict';
32

43
const common = require('../common');

test/wasi/test-wasi-not-started.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ if (process.argv[2] === 'wasi-child') {
2828
const cp = require('child_process');
2929

3030
const child = cp.spawnSync(process.execPath, [
31-
'--experimental-wasi-unstable-preview1',
3231
__filename,
3332
'wasi-child',
3433
], {

test/wasi/test-wasi-options-validation.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
// Flags: --experimental-wasi-unstable-preview1
4-
53
require('../common');
64
const assert = require('assert');
75
const { WASI } = require('wasi');

test/wasi/test-wasi-require-flag.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/wasi/test-wasi-start-validation.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-wasi-unstable-preview1
21
'use strict';
32

43
const common = require('../common');

test/wasi/test-wasi-stdio.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-wasi-unstable-preview1
21
'use strict';
32
const common = require('../common');
43
const tmpdir = require('../common/tmpdir');

test/wasi/test-wasi-symlinks.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ if (process.argv[2] === 'wasi-child') {
6363
console.log('executing', options.test);
6464
const opts = { env: { ...process.env, NODE_DEBUG_NATIVE: 'wasi' } };
6565
const child = cp.spawnSync(process.execPath, [
66-
'--experimental-wasi-unstable-preview1',
6766
__filename,
6867
'wasi-child',
6968
options.test,

test/wasi/test-wasi-worker-terminate.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-wasi-unstable-preview1
21
'use strict';
32

43
const common = require('../common');

test/wasi/test-wasi.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ if (process.argv[2] === 'wasi-child') {
4949
opts.input = options.stdin;
5050

5151
const child = cp.spawnSync(process.execPath, [
52-
'--experimental-wasi-unstable-preview1',
5352
__filename,
5453
'wasi-child',
5554
options.test,

0 commit comments

Comments
 (0)