Skip to content

Commit c144f98

Browse files
committed
doc,src,lib: clarify experimental status of Web Storage support
1 parent da71ab6 commit c144f98

File tree

5 files changed

+42
-22
lines changed

5 files changed

+42
-22
lines changed

doc/api/cli.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,10 +1745,11 @@ surface on other platforms, but the performance impact may be severe.
17451745
added: v22.4.0
17461746
-->
17471747

1748+
> Stability: 1.2 - Release candidate.
1749+
17481750
The file used to store `localStorage` data. If the file does not exist, it is
17491751
created the first time `localStorage` is accessed. The same file may be shared
1750-
between multiple Node.js processes concurrently. This flag is a no-op if
1751-
Node.js is started with the `--no-webstorage` (or `--no-experimental-webstorage`) flag.
1752+
between multiple Node.js processes concurrently.
17521753

17531754
### `--max-http-header-size=size`
17541755

@@ -1910,6 +1911,20 @@ added: v22.0.0
19101911

19111912
Disable exposition of {WebSocket} on the global scope.
19121913

1914+
### `--no-experimental-webstorage`
1915+
1916+
<!-- YAML
1917+
added: v22.4.0
1918+
changes:
1919+
- version: v25.0.0
1920+
pr-url: https://github.com/nodejs/node/pull/57666
1921+
description: The feature is now enabled by default.
1922+
-->
1923+
1924+
> Stability: 1.2 - Release candidate.
1925+
1926+
Disable [`Web Storage`][] support.
1927+
19131928
### `--no-extra-info-on-fatal-exception`
19141929

19151930
<!-- YAML
@@ -1977,14 +1992,6 @@ added: v6.0.0
19771992

19781993
Silence all process warnings (including deprecations).
19791994

1980-
### `--no-webstorage`
1981-
1982-
<!-- YAML
1983-
added: v25.0.0
1984-
-->
1985-
1986-
Disable [`Web Storage`][] support.
1987-
19881995
### `--node-memory-debug`
19891996

19901997
<!-- YAML

doc/api/globals.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -644,13 +644,23 @@ A browser-compatible implementation of {Headers}.
644644

645645
<!-- YAML
646646
added: v22.4.0
647+
changes:
648+
- version: v25.2.0
649+
pr-url: https://github.com/nodejs/node/pull/60351
650+
description: As specified by the Web Storage specification, accessing this
651+
global without providing `--localstorage-file` throws a
652+
`DOMException`.
653+
- version: v25.0.0
654+
pr-url: https://github.com/nodejs/node/pull/57666
655+
description: This API is no longer behind `--experimental-webstorage` runtime flag.
647656
-->
648657

658+
> Stability: 1.2 - Release candidate. Disable this API with [`--no-experimental-webstorage`][].
659+
649660
A browser-compatible implementation of [`localStorage`][]. Data is stored
650661
unencrypted in the file specified by the [`--localstorage-file`][] CLI flag.
651662
The maximum amount of data that can be stored is 10 MB.
652663
Any modification of this data outside of the Web Storage API is not supported.
653-
Disable this API with the [`--no-webstorage`][] (or its alias `--no-experimental-webstorage`) CLI flag.
654664
`localStorage` data is not stored per user or per request when used in the context
655665
of a server, it is shared across all users and requests.
656666

@@ -1073,9 +1083,13 @@ A browser-compatible implementation of {Request}.
10731083

10741084
<!-- YAML
10751085
added: v22.4.0
1086+
changes:
1087+
- version: v25.0.0
1088+
pr-url: https://github.com/nodejs/node/pull/57666
1089+
description: This API is no longer behind `--experimental-webstorage` runtime flag.
10761090
-->
10771091

1078-
> Stability: 1.0 - Early development.
1092+
> Stability: 1.2 - Release candidate. Disable this API with [`--no-experimental-webstorage`][].
10791093
10801094
A browser-compatible implementation of [`sessionStorage`][]. Data is stored in
10811095
memory, with a storage quota of 10 MB. `sessionStorage` data persists only within
@@ -1111,10 +1125,9 @@ added: v0.0.1
11111125
added: v22.4.0
11121126
-->
11131127

1114-
> Stability: 1.0 - Early development.
1128+
> Stability: 1.2 - Release candidate. Disable this API with [`--no-experimental-webstorage`][].
11151129
1116-
A browser-compatible implementation of {Storage}. Disable this API with the
1117-
[`--no-webstorage`][] (or its alias `--no-experimental-webstorage`) CLI flag.
1130+
A browser-compatible implementation of {Storage}.
11181131

11191132
## `structuredClone(value[, options])`
11201133

@@ -1328,7 +1341,7 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
13281341
[`--localstorage-file`]: cli.md#--localstorage-filefile
13291342
[`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator
13301343
[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket
1331-
[`--no-webstorage`]: cli.md#--no-webstorage
1344+
[`--no-experimental-webstorage`]: cli.md#--no-experimental-webstorage
13321345
[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
13331346
[`CompressionStream`]: webstreams.md#class-compressionstream
13341347
[`CountQueuingStrategy`]: webstreams.md#class-countqueuingstrategy

doc/node.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ Enable experimental support for the EventSource Web API.
207207
.It Fl -no-experimental-websocket
208208
Disable experimental support for the WebSocket API.
209209
.
210-
.It Fl -no-webstorage
211-
Disable webstorage.
210+
.It Fl -no-experimental-webstorage
211+
Disable experimental support for the Web Storage API.
212212
.
213213
.It Fl -no-experimental-repl-await
214214
Disable top-level await keyword support in REPL.

lib/internal/process/pre_execution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ function setupQuic() {
398398

399399
function setupWebStorage() {
400400
if (getEmbedderOptions().noBrowserGlobals ||
401-
!getOptionValue('--webstorage')) {
401+
!getOptionValue('--experimental-webstorage')) {
402402
return;
403403
}
404404

src/node_options.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,12 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
567567
NoOp{},
568568
#endif
569569
kAllowedInEnvvar);
570-
AddOption("--webstorage",
571-
"Web Storage API",
570+
AddOption("--experimental-webstorage",
571+
"experimental Web Storage API",
572572
&EnvironmentOptions::webstorage,
573573
kAllowedInEnvvar,
574574
true);
575-
AddAlias("--experimental-webstorage", "--webstorage");
575+
AddAlias("--webstorage", "--experimental-webstorage");
576576
AddOption("--localstorage-file",
577577
"file used to persist localStorage data",
578578
&EnvironmentOptions::localstorage_file,

0 commit comments

Comments
 (0)