Migrate extension and tooling to native ESM - #9635
Closed
dibarbet wants to merge 1 commit into
Closed
Conversation
Use package-native ESM and NodeNext TypeScript across the extension, tooling, Jest, and integration entry points, with normal tsc emission and a native .mjs extension bundle. Retain only the audited createRequire bridge required by bundled CommonJS dependencies, select the telemetry ESM entry, and update signing, debugging, packaging, and artifact safeguards for .mjs output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 720632a5-5bd9-43bb-9349-6c1a02fe3347
This was referenced Aug 4, 2026
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move the C# extension, build tooling, Jest configuration, and integration entry points to native ESM now that VS Code supports ESM extension entry points.
type: moduleand ship./dist/extension.mjsNodeNext/NodeNext,.tssource specifiers,rewriteRelativeImportExtensions, and normal tsc emissiontest/jestProjectNames.mjsdirectly from tsc and keep module-relative ts-jest configuration resolution@vscode/extension-telemetry1.5.2.mjsacross signing, debugging, packaging, and artifact validationThe bundle retains a narrowly scoped
createRequire(import.meta.url)bridge because audited CommonJS dependencies still emit runtime requires. The audit currently locks this to 46 package owners, 279 modules, and 378 runtime requires; only the Razor component andvscode-languageclientrequirevscodeat runtime.This standalone PR supersedes #9630, #9631, #9632, and #9633, and replaces stack #9634.
Validation
npm run compileDevnpm run test:unitnpm run omnisharptest:unitnpm run packageandnode --check dist/extension.mjsnpm run test:artifactsagainst a generated VSIXnpm run test:integration:untrustednpm run test:integration:csharpgit diff --check