| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent eb1e671 commit 3312e4e
14 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ function nextLocalStorage() { | |||
| 12 | 12 | } | |
| 13 | 13 | ||
| 14 | 14 | const options = { | |
| 15 | - flags: ['--experimental-webstorage', `--localstorage-file=${nextLocalStorage()}`], | ||
| 15 | + flags: [`--localstorage-file=${nextLocalStorage()}`], | ||
| 16 | 16 | }; | |
| 17 | 17 | ||
| 18 | 18 | const bench = common.createBenchmark(main, { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ function nextLocalStorage() { | |||
| 12 | 12 | } | |
| 13 | 13 | ||
| 14 | 14 | const options = { | |
| 15 | - flags: ['--experimental-webstorage', `--localstorage-file=${nextLocalStorage()}`], | ||
| 15 | + flags: [`--localstorage-file=${nextLocalStorage()}`], | ||
| 16 | 16 | }; | |
| 17 | 17 | ||
| 18 | 18 | const bench = common.createBenchmark(main, { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ function nextLocalStorage() { | |||
| 12 | 12 | } | |
| 13 | 13 | ||
| 14 | 14 | const options = { | |
| 15 | - flags: ['--experimental-webstorage', `--localstorage-file=${nextLocalStorage()}`], | ||
| 15 | + flags: [`--localstorage-file=${nextLocalStorage()}`], | ||
| 16 | 16 | }; | |
| 17 | 17 | ||
| 18 | 18 | const bench = common.createBenchmark(main, { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1305,14 +1305,6 @@ changes: | |||
| 1305 | 1305 | ||
| 1306 | 1306 | Enable experimental WebAssembly System Interface (WASI) support. | |
| 1307 | 1307 | ||
| 1308 | - ### `--experimental-webstorage` | ||
| 1309 | - | ||
| 1310 | - <!-- YAML | ||
| 1311 | - added: v22.4.0 | ||
| 1312 | - --> | ||
| 1313 | - | ||
| 1314 | - Enable experimental [`Web Storage`][] support. | ||
| 1315 | - | ||
| 1316 | 1308 | ### `--experimental-worker-inspection` | |
| 1317 | 1309 | ||
| 1318 | 1310 | <!-- YAML | |
@@ -1753,8 +1745,8 @@ added: v22.4.0 | |||
| 1753 | 1745 | ||
| 1754 | 1746 | The file used to store `localStorage` data. If the file does not exist, it is | |
| 1755 | 1747 | created the first time `localStorage` is accessed. The same file may be shared | |
| 1756 | - between multiple Node.js processes concurrently. This flag is a no-op unless | ||
| 1757 | - Node.js is started with the `--experimental-webstorage` flag. | ||
| 1748 | + between multiple Node.js processes concurrently. This flag is a no-op if | ||
| 1749 | + Node.js is started with the `--no-webstorage` (or `--no-experimental-webstorage`) flag. | ||
| 1758 | 1750 | ||
| 1759 | 1751 | ### `--max-http-header-size=size` | |
| 1760 | 1752 | ||
@@ -1979,6 +1971,14 @@ added: v6.0.0 | |||
| 1979 | 1971 | ||
| 1980 | 1972 | Silence all process warnings (including deprecations). | |
| 1981 | 1973 | ||
| 1974 | + ### `--no-webstorage` | ||
| 1975 | + | ||
| 1976 | + <!-- YAML | ||
| 1977 | + added: REPLACEME | ||
| 1978 | + --> | ||
| 1979 | + | ||
| 1980 | + Disable [`Web Storage`][] support. | ||
| 1981 | + | ||
| 1982 | 1982 | ### `--node-memory-debug` | |
| 1983 | 1983 | ||
| 1984 | 1984 | <!-- YAML | |
@@ -3503,7 +3503,6 @@ one is included in the list below. | |||
| 3503 | 3503 | * `--experimental-transform-types` | |
| 3504 | 3504 | * `--experimental-vm-modules` | |
| 3505 | 3505 | * `--experimental-wasi-unstable-preview1` | |
| 3506 | - * `--experimental-webstorage` | ||
| 3507 | 3506 | * `--force-context-aware` | |
| 3508 | 3507 | * `--force-fips` | |
| 3509 | 3508 | * `--force-node-api-uncaught-exceptions-policy` | |
@@ -3537,11 +3536,13 @@ one is included in the list below. | |||
| 3537 | 3536 | * `--no-experimental-sqlite` | |
| 3538 | 3537 | * `--no-experimental-strip-types` | |
| 3539 | 3538 | * `--no-experimental-websocket` | |
| 3539 | + * `--no-experimental-webstorage` | ||
| 3540 | 3540 | * `--no-extra-info-on-fatal-exception` | |
| 3541 | 3541 | * `--no-force-async-hooks-checks` | |
| 3542 | 3542 | * `--no-global-search-paths` | |
| 3543 | 3543 | * `--no-network-family-autoselection` | |
| 3544 | 3544 | * `--no-warnings` | |
| 3545 | + * `--no-webstorage` | ||
| 3545 | 3546 | * `--node-memory-debug` | |
| 3546 | 3547 | * `--openssl-config` | |
| 3547 | 3548 | * `--openssl-legacy-provider` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -640,13 +640,11 @@ A browser-compatible implementation of {Headers}. | |||
| 640 | 640 | added: v22.4.0 | |
| 641 | 641 | --> | |
| 642 | 642 | ||
| 643 | - > Stability: 1.0 - Early development. | ||
| 644 | - | ||
| 645 | 643 | A browser-compatible implementation of [`localStorage`][]. Data is stored | |
| 646 | 644 | unencrypted in the file specified by the [`--localstorage-file`][] CLI flag. | |
| 647 | 645 | The maximum amount of data that can be stored is 10 MB. | |
| 648 | 646 | Any modification of this data outside of the Web Storage API is not supported. | |
| 649 | - Enable this API with the [`--experimental-webstorage`][] CLI flag. | ||
| 647 | + Disable this API with the [`--no-webstorage`][] (or its alias `--no-experimental-webstorage`) CLI flag. | ||
| 650 | 648 | `localStorage` data is not stored per user or per request when used in the context | |
| 651 | 649 | of a server, it is shared across all users and requests. | |
| 652 | 650 | ||
@@ -1108,9 +1106,10 @@ added: v22.4.0 | |||
| 1108 | 1106 | --> | |
| 1109 | 1107 | ||
| 1110 | 1108 | > Stability: 1.0 - Early development. Enable this API with the | |
| 1111 | - > [`--experimental-webstorage`][] CLI flag. | ||
| 1109 | + > \[`--experimental-webstorage`]\[] CLI flag. | ||
| 1112 | 1110 | ||
| 1113 | - A browser-compatible implementation of {Storage}. | ||
| 1111 | + A browser-compatible implementation of {Storage}. Disable this API with the | ||
| 1112 | + [`--no-webstorage`][] (or its alias `--no-experimental-webstorage`) CLI flag. | ||
| 1114 | 1113 | ||
| 1115 | 1114 | ## `structuredClone(value[, options])` | |
| 1116 | 1115 | ||
@@ -1321,10 +1320,10 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. | |||
| 1321 | 1320 | [RFC 5646]: https://www.rfc-editor.org/rfc/rfc5646.txt | |
| 1322 | 1321 | [Web Crypto API]: webcrypto.md | |
| 1323 | 1322 | [`--experimental-eventsource`]: cli.md#--experimental-eventsource | |
| 1324 | - [`--experimental-webstorage`]: cli.md#--experimental-webstorage | ||
| 1325 | 1323 | [`--localstorage-file`]: cli.md#--localstorage-filefile | |
| 1326 | 1324 | [`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator | |
| 1327 | 1325 | [`--no-experimental-websocket`]: cli.md#--no-experimental-websocket | |
| 1326 | + [`--no-webstorage`]: cli.md#--no-webstorage | ||
| 1328 | 1327 | [`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy | |
| 1329 | 1328 | [`CompressionStream`]: webstreams.md#class-compressionstream | |
| 1330 | 1329 | [`CountQueuingStrategy`]: webstreams.md#class-countqueuingstrategy | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -189,9 +189,6 @@ | |||
| 189 | 189 | "experimental-websocket": { | |
| 190 | 190 | "type": "boolean" | |
| 191 | 191 | }, | |
| 192 | - "experimental-webstorage": { | ||
| 193 | - "type": "boolean" | ||
| 194 | - }, | ||
| 195 | 192 | "extra-info-on-fatal-exception": { | |
| 196 | 193 | "type": "boolean" | |
| 197 | 194 | }, | |
@@ -597,6 +594,9 @@ | |||
| 597 | 594 | "watch-preserve-output": { | |
| 598 | 595 | "type": "boolean" | |
| 599 | 596 | }, | |
| 597 | + "webstorage": { | ||
| 598 | + "type": "boolean" | ||
| 599 | + }, | ||
| 600 | 600 | "zero-fill-buffers": { | |
| 601 | 601 | "type": "boolean" | |
| 602 | 602 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -207,8 +207,8 @@ Enable experimental support for the EventSource Web API. | |||
| 207 | 207 | .It Fl -no-experimental-websocket | |
| 208 | 208 | Disable experimental support for the WebSocket API. | |
| 209 | 209 | . | |
| 210 | - .It Fl -experimental-webstorage | ||
| 211 | - Enable experimental support for the Web Storage API. | ||
| 210 | + .It Fl -no-webstorage | ||
| 211 | + Disable webstorage. | ||
| 212 | 212 | . | |
| 213 | 213 | .It Fl -no-experimental-repl-await | |
| 214 | 214 | Disable top-level await keyword support in REPL. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -365,7 +365,7 @@ function setupQuic() { | |||
| 365 | 365 | ||
| 366 | 366 | function setupWebStorage() { | |
| 367 | 367 | if (getEmbedderOptions().noBrowserGlobals || | |
| 368 | - !getOptionValue('--experimental-webstorage')) { | ||
| 368 | + !getOptionValue('--webstorage')) { | ||
| 369 | 369 | return; | |
| 370 | 370 | } | |
| 371 | 371 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,16 +1,13 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const { | |
| 3 | 3 | ObjectDefineProperties, | |
| 4 | + Proxy, | ||
| 4 | 5 | } = primordials; | |
| 5 | - const { ERR_INVALID_ARG_VALUE } = require('internal/errors').codes; | ||
| 6 | 6 | const { getOptionValue } = require('internal/options'); | |
| 7 | - const { emitExperimentalWarning } = require('internal/util'); | ||
| 8 | 7 | const { kConstructorKey, Storage } = internalBinding('webstorage'); | |
| 9 | 8 | const { getValidatedPath } = require('internal/fs/utils'); | |
| 10 | 9 | const kInMemoryPath = ':memory:'; | |
| 11 | 10 | ||
| 12 | - emitExperimentalWarning('Web Storage'); | ||
| 13 | - | ||
| 14 | 11 | module.exports = { Storage }; | |
| 15 | 12 | ||
| 16 | 13 | let lazyLocalStorage; | |
@@ -27,12 +24,31 @@ ObjectDefineProperties(module.exports, { | |||
| 27 | 24 | const location = getOptionValue('--localstorage-file'); | |
| 28 | 25 | ||
| 29 | 26 | if (location === '') { | |
| 30 | - throw new ERR_INVALID_ARG_VALUE('--localstorage-file', | ||
| 31 | - location, | ||
| 32 | - 'is an invalid localStorage location'); | ||
| 33 | - } | ||
| 27 | + let warningEmitted = false; | ||
| 28 | + const handler = { | ||
| 29 | + __proto__: null, | ||
| 30 | + get(target, prop) { | ||
| 31 | + if (!warningEmitted) { | ||
| 32 | + process.emitWarning('`--localstorage-file` was provided without a valid path'); | ||
| 33 | + warningEmitted = true; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + return undefined; | ||
| 37 | + }, | ||
| 38 | + set(target, prop, value) { | ||
| 39 | + if (!warningEmitted) { | ||
| 40 | + process.emitWarning('`--localstorage-file` was provided without a valid path'); | ||
| 41 | + warningEmitted = true; | ||
| 42 | + } | ||
| 34 | 43 | ||
| 35 | - lazyLocalStorage = new Storage(kConstructorKey, getValidatedPath(location)); | ||
| 44 | + return false; | ||
| 45 | + }, | ||
| 46 | + }; | ||
| 47 | + | ||
| 48 | + lazyLocalStorage = new Proxy({}, handler); | ||
| 49 | + } else { | ||
| 50 | + lazyLocalStorage = new Storage(kConstructorKey, getValidatedPath(location)); | ||
| 51 | + } | ||
| 36 | 52 | } | |
| 37 | 53 | ||
| 38 | 54 | return lazyLocalStorage; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -559,10 +559,12 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | |||
| 559 | 559 | NoOp{}, | |
| 560 | 560 | #endif | |
| 561 | 561 | kAllowedInEnvvar); | |
| 562 | - AddOption("--experimental-webstorage", | ||
| 563 | - "experimental Web Storage API", | ||
| 564 | - &EnvironmentOptions::experimental_webstorage, | ||
| 565 | - kAllowedInEnvvar); | ||
| 562 | + AddOption("--webstorage", | ||
| 563 | + "Web Storage API", | ||
| 564 | + &EnvironmentOptions::webstorage, | ||
| 565 | + kAllowedInEnvvar, | ||
| 566 | + true); | ||
| 567 | + AddAlias("--experimental-webstorage", "--webstorage"); | ||
| 566 | 568 | AddOption("--localstorage-file", | |
| 567 | 569 | "file used to persist localStorage data", | |
| 568 | 570 | &EnvironmentOptions::localstorage_file, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments