Skip to content

fix(react-calendar-compat): Fix build errors in TypeScript 5.3.3#30810

Merged
behowell merged 1 commit intomicrosoft:masterfrom
behowell:ts5/react-calendar-compat
Mar 21, 2024
Merged

fix(react-calendar-compat): Fix build errors in TypeScript 5.3.3#30810
behowell merged 1 commit intomicrosoft:masterfrom
behowell:ts5/react-calendar-compat

Conversation

@behowell
Copy link
Contributor

@behowell behowell commented Mar 18, 2024

Previous Behavior

TypeScript 5 introduced some breaking changes to the way that implicit type coercion happens in templates, as well as a few other breaking changes. Although we don't currently use TypeScript 5.3.3 in the repo, experimental work in the xplat branch requires building against TypesScript 5+. There are also customers using TypeScript 5+, who are seeing build errors when importing FluentUI.

New Behavior

Fix build errors seen if the repo is updated to TypeScript 5.3.3. This is part of a set of PRs intending to fix all build errors when building against TypeScript 5.3.3.

The fixes in this PR are caused by a breaking change in TS 5.0: Forbidden Implicit Coercions in Relational Operators (effectively: can't use <=, >, etc. between Number and number values).

ℹ️ Note: This is NOT updating the project to use TypeScript 5.3.3, and an update to the TypeScript version is not planned as part of this change. It is only fixing build errors that would occur if it were built against TypeScript 5.3.3.

Related Issue(s)

This PR was split out from a draft PR that contains all of the changes. I'm not going to publish the monolith PR, but in case it helps to see all of the changes in one place:

Here are all of the split-out PRs:

@codesandbox-ci
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.

@fabricteam
Copy link
Collaborator

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-calendar-compat
Calendar Compat
152.073 kB
39.83 kB
react-datepicker-compat
DatePicker Compat
224.523 kB
62.94 kB
🤖 This report was generated against 5e690201797c6b1ce34ac59638fd4a77a0f5a2b3

@fabricteam
Copy link
Collaborator

🕵 fluentuiv9 No visual regressions between this PR and main

@behowell behowell marked this pull request as ready for review March 20, 2024 15:59
@behowell behowell requested review from a team and sopranopillow as code owners March 20, 2024 15:59
@behowell behowell merged commit 6d46744 into microsoft:master Mar 21, 2024
@behowell behowell deleted the ts5/react-calendar-compat branch March 21, 2024 19:28
robertpenner pushed a commit to robertpenner/fluentui that referenced this pull request Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants