Skip to content

Commit 3330e5c

Browse files
authored
doc,src,lib: clarify experimental status of Web Storage support
PR-URL: #60708 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
1 parent 33b1574 commit 3330e5c

File tree

5 files changed

+48
-23
lines changed

5 files changed

+48
-23
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
@@ -1978,14 +1993,6 @@ added: v6.0.0
19781993

19791994
Silence all process warnings (including deprecations).
19801995

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

19911998
<!-- YAML

doc/api/globals.md

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

645645
<!-- YAML
646646
added: v22.4.0
647-
-->
647+
changes:
648+
- version: REPLACEME
649+
pr-url: https://github.com/nodejs/node/pull/60351
650+
description: Accessing the `localStorage` global without providing
651+
`--localstorage-file` now throws a `DOMException`, for
652+
compliance with the Web Storage specification.
653+
- version: v25.0.0
654+
pr-url: https://github.com/nodejs/node/pull/57666
655+
description: When webstorage is enabled and `--localstorage-file` is not
656+
provided, accessing the `localStorage` global now returns an
657+
empty object.
658+
- version: v25.0.0
659+
pr-url: https://github.com/nodejs/node/pull/57666
660+
description: This API is no longer behind `--experimental-webstorage` runtime flag.
661+
-->
662+
663+
> Stability: 1.2 - Release candidate. Disable this API with [`--no-experimental-webstorage`][].
648664
649665
A browser-compatible implementation of [`localStorage`][]. Data is stored
650666
unencrypted in the file specified by the [`--localstorage-file`][] CLI flag.
651667
The maximum amount of data that can be stored is 10 MB.
652668
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.
654669
`localStorage` data is not stored per user or per request when used in the context
655670
of a server, it is shared across all users and requests.
656671

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

10741089
<!-- YAML
10751090
added: v22.4.0
1091+
changes:
1092+
- version: v25.0.0
1093+
pr-url: https://github.com/nodejs/node/pull/57666
1094+
description: This API is no longer behind `--experimental-webstorage` runtime flag.
10761095
-->
10771096

1078-
> Stability: 1.0 - Early development.
1097+
> Stability: 1.2 - Release candidate. Disable this API with [`--no-experimental-webstorage`][].
10791098
10801099
A browser-compatible implementation of [`sessionStorage`][]. Data is stored in
10811100
memory, with a storage quota of 10 MB. `sessionStorage` data persists only within
@@ -1111,10 +1130,9 @@ added: v0.0.1
11111130
added: v22.4.0
11121131
-->
11131132

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

11191137
## `structuredClone(value[, options])`
11201138

@@ -1328,7 +1346,7 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
13281346
[`--localstorage-file`]: cli.md#--localstorage-filefile
13291347
[`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator
13301348
[`--no-experimental-websocket`]: cli.md#--no-experimental-websocket
1331-
[`--no-webstorage`]: cli.md#--no-webstorage
1349+
[`--no-experimental-webstorage`]: cli.md#--no-experimental-webstorage
13321350
[`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy
13331351
[`CompressionStream`]: webstreams.md#class-compressionstream
13341352
[`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)