-
Notifications
You must be signed in to change notification settings - Fork 36.7k
Add section on Target Environments #282053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR documents the target runtime environments used to organize code within VS Code's layered architecture. It adds important context about how code is structured based on which runtime APIs it requires (JavaScript, Web, Node.js, or Electron).
Key Changes
- Added "Target Environments" section explaining the 6 environment types:
common,browser,node,electron-browser,electron-utility, andelectron-main - Documented the dependency relationships between different target environments
- Clarified which APIs are available in each environment
| - may use code from: `common` | ||
| - `node`: Source code that requires Node.JS APIs | ||
| - may use code from: `common` | ||
| - `electron-browser`: Source code that requires the `browser` APIs like access to the DOM and a small subset of APIs to communicate with the Electron main process (anything exposed from `src/vs/base/parts/sandbox/electron-browser/globals.ts` |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing closing parenthesis at the end of the line. The parenthesis opened before "anything exposed" should be closed after "globals.ts`".
| - `electron-browser`: Source code that requires the `browser` APIs like access to the DOM and a small subset of APIs to communicate with the Electron main process (anything exposed from `src/vs/base/parts/sandbox/electron-browser/globals.ts` | |
| - `electron-browser`: Source code that requires the `browser` APIs like access to the DOM and a small subset of APIs to communicate with the Electron main process (anything exposed from `src/vs/base/parts/sandbox/electron-browser/globals.ts`) |
|
|
||
| ### Target Environments | ||
| Inside each layer, the code is organized by the target runtime environment. This ensures that only the runtime specific APIs are used. In the code we distinguish between the following target environments: | ||
| - `common`: Source code that only requires basic JavaScript APIs and run in all the other target environments |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: "run" should be "runs" to agree with the singular subject "Source code".
| - `common`: Source code that only requires basic JavaScript APIs and run in all the other target environments | |
| - `common`: Source code that only requires basic JavaScript APIs and runs in all the other target environments |
| - `node`: Source code that requires Node.JS APIs | ||
| - may use code from: `common` | ||
| - `electron-browser`: Source code that requires the `browser` APIs like access to the DOM and a small subset of APIs to communicate with the Electron main process (anything exposed from `src/vs/base/parts/sandbox/electron-browser/globals.ts` | ||
| - may use code from: `common`, `browser`, `electron-browser` |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The dependency list includes electron-browser itself, which is redundant. Code from electron-browser can inherently use other code from the same environment. Consider removing electron-browser from this list, or clarify if this is intentionally documenting that modules within the same environment can reference each other.
| - may use code from: `common`, `browser`, `electron-browser` | |
| - may use code from: `common`, `browser` |
No description provided.