Skip to content

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

Merged
merged 7 commits into from
Jun 4, 2025

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jun 4, 2025

@Copilot Copilot AI review requested due to automatic review settings June 4, 2025 20:46
Copy link
Contributor

@Copilot 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 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 jakebailey added this pull request to the merge queue Jun 4, 2025
Merged via the queue into microsoft:main with commit a4132f5 Jun 4, 2025
23 checks passed
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