Cleanup 2019 part 1#33278
Conversation
baidu-app: Not sure what is wrong here. Taking away the extra thunk doesn't break any tests, though. bluebird-tests: Bluebird is invariant on R now. Not sure why. Could be bad? cordova-sqlite-storage: Just a project ownership change. d3-array: return-type inference seems higher priority than before. Probably not a big deal since I think people usually don't specify types for variable declarations.
|
@weswigham you might want to take a look at bluebird since I don't understand why it wasn't invariant before. Same for baidu, although there I have no idea what changed. |
|
@sandersn Thank you for submitting this PR! 🔔 @taoqf @lhecker @rafw87 @gustavderdrache @borisyankov @tomwanzek @denisname - 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. |
|
@sandersn - only in case you have time: Can you elaborate what you mean with "Bluebird is invariant on R now."? I’m familiar with invariants from math, but I’m not sure how they fit to your sentence. I can’t comment on the changes to |
|
@lhecker The term comes from variance in type theory. That a type T is invariant on a parameter P means that In this example, previously bluebird's This is simpler, but might break some users of bluebird. The change is due to microsoft/TypeScript#29817. |
|
A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
|
@sandersn Thanks! I'll try to remember the nomenclature this time. 😄 Although I do have to agree with you... That might be pretty bad for Bluebird or even TS in general. Are you (or the original author @weswigham) sure such a change isn't a bit too serious? I mean the following is broken in the newest nightly, but works using the current release. import Bluebird from "bluebird";
class Base {
base: string;
}
class Derived extends Base {
derived: number;
}
// Error on the next line:
// Type 'Bluebird<Derived>' is not assignable to type 'Bluebird<Base>'.
const promise: Bluebird<Base> = Bluebird.resolve(new Derived);
promise.then(instance => console.log(instance.base));Either way... If this change does land in a release will it be part of TS 3? |
|
@lhecker Yeah, I think that bluebird should be fixed and that my change to the tests is wrong. I'm not sure whether the fix should be in typescript or in bluebird's definitions. |
|
I'm going to revert the bluebird changes until I can talk to @weswigham about the right fix here. |
|
I just published |
|
I just published |
baidu-app: Not sure how this worked before. Taking away the extra thunk doesn't break any tests.
bluebird-tests:
thrownow correctly returnsneverinstead of passing through the original type.Rnow. Not sure why. Could be bad?cordova-sqlite-storage: Just a project ownership change.
d3-array: return-type inference seems higher priority than before, or maybe index access types. Probably not a big deal since I think people usually don't specify types for variable declarations.
Part 2 will fix ember.