-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Bloomberg feedback on TypeScript 4.7 Beta #49071
Comments
Thank you for reporting with the results @dragomirtitian! A few questions/comments:
Have you found the experience of squelching these issues to be reasonable?
I would likely consider this a bug if you're willing to file it.
This is my least favorite unexpected breaking change because anecdotally, nobody cares about symbols. The usual mitigation is to write |
It was actually pretty straightforward. In most cases this was a redundant check (for example an assertion function called right before).
This is a simple repro of it. /**
* Comment
*/
export default {
test: 0
} Playground Link 4.6 / Playground Link 4.7 I would hesitate to make this a bug. It's just a change, not sure if it was intentional or not. It does not affect us one way or the other, we just saw it as a difference (we generally check if any build output changes between TS versions and investigate why it did). We initially feared typedoc might be impacted buy this, but it turns out it wasn't including the comment on the default export in the docs anyway, so I don't see a change there either. The only noticeable change is that tooltips in VS Code now pick up the comment and surface it, which is an improvement.
We mostly encountered this when composing log messages, so we made a runtime change to explicitly convert using |
This case looks interesting. I will take a look at investigating this cause I assume that this is a bug (can't find a reason why it wouldn't be). |
@DanielRosenwasser We tested out the 4.7 RC and we didn't find anything new to report. No new breaking changes in our codebase. |
Thank you for the update! |
We are in the process of evaluating the impact of upgrading to 4.7 on our codebase. Here some preliminary findings:
keyof T
Detection of weak generic types
This was reverted by #48923
The generic weak types on constraints has caused all our packages to fail due to an error in a base package. The specific pattern that we ran into is this:
Playground Link 4.6 / Playground Link 4.7
This was already reverted but we are implementing fixes based on the error to ensure if this is turned on in the future we will be better prepared.
Symbol is now included in
keyof T
This was the biggest source of breaking changes (post reverting weak generic type detection) breaking on the order of 2% of packages. We ran into this when concatenating or interpolating
keyof T
into a string:Playground Link 4.6 / Playground Link 4.7
This new inclusion of symbol appears to be too eager in certain scenarios:
Playground Link 4.6 / Playground Link 4.7
Better detection of always true conditions
This caused 5 errors in 0.5% of packages, 1 of which is definitely an error (an un-awaited promise). The others are method definitions that are checked to exist, mostly in tests so they are probably intentional.
Changes in declaration emit
This version changed declaration emit in several ways that we found to be benign:
| undefined
on the parameter type if it was not explicitly added (this seems like a improvement)The text was updated successfully, but these errors were encountered: