Skip to content

Commit 1cce1d0

Browse files
authored
chore: experimental networking by default on recent Node versions (#2193)
It's now good enough to be reasonably useful in Node.js, so turn it on by default. Still have a setting to turn it off.
1 parent 52b5d86 commit 1cce1d0

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This changelog records changes to stable releases since 1.50.2. "TBA" changes he
77
- fix: explicitly specify completion ranges ([[vscode#243409](https://github.com/microsoft/vscode/issues/243409)])
88
- fix: memory leak between debug sessions ([#2173](https://github.com/microsoft/vscode-js-debug/issues/2173))
99
- fix: support `npm.scriptRunner: node`
10+
- chore: enable experimental networking by default on recent Node versions
1011

1112
## 1.97 (January 2025)
1213

src/binder.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ export class Binder implements IDisposable {
174174

175175
return {};
176176
});
177+
dap.on('enableNetworking', () => {
178+
// handled on a session level
179+
return Promise.resolve({});
180+
});
177181
}
178182

179183
private readonly getLaunchers = once(() => {

src/build/generate-contributions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ const configurationSchema: ConfigurationAttributes<IConfigurationTypes> = {
12521252
},
12531253
[Configuration.EnableNetworkView]: {
12541254
type: 'boolean',
1255-
default: false,
1255+
default: true,
12561256
description: refString('configuration.enableNetworkView'),
12571257
},
12581258
};

src/targets/node/nodeBinaryProvider.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,9 @@ export class NodeBinary {
132132
this.capabilities.add(Capability.UseInspectPublishUid);
133133
}
134134

135-
// todo@connor4312: the current API we get in Node.js is pretty tiny and
136-
// I don't want to ship it by default in its current version, ref
137-
// https://github.com/nodejs/node/pull/53593#issuecomment-2276367389
138-
// Users can still turn it on by setting `experimentalNetworking: on`.
139-
// if (version.gte(new Semver(22, 6, 0)) && version.lt(new Semver(24, 0, 0))) {
140-
// this.capabilities.add(Capability.UseExperimentalNetworking);
141-
// }
135+
if (version.gte(new Semver(22, 14, 0)) && version.lt(new Semver(24, 0, 0))) {
136+
this.capabilities.add(Capability.UseExperimentalNetworking);
137+
}
142138
}
143139

144140
/**

0 commit comments

Comments
 (0)