Skip to content

Conversation

@jruales
Copy link
Contributor

@jruales jruales commented Dec 8, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 8, 2025 19:41
@jruales jruales changed the title Document target environments Add section on Target Environments Dec 8, 2025
Copy link
Contributor

Copilot AI left a 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, and electron-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`
Copy link

Copilot AI Dec 8, 2025

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`".

Suggested change
- `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`)

Copilot uses AI. Check for mistakes.

### 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
Copy link

Copilot AI Dec 8, 2025

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".

Suggested change
- `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

Copilot uses AI. Check for mistakes.
- `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`
Copy link

Copilot AI Dec 8, 2025

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.

Suggested change
- may use code from: `common`, `browser`, `electron-browser`
- may use code from: `common`, `browser`

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants