Skip to content
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

DRAFT(xplat): Fix build errors in TypeScript 5.3 #30797

Closed
wants to merge 14 commits into from

Conversation

behowell
Copy link
Contributor

@behowell behowell commented Mar 16, 2024

Note: This PR will not be merged as a monolith. It's been split up into the following PRs:

The fixes generally fall into a few major categories:

  1. Breaking change in TS 4.8: Unconstrained Generics No Longer Assignable to {}.
    • Fixed by adding extends {} constraint to template types that previously had no constraint (effectively extends unknown). The new constraint disallows null and undefined as template parameters, which were never valid values for these type parameters anyways.
      -export type SlotProp<TProps> =
      +export type SlotProp<TProps extends {}> =
  2. Breaking change in TS 4.8: Unused Renames in Binding Patterns are Now Errors in Type Signatures.
    • Fixed by adding a parameter name that was accidentally omitted from function definitions:
      -  onPropUpdate: ({ jsonTreeElement: JSONTreeElement }) => void;
      +  onPropUpdate: (args: { jsonTreeElement: JSONTreeElement }) => void;
  3. Breaking change in TS 5.0: Forbidden Implicit Coercions in Relational Operators (effectively: can't use <=, >, etc. between Number and number values).
    • Most cases of this appear to be a typo: a function returning Number when it should have been returning number.
      -export function compareDatePart(date1: Date, date2: Date): Number {
      +export function compareDatePart(date1: Date, date2: Date): number {

@behowell behowell self-assigned this Mar 16, 2024
@github-actions github-actions bot added this to the March Project Cycle Q1 2024 milestone Mar 16, 2024
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@behowell behowell closed this Mar 19, 2024
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.

1 participant