From 2f77da4aa7969f3a9f8a6df66fb8e3609f2216c7 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 7 Nov 2022 16:30:56 +0100 Subject: [PATCH 1/2] Enable WebRTC by default --- bin/wasm-node/CHANGELOG.md | 4 ++++ bin/wasm-node/javascript/src/client.ts | 11 +++++------ bin/wasm-node/javascript/src/index-browser.ts | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/wasm-node/CHANGELOG.md b/bin/wasm-node/CHANGELOG.md index 65e0f49e70..a1c3b5dbf1 100644 --- a/bin/wasm-node/CHANGELOG.md +++ b/bin/wasm-node/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Changed + +- The `enableExperimentalWebRTC` field has been removed from `ClientConfig`, and replaced with a `forbidWebRtc` option. WebRTC is now considered stable enough to be enabled by default. + ## 0.7.6 - 2022-11-04 ### Fixed diff --git a/bin/wasm-node/javascript/src/client.ts b/bin/wasm-node/javascript/src/client.ts index 693ba76a9f..5295e40ff7 100644 --- a/bin/wasm-node/javascript/src/client.ts +++ b/bin/wasm-node/javascript/src/client.ts @@ -252,14 +252,13 @@ export interface ClientOptions { forbidWss?: boolean; /** - * Enable experimental support for WebRTC connections. - * - * Support for WebRTC connections is currently in progress and might have significant issues. + * If `true`, then the client will never open any WebRTC connection. + * Defaults to `false`. * - * This flag currently defaults to `false`. In a later version, it will be removed and WebRTC - * connections will be enabled by default. + * This option has no effect in environments where non-secure WebSocket connections aren't + * supported anyway. */ - enableExperimentalWebRTC?: boolean; + forbidWebRtc?: boolean; } /** diff --git a/bin/wasm-node/javascript/src/index-browser.ts b/bin/wasm-node/javascript/src/index-browser.ts index 5cfcfbee2c..f1e0b85898 100644 --- a/bin/wasm-node/javascript/src/index-browser.ts +++ b/bin/wasm-node/javascript/src/index-browser.ts @@ -65,7 +65,7 @@ export function start(options?: ClientOptions): Client { options?.forbidWs || false, options?.forbidNonLocalWs || false, options?.forbidWss || false, - !(options?.enableExperimentalWebRTC || false) + options?.forbidWebRtc || false ) } }) From fdf4a79b34c57bbed5deace8fe7a6d9702a71cea Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 7 Nov 2022 16:31:23 +0100 Subject: [PATCH 2/2] PR number --- bin/wasm-node/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/wasm-node/CHANGELOG.md b/bin/wasm-node/CHANGELOG.md index a1c3b5dbf1..59e3a5908f 100644 --- a/bin/wasm-node/CHANGELOG.md +++ b/bin/wasm-node/CHANGELOG.md @@ -4,7 +4,7 @@ ### Changed -- The `enableExperimentalWebRTC` field has been removed from `ClientConfig`, and replaced with a `forbidWebRtc` option. WebRTC is now considered stable enough to be enabled by default. +- The `enableExperimentalWebRTC` field has been removed from `ClientConfig`, and replaced with a `forbidWebRtc` option. WebRTC is now considered stable enough to be enabled by default ([#2977](https://github.com/paritytech/smoldot/pull/2977)). ## 0.7.6 - 2022-11-04