Port JSX fragment checking changes#1053
Merged
jakebailey merged 7 commits intomicrosoft:mainfrom Jun 4, 2025
Merged
Conversation
Co-authored-by: Isabel Duan <isabelduan@microsoft.com>
…agmentFactory: null`" Co-authored-by: Isabel Duan <isabelduan@microsoft.com>
Co-authored-by: Isabel Duan <isabelduan@microsoft.com>
Co-authored-by: Isabel Duan <isabelduan@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ports JSX fragment checking changes from several upstream TypeScript PRs. Key updates include updating error baselines for JSX fragment usage, enhancing the compiler’s handling of JSX fragments via new type fields and synthetic expressions, and extending AST utilities to recognize and process JSX fragment nodes.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/baselines/reference/submodule/conformance/inlineJsxFactoryWithFragmentIsError.errors.txt.diff | Updated error baselines by removing outdated fragments error messages. |
| testdata/baselines/reference/submodule/conformance/inlineJsxFactoryWithFragmentIsError.errors.txt | Modified error reporting lines to reflect the new fragment checks. |
| testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt.diff | Adjusted error messages for wrong JSX fragment types. |
| testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt | Updated baseline errors for JSX fragment type mismatches. |
| testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryReference(jsx=react).errors.txt.diff | Removed obsolete error baseline for JSX fragment factory references. |
| testdata/baselines/reference/submodule/compiler/jsxFragmentFactoryReference(jsx=react).errors.txt | Revised error messages in JSX fragment factory reference baselines. |
| internal/checker/types.go | Added a new field (jsxFragmentType) in SourceFileLinks to track JSX fragment types. |
| internal/checker/jsx.go | Introduced ReactNames and updated fragment checking logic including improved type resolution for JSX fragments. |
| internal/checker/checker.go | Enhanced JSX fragment support in call resolution and error reporting alongside introduction of emptyFreshJsxObjectType. |
| internal/ast/utilities.go | Extended call-like and JSX expression handling to incorporate the new JSX fragment node kind. |
Comments suppressed due to low confidence (2)
internal/checker/types.go:397
- Consider adding inline documentation for the new 'jsxFragmentType' field in the SourceFileLinks struct to clarify its purpose and usage.
jsxFragmentType *Type
internal/checker/checker.go:704
- The new field 'emptyFreshJsxObjectType' is introduced; please clarify in a comment how it differs from 'emptyJsxObjectType' and its intended use in JSX fragment handling.
emptyFreshJsxObjectType *Type
jakebailey
reviewed
Jun 4, 2025
This reverts commit 4d0638f.
jakebailey
approved these changes
Jun 4, 2025
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.
ports microsoft/TypeScript#59933
ports microsoft/TypeScript#60122
ports microsoft/TypeScript#60615
ports microsoft/TypeScript#60687