From ee56aecced2fa7bb44ac5fedbc9a5506179f882b 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, 50 insertions(+), 1 deletion(-) 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 b337e03d8fe04e..a68f441fbb21d7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -350,6 +350,7 @@ module.exports = { Crypto: 'readable', CryptoKey: 'readable', DecompressionStream: 'readable', + EventSource: 'readable', fetch: 'readable', FormData: 'readable', navigator: 'readable', diff --git a/doc/api/cli.md b/doc/api/cli.md index ad080e559987e1..b94e459cdecd50 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -851,6 +851,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`