-
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
Design Meeting Notes, 1/31/2020 #36623
Comments
People new to TS often carry the need to write defensive code everywhere even if it's unnecessary. If TS implicitly added This also seems like it would break the no-unnecessary-condition lint rule, which is really useful for changing this behavior over time. |
Misc. thoughts from a random user:
|
We don't like the type aliases (especially the leading |
Hey @DanielRosenwasser , are there plans to implement the string utility types? Are you seeking contributors for those? I'd like to help, as I'm very much interested in this feature. Although I have no experience working with the TS code base at all, I'd like to invest my time. Maybe it could help me fix one bug or another in the future 😄 |
No plans right now - we had a mock-up demonstrated at the design meeting, but the concern was more about complexity and speed. |
Should an Optional Chain Always Add
undefined
to the Type?#36163 (comment)
If index signatures included
undefined
, you'd getundefined
.Defensive code in general.
But we have plenty of places where we don't make
||
conservative.Okay, but are you going to trust that the user wrote
?.
for a reason, or assume we have a perfect type system?Seems like the indexing case is hard to explain to users
Are people encountering this?
Why would you write
?.
on a defined type unless you planned to immediately handle them?Should we also change
||
and&&
?Discussion inconclusive
Augmenting Keys
#12754
Some demand to do two things:
Would be nice to write
Could you do something like the following?
Created a prototype that wires up a bunch of type aliases that have special behavior:
Won't these cause a lot of exponential explosions in the type system?
Can we not use type aliases for everything here?
Many of these aren't useful on generics - what if we just let people write actual code to do this?
Do we think this is something we want to solve?
The text was updated successfully, but these errors were encountered: