Skip to content
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

v3: Better use of generic default arguments #29

Open
ksaldana1 opened this issue Oct 4, 2018 · 0 comments
Open

v3: Better use of generic default arguments #29

ksaldana1 opened this issue Oct 4, 2018 · 0 comments
Milestone

Comments

@ksaldana1
Copy link
Contributor

ksaldana1 commented Oct 4, 2018

TS 3.0 introduced a breaking change that changed the behavior of how null & undefined resolve with intersection types.

This breaking change hit us particularly hard because of use of null as a generic default parameter in a few places, including both the app "creator" and the app connector.

As a short-term "hacky" fix, we are continuing to use null as our sentinel value, while handling it explicitly downstream where we intersect our types. This is not sustainable and pretty much just serves as a footgun when working in this codebase.

The longer-term solution is thinking harder about the API and where we land on the inference/explicit declaration spectrum. I believe we have overused generic defaults in the current code base, including places where it could ultimately be inferred.

@ksaldana1 ksaldana1 added this to the 3.0 milestone Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant