-
Notifications
You must be signed in to change notification settings - Fork 640
Port JSX fragment checking changes #1053
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
Conversation
Co-authored-by: Isabel Duan <[email protected]>
…agmentFactory: null`" Co-authored-by: Isabel Duan <[email protected]>
Co-authored-by: Isabel Duan <[email protected]>
Co-authored-by: Isabel Duan <[email protected]>
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 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
This reverts commit 4d0638f.
ports microsoft/TypeScript#59933
ports microsoft/TypeScript#60122
ports microsoft/TypeScript#60615
ports microsoft/TypeScript#60687