Skip to content

Commit 04f0bcb

Browse files
authored
debt - some node.js module import 💄 (microsoft#264158)
1 parent 5528af5 commit 04f0bcb

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

src/bootstrap-esm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as fs from 'fs';
6+
import * as fs from 'node:fs';
77
import { register } from 'node:module';
88
import { product, pkg } from './bootstrap-meta.js';
99
import './bootstrap-node.js';

src/bootstrap-node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as path from 'path';
7-
import * as fs from 'fs';
6+
import * as path from 'node:path';
7+
import * as fs from 'node:fs';
88
import { createRequire } from 'node:module';
99
import type { IProductConfiguration } from './vs/base/common/product.js';
1010

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as path from 'path';
6+
import * as path from 'node:path';
77
import * as fs from 'original-fs';
8-
import * as os from 'os';
9-
import { performance } from 'perf_hooks';
8+
import * as os from 'node:os';
9+
import { performance } from 'node:perf_hooks';
1010
import { configurePortable } from './bootstrap-node.js';
1111
import { bootstrapESM } from './bootstrap-esm.js';
1212
import { app, protocol, crashReporter, Menu, contentTracing } from 'electron';

src/server-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import './bootstrap-server.js'; // this MUST come before other imports as it changes global state
7-
import { join } from 'path';
7+
import { join } from 'node:path';
88
import { devInjectNodeModuleLookupPath } from './bootstrap-node.js';
99
import { bootstrapESM } from './bootstrap-esm.js';
1010
import { resolveNLSConfiguration } from './vs/base/node/nls.js';

src/server-main.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import './bootstrap-server.js'; // this MUST come before other imports as it changes global state
7-
import * as path from 'path';
8-
import * as http from 'http';
9-
import { AddressInfo } from 'net';
10-
import * as os from 'os';
11-
import * as readline from 'readline';
12-
import { performance } from 'perf_hooks';
7+
import * as path from 'node:path';
8+
import * as http from 'node:http';
9+
import type { AddressInfo } from 'node:net';
10+
import * as os from 'node:os';
11+
import * as readline from 'node:readline';
12+
import { performance } from 'node:perf_hooks';
1313
import minimist from 'minimist';
1414
import { devInjectNodeModuleLookupPath, removeGlobalNodeJsModuleLookupPaths } from './bootstrap-node.js';
1515
import { bootstrapESM } from './bootstrap-esm.js';

src/vs/platform/debug/electron-main/extensionHostDebugIpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class ElectronExtensionHostDebugBroadcastChannel<TContext> extends Extens
7171
}
7272

7373
private async openCdpServer(ident: string, onSocket: (socket: ISocket) => void) {
74-
const { createServer } = await import('http'); // Lazy due to https://github.com/microsoft/vscode/issues/263533
74+
const { createServer } = await import('http'); // Lazy due to https://github.com/nodejs/node/issues/59686
7575
const server = createServer((req, res) => {
7676
res.statusCode = 404;
7777
res.end();

src/vs/platform/telemetry/node/1dsAppender.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { streamToBuffer } from '../../../base/common/buffer.js';
88
import { CancellationToken } from '../../../base/common/cancellation.js';
99
import { IRequestOptions } from '../../../base/parts/request/common/request.js';
1010
import { IRequestService } from '../../request/common/request.js';
11-
import * as https from 'https';
1211
import { AbstractOneDataSystemAppender, IAppInsightsCore } from '../common/1dsAppender.js';
1312

1413
type OnCompleteFunc = (status: number, headers: { [headerName: string]: string }, response?: string) => void;
@@ -43,6 +42,7 @@ async function makeTelemetryRequest(options: IRequestOptions, requestService: IR
4342
* @returns An object containing the headers, statusCode, and responseData
4443
*/
4544
async function makeLegacyTelemetryRequest(options: IRequestOptions): Promise<IResponseData> {
45+
const https = await import('https'); // Lazy due to https://github.com/nodejs/node/issues/59686
4646
const httpsOptions = {
4747
method: options.type,
4848
headers: options.headers

0 commit comments

Comments
 (0)