What’s New in TypeScript 4.8? Key Changes, Bugs, and Migration Tips
TypeScript 4.8 enters its release‑candidate phase with a scheduled stable launch in late August, introducing a new server preference for import exclusions and stricter object‑comparison checks that flag previously silent bugs, while Google reports minimal impact on its codebase.
TypeScript 4.8 is currently in the release candidate (RC) stage, with the final stable version expected around August 23.
The team says no major changes are planned beyond critical bug fixes. Since the 4.8 beta, the only notable addition is a new TS server preference that lets you exclude modules or libraries from the auto‑import list used for code completion.
Another change is a stricter check that treats comparisons between objects/arrays and primitive values as errors. For example, the following code now triggers an error because JavaScript compares objects by reference, not by value:
var things: any[] = Array();
if (things == []) {
// Is the array empty?
}TypeScript 4.8 reports: “This condition will always return false because JavaScript compares objects by reference rather than by value.”
Google’s internal software team confirmed that a small portion of their libraries needed adjustments to compile with 4.8, but they continue to support the improvements. They advise against using “as any” casts to silence the error, as it can hide potential bugs, even though the impact is limited to about 0.006% of libraries.
Overall, the release aims to catch errors earlier before deployment, making the “correctness fixes” in 4.8 beneficial for developers and projects despite introducing new type errors.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
