-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Prepare for TS #32460 #37057
Prepare for TS #32460 #37057
Conversation
@ahejlsberg Thank you for submitting this PR! 🔔 @MartynasZilinskas @theruther4d @Jessidhia @arvitaly @lochbrunner @johnnyreilly @jgoz - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
@ahejlsberg The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
👋 Hi there! I’ve run some quick performance metrics against master and your PR. This is still an experiment, so don’t panic if I say something crazy! I’m still learning how to interpret these metrics. Let’s review the numbers, shall we? react-dom/v16Comparison details for react-dom/v16 📊
First off, note that the system varied slightly between these two runs, so you’ll have to take these measurements with a grain of salt. It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place. react-test-renderer/v16Comparison details for react-test-renderer/v16 📊
It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place. storage-helper/v1Comparison details for storage-helper/v1 📊
It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place. If you have any questions or comments about me, you can ping |
Updated numbers for you here from 612754b: react-dom/v16Comparison details for react-dom/v16 📊
First off, note that the system varied slightly between these two runs, so you’ll have to take these measurements with a grain of salt. It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place. react-test-renderer/v16Comparison details for react-test-renderer/v16 📊
It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place. |
// but having an "| {}" makes it harder to accidentally use. | ||
export function act(callback: () => void | undefined): DebugPromiseLike | {}; | ||
// the actual return value is always a "DebugPromiseLike". | ||
export function act(callback: () => void | undefined): DebugPromiseLike; |
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.
@Jessidhia Without | {}
, you could call act().then(...)
without a cast - is that correct? Is there some other way to make it harder to use this (presumably internal) API?
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.
It is still really hard to call act.then(...)
because you get a compile error unless you pass two callbacks that each return never
.
The type {} | DebugPromiseLike
is definitely suspicious. Ordinarily the compiler would just reduce it to {}
(since DebugPromiseLike
is a subtype of {}
), but for reasons of efficiency and backwards compatibility we don't always reduce unions. With the changes in microsoft/TypeScript#32460 we now infer {}
for T
when inferring from {} | DebugPromiseLike
to T | PromiseLike<T>
, which certainly is a better inference than the previous {} | DebugPromiseLike
.
I just published |
I just published |
* Prepare for TS DefinitelyTyped#32460 * Revert change
* Prepare for TS DefinitelyTyped#32460 * Revert change
Prepare
react-dom
andreact-test-renderer
for microsoft/TypeScript#32460.