Skip to content

Commit 9feaed8

Browse files
authored
Revert "joh/representative canidae" (microsoft#166641)
1 parent 4ff1974 commit 9feaed8

File tree

18 files changed

+25
-123
lines changed

18 files changed

+25
-123
lines changed

src/bootstrap-fork.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,10 @@ if (process.env['VSCODE_PARENT_PID']) {
3737
terminateWhenParentTerminates();
3838
}
3939

40-
// VSCODE_GLOBALS: node_modules
41-
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
42-
43-
// VSCODE_GLOBALS: package/product.json
44-
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
45-
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
46-
4740
// Load AMD entry point
4841
require('./bootstrap-amd').load(process.env['VSCODE_AMD_ENTRYPOINT']);
4942

43+
5044
//#region Helpers
5145

5246
function pipeLoggingToParent() {

src/bootstrap-window.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,6 @@
112112

113113
window['MonacoEnvironment'] = {};
114114

115-
// VSCODE_GLOBALS: node_modules
116-
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => (require.__$__nodeRequire ?? require)(String(mod)) });
117-
118-
// VSCODE_GLOBALS: package/product.json
119-
globalThis._VSCODE_PRODUCT_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/product.json');
120-
globalThis._VSCODE_PACKAGE_JSON = (require.__$__nodeRequire ?? require)(configuration.appRoot + '/package.json');
121-
122115
const loaderConfig = {
123116
baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`,
124117
'vs/nls': nlsConfig,

src/main.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@ function startup(codeCachePath, nlsConfig) {
141141
process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig);
142142
process.env['VSCODE_CODE_CACHE_PATH'] = codeCachePath || '';
143143

144-
// VSCODE_GLOBALS: node_modules
145-
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
146-
147-
// VSCODE_GLOBALS: package/product.json
148-
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
149-
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
150-
151144
// Load main in AMD
152145
perf.mark('code/willLoadMainBundle');
153146
require('./bootstrap-amd').load('vs/code/electron-main/main', () => {
@@ -325,7 +318,6 @@ function getArgvConfigPath() {
325318
dataFolderName = `${dataFolderName}-dev`;
326319
}
327320

328-
// @ts-ignore
329321
return path.join(os.homedir(), dataFolderName, 'argv.json');
330322
}
331323

src/server-main.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,6 @@ function loadCode() {
258258
return new Promise((resolve, reject) => {
259259
const path = require('path');
260260

261-
// VSCODE_GLOBALS: node_modules
262-
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), { get: (_target, mod) => require(String(mod)) });
263-
264-
// VSCODE_GLOBALS: package/product.json
265-
globalThis._VSCODE_PRODUCT_JSON = require('../product.json');
266-
globalThis._VSCODE_PACKAGE_JSON = require('../package.json');
267-
268261
delete process.env['ELECTRON_RUN_AS_NODE']; // Keep bootstrap-amd.js from redefining 'fs'.
269262

270263
// See https://github.com/microsoft/vscode-remote-release/issues/6543

src/tsconfig.monaco.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"include": [
1919
"typings/require.d.ts",
2020
"typings/thenable.d.ts",
21-
"typings/vscode-globals-product.d.ts",
2221
"vs/loader.d.ts",
2322
"vs/monaco.d.ts",
2423
"vs/editor/*",

src/typings/require.d.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,10 @@ interface NodeRequire {
4545
* @deprecated use `FileAccess.asFileUri()` for node.js contexts or `FileAccess.asBrowserUri` for browser contexts.
4646
*/
4747
toUrl(path: string): string;
48-
49-
/**
50-
* @deprecated MUST not be used anymore
51-
*
52-
* With the move from AMD to ESM we cannot use this anymore. There will be NO MORE node require like this.
53-
*/
54-
__$__nodeRequire<T>(moduleName: string): T;
55-
5648
(dependencies: string[], callback: (...args: any[]) => any, errorback?: (err: any) => void): any;
5749
config(data: any): any;
5850
onError: Function;
51+
__$__nodeRequire<T>(moduleName: string): T;
5952
getStats?(): ReadonlyArray<LoaderEvent>;
6053
hasDependencyCycle?(): boolean;
6154
define(amdModuleId: string, dependencies: string[], callback: (...args: any[]) => any): any;

src/typings/vscode-globals-modules.d.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/typings/vscode-globals-product.d.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/vs/base/common/performance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
} else if (typeof process === 'object') {
7979
// node.js: use the normal polyfill but add the timeOrigin
8080
// from the node perf_hooks API as very first mark
81-
const timeOrigin = Math.round((require.__$__nodeRequire || require)('perf_hooks').performance.timeOrigin);
81+
const timeOrigin = Math.round((require.nodeRequire || require)('perf_hooks').performance.timeOrigin);
8282
return _definePolyfillMarks(timeOrigin);
8383

8484
} else {

src/vs/base/parts/ipc/node/ipc.net.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import { ChunkStream, Client, ISocket, Protocol, SocketCloseEvent, SocketCloseEv
2020
// TODO@bpasero remove me once electron utility process has landed
2121
function getNodeDependencies() {
2222
return {
23-
crypto: globalThis._VSCODE_NODE_MODULES.crypto,
24-
zlib: globalThis._VSCODE_NODE_MODULES.zlib,
25-
net: globalThis._VSCODE_NODE_MODULES.net,
26-
os: globalThis._VSCODE_NODE_MODULES.os,
23+
crypto: (require.__$__nodeRequire('crypto') as any) as typeof import('crypto'),
24+
zlib: (require.__$__nodeRequire('zlib') as any) as typeof import('zlib'),
25+
net: (require.__$__nodeRequire('net') as any) as typeof import('net'),
26+
os: (require.__$__nodeRequire('os') as any) as typeof import('os')
2727
};
2828
}
2929

0 commit comments

Comments
 (0)