Support source phase imports - #63915
Open
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
Open
Conversation
Copilot started reviewing on behalf of
Oleksandr Tarasiuk (a-tarasyuk)
August 20, 2026 13:46
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds TC39 source-phase import support across parsing, resolution, checking, emit, APIs, and language services.
Changes:
- Supports static
import sourceand dynamicimport.source(). - Adds phase-aware resolution, WebAssembly typing, diagnostics, and emit behavior.
- Adds compiler, parser, resolver, API, and fourslash coverage.
Reviewed changes
Copilot reviewed 161 out of 167 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tsc/internal/ast/* |
Adds source-phase syntax kinds and AST helpers. |
tsc/internal/api/encoder/* |
Encodes and decodes the new phase modifier. |
tsc/internal/checker/* |
Checks syntax and assigns source-module types. |
tsc/internal/compiler/* |
Tracks phase-aware resolutions and Wasm inputs. |
tsc/internal/core/compileroptions.go |
Defines supported module modes. |
tsc/internal/diagnostics/* |
Adds source-import diagnostics. |
tsc/internal/fourslash/tests/*sourcePhase* |
Tests completions, auto-imports, and organization. |
tsc/internal/ls/* |
Integrates source imports with language services. |
tsc/internal/module/* |
Implements phase-aware module resolution and caching. |
tsc/internal/parser/* |
Parses static and dynamic source imports. |
tsc/internal/scanner/* |
Recognizes source as a contextual keyword. |
tsc/internal/testutil/tsbaseline/js_emit_baseline.go |
Includes Wasm files during declaration verification. |
tsc/internal/transformers/moduletransforms/commonjsmodule.go |
Avoids rewriting import.source() as ordinary dynamic import. |
tsc/internal/tspath/extension.go |
Adds the Wasm extension. |
tools/scripts/tsc/ast.json |
Updates AST generation metadata. |
packages/typescript/src/* |
Exposes the new syntax through the TypeScript API. |
tsc/testdata/tests/cases/conformance/importSource/* |
Covers syntax, typing, resolution, emit, and errors. |
tsc/testdata/baselines/reference/conformance/importSource* |
Records expected compiler output. |
tsc/testdata/baselines/reference/conformance/importMetaPropertyInvalidInCall.errors.txt |
Updates import meta-property suggestions. |
Files not reviewed (6)
- tsc/internal/api/encoder/decoder_generated.go: Generated file
- tsc/internal/api/encoder/encoder_generated.go: Generated file
- tsc/internal/ast/ast_generated.go: Generated file
- tsc/internal/ast/kind_generated.go: Generated file
- tsc/internal/ast/kind_stringer_generated.go: Generated file
- tsc/internal/diagnostics/diagnostics_generated.go: Generated file
Oleksandr Tarasiuk (a-tarasyuk)
force-pushed
the
feat/61216
branch
2 times, most recently
from
August 20, 2026 18:58
29e2b99 to
51bd51b
Compare
Oleksandr Tarasiuk (a-tarasyuk)
force-pushed
the
feat/61216
branch
from
August 21, 2026 08:56
90faa2c to
c8df015
Compare
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.
Fixes #61216
This patch adds support for TC39 Source Phase Imports