-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix(cli/dts): add typings for Change Array by copy proposal #16499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update tools/update_typescript.md
in point 6. about lib.esnext.array.d.ts
I was also thinking, we might want to make the Edit: these changes can be upstreamed afterwards as well: microsoft/TypeScript#50333 |
(Copied from resolved comment thread)
I'm not sure if it's that simple why there aren't complex typings. Many of the array methods were implemented in far older type systems so they did not have the ability to use these new type features without breaking old code. I'd consider this an inflection point in improving the user-experience with types. Also, if you type this as any, then no one who cares about sufficiently safe code will want to use this new feature. Please reconsider. Edit: There has also been a shift in the official typescript typings towards using more complex types in an effort to improve DX. Some examples: |
@sno2 this is a stop-gap solution until TypeScript supports this feature officially. I believe it's better to use looser types now and narrow them later, than be too strict right now. |
Why release loose types only to break libraries and codebases a few months later? You can always add looser behavior later if the typescript team somehow chooses to use |
Okay, after confering with other team members it seems it's better to go with too strict than too loose types here. Thanks for bringing this up @sno2! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for taking care of this Leo
Closes #16496