From 02b36cbd2dc30d5565afa920cda077d650b652e9 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Mon, 13 May 2024 07:32:08 +0200 Subject: [PATCH] lib: add EventSource Client PR-URL: https://github.com/nodejs/node/pull/51575 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Matthew Aitken Reviewed-By: Matteo Collina Reviewed-By: Antoine du Hamel --- .eslintrc.js | 1 + doc/api/cli.md | 10 ++++++++++ doc/node.1 | 3 +++ lib/.eslintrc.yaml | 2 ++ lib/internal/bootstrap/web/exposed-window-or-worker.js | 3 +++ lib/internal/process/pre_execution.js | 8 ++++++++ src/node_options.cc | 5 +++++ src/node_options.h | 1 + test/common/globals.js | 1 + test/common/index.js | 4 ++++ test/parallel/test-eventsource-disabled.js | 6 ++++++ test/parallel/test-eventsource.js | 7 +++++++ 12 files changed, 51 insertions(+) create mode 100644 test/parallel/test-eventsource-disabled.js create mode 100644 test/parallel/test-eventsource.js diff --git a/.eslintrc.js b/.eslintrc.js index f86f42e8f2e89f..9eaa7e3f47b0e2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -348,6 +348,7 @@ module.exports = { Crypto: 'readable', CryptoKey: 'readable', DecompressionStream: 'readable', + EventSource: 'readable', fetch: 'readable', FormData: 'readable', ReadableStream: 'readable', diff --git a/doc/api/cli.md b/doc/api/cli.md index 8f32a44ad41314..0b8eb7b0cb2308 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -898,6 +898,14 @@ CommonJS. This includes the following: * Lexical redeclarations of the CommonJS wrapper variables (`require`, `module`, `exports`, `__dirname`, `__filename`). +### `--experimental-eventsource` + + + +Enable exposition of [EventSource Web API][] on the global scope. + ### `--experimental-import-meta-resolve`