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

fix(ci): upgrade dtslint #338

Merged
merged 5 commits into from
Dec 14, 2018
Merged

fix(ci): upgrade dtslint #338

merged 5 commits into from
Dec 14, 2018

Conversation

buschtoens
Copy link
Collaborator

@buschtoens buschtoens commented Dec 13, 2018

I found the cause for the failing dtslint step in #336: microsoft/dtslint#166

7ac937c: This PR works around the issue by forcing the last compatible definitelytyped-header-parser version via a yarn resolution.

This PR upgrades dtslint to the latest version to make it compatible with the latest version of definitelytyped-header-parser. This means, that typescript@next is now also validated. We probably want to disable this, since it's throwing errors for me, or we need to fix these errors.

@buschtoens
Copy link
Collaborator Author

buschtoens commented Dec 13, 2018

Funnily the errors are coming from external types:

Error: Errors in typescript@next for external dependencies:
../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'.
../../../node_modules/@types/ember-test-helpers/index.d.ts(62,18): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/ember-testing-helpers/index.d.ts(39,63): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/ember-testing-helpers/index.d.ts(42,73): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/ember/index.d.ts(321,30): error TS2304: Cannot find name 'Event'.
../../../node_modules/@types/ember__application/index.d.ts(91,18): error TS2304: Cannot find name 'HTMLElement'.
../../../node_modules/@types/ember__component/-private/view-mixin.d.ts(13,14): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/ember__utils/-private/types.d.ts(13,15): error TS2304: Cannot find name 'FileList'.
../../../node_modules/@types/jquery/JQuery.d.ts(5,29): error TS2304: Cannot find name 'HTMLElement'.
../../../node_modules/@types/jquery/JQuery.d.ts(85,45): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(229,80): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(533,34): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(533,64): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(546,31): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(546,61): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(559,30): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(559,60): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(572,31): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(585,30): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(598,33): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(598,63): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQuery.d.ts(1021,79): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(1021,89): error TS2304: Cannot find name 'DocumentFragment'.
../../../node_modules/@types/jquery/JQuery.d.ts(1934,49): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(2017,59): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(2068,35): error TS2304: Cannot find name 'Text'.
../../../node_modules/@types/jquery/JQuery.d.ts(2068,42): error TS2304: Cannot find name 'Comment'.
../../../node_modules/@types/jquery/JQuery.d.ts(3986,28): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(4101,46): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(4569,38): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(5352,48): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(5568,82): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/jquery/JQuery.d.ts(5568,97): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/jquery/JQuery.d.ts(5602,83): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/jquery/JQuery.d.ts(5602,98): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/jquery/JQuery.d.ts(5822,83): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(7108,52): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(7180,75): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(8525,55): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(8693,80): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(8693,90): error TS2304: Cannot find name 'DocumentFragment'.
../../../node_modules/@types/jquery/JQuery.d.ts(8868,52): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(9095,35): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(9109,35): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(9295,45): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/jquery/JQuery.d.ts(9689,70): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(9840,86): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(12478,74): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(12629,77): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(12759,79): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQuery.d.ts(12759,152): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(70,14): error TS2304: Cannot find name 'Window'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(101,23): error TS2304: Cannot find name 'HTMLElement'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(101,37): error TS2304: Cannot find name 'HTMLElement'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(101,102): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(140,23): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(140,33): error TS2304: Cannot find name 'HTMLElement'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(140,83): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(140,93): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(152,16): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(165,16): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(192,17): error TS2304: Cannot find name 'HTMLElement'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(192,48): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(206,17): error TS2304: Cannot find name 'HTMLElement'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(328,32): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(328,42): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(328,53): error TS2304: Cannot find name 'Window'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(341,25): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(341,45): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(342,15): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(414,81): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(414,91): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(414,102): error TS2304: Cannot find name 'Window'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(427,19): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(427,29): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(427,40): error TS2304: Cannot find name 'Window'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(475,19): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(475,29): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jquery/JQueryStatic.d.ts(475,40): error TS2304error Command failed with exit code 1.

@buschtoens
Copy link
Collaborator Author

Okay, managed to remove most errors by adding the dom lib.

This is remaining though:

13:20 $ lerna run --concurrency 1 --stream --no-bail dtslint
lerna notice cli v3.4.3
lerna info Executing command in 5 packages: "yarn run dtslint"
@ember-decorators/controller: yarn run v1.12.3
@ember-decorators/controller: $ dtslint published-types
@ember-decorators/controller: Error: Errors in typescript@next for external dependencies:
@ember-decorators/controller: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'.
@ember-decorators/controller:     at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19
@ember-decorators/controller:     at Generator.next ()
@ember-decorators/controller:     at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58)
@ember-decorators/controller: error Command failed with exit code 1.
@ember-decorators/controller: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@ember-decorators/data: yarn run v1.12.3
@ember-decorators/data: $ dtslint published-types
@ember-decorators/data: Error: Errors in typescript@next for external dependencies:
@ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(92,26): error TS2344: Type 'ModelRegistry[K]' does not satisfy the constraint 'Model'.
@ember-decorators/data:   Type 'Book | Person' is not assignable to type 'Model'.
@ember-decorators/data:     Type 'Book' is not assignable to type 'Model'.
@ember-decorators/data:       Types of property 'eachRelationship' are incompatible.
@ember-decorators/data:         Type '(callback: (name: string, details: RelationshipMeta) => void, binding?: any) => any' is not assignable to type '(callback: (name: string, details: RelationshipMeta) => void, binding?: any) => any'.
@ember-decorators/data:           Types of parameters 'callback' and 'callback' are incompatible.
@ember-decorators/data:             Types of parameters 'details' and 'details' are incompatible.
@ember-decorators/data:               Type 'RelationshipMeta' is not assignable to type 'RelationshipMeta'.
@ember-decorators/data:                 Types of property 'key' are incompatible.
@ember-decorators/data:                   Type '"toString" | "reload" | "title" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 48 more ... | "didDefineProperty"' is not assignable to type '"toString" | "reload" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 44 more ... | "didDefineProperty"'.
@ember-decorators/data:                     Type '"title"' is not assignable to type '"toString" | "reload" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 44 more ... | "didDefineProperty"'.
@ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(1013,58): error TS2344: Type 'M' does not satisfy the constraint 'Model'.
@ember-decorators/data:   Type 'ModelRegistry[K]' is not assignable to type 'Model'.
@ember-decorators/data:     Type 'Book | Person' is not assignable to type 'Model'.
@ember-decorators/data:       Type 'Book' is not assignable to type 'Model'.
@ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(1021,61): error TS2344: Type 'M' does not satisfy the constraint 'Model'.
@ember-decorators/data:   Type 'ModelRegistry[K]' is not assignable to type 'Model'.
@ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(1074,28): error TS2344: Type 'ModelRegistry[K]' does not satisfy the constraint 'Model'.
@ember-decorators/data:   Type 'Book | Person' is not assignable to type 'Model'.
@ember-decorators/data:     Type 'Book' is not assignable to type 'Model'.
@ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(1877,9): error TS2416: Property 'serializeIntoHash' in type 'RESTSerializer' is not assignable to the same property in base type 'JSONSerializer'.
@ember-decorators/data:   Type '(hash: {}, typeClass: Model, snapshot: Snapshot, options?: {} | undefined) => any' is not assignable to type '(hash: {}, typeClass: ModelRegistry[K], snapshot: Snapshot, options?: {} | undefined) => any'.
@ember-decorators/data:     Types of parameters 'typeClass' and 'typeClass' are incompatible.
@ember-decorators/data:       Type 'ModelRegistry[K]' is not assignable to type 'Model'.
@ember-decorators/data:         Type 'Book | Person' is not assignable to type 'Model'.
@ember-decorators/data:           Type 'Book' is not assignable to type 'Model'.
@ember-decorators/data:     at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19
@ember-decorators/data:     at Generator.next ()
@ember-decorators/data:     at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58)
@ember-decorators/data: error Command failed with exit code 1.
@ember-decorators/data: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@ember-decorators/object: yarn run v1.12.3
@ember-decorators/object: $ dtslint published-types
@ember-decorators/object: Error: Errors in typescript@next for external dependencies:
@ember-decorators/object: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'.
@ember-decorators/object:     at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19
@ember-decorators/object:     at Generator.next ()
@ember-decorators/object:     at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58)
@ember-decorators/object: error Command failed with exit code 1.
@ember-decorators/object: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@ember-decorators/service: yarn run v1.12.3
@ember-decorators/service: $ dtslint published-types
@ember-decorators/service: Error: Errors in typescript@next for external dependencies:
@ember-decorators/service: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'.
@ember-decorators/service:     at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19
@ember-decorators/service:     at Generator.next ()
@ember-decorators/service:     at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58)
@ember-decorators/service: error Command failed with exit code 1.
@ember-decorators/service: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@ember-decorators/component: yarn run v1.12.3
@ember-decorators/component: $ dtslint published-types
@ember-decorators/component: Error: Errors in typescript@next for external dependencies:
@ember-decorators/component: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'.
@ember-decorators/component:     at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19
@ember-decorators/component:     at Generator.next ()
@ember-decorators/component:     at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58)
@ember-decorators/component: error Command failed with exit code 1.
@ember-decorators/component: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@buschtoens
Copy link
Collaborator Author

I've tried ember-cli-typescript#324 to no avail. But maybe I did something wrong.

@buschtoens buschtoens changed the title fix(ci): circumvent Microsoft/dtslint#166 fix(ci): upgrade dtslint Dec 13, 2018
@buschtoens
Copy link
Collaborator Author

buschtoens commented Dec 13, 2018

I've tried ember-cli-typescript#324 to no avail. But maybe I did something wrong.

Adding this to published-types causes a lot of new errors for TS 2.7.

Error: Errors in typescript@2.7 for external dependencies:
../../../node_modules/@types/ember__object/-private/types.d.ts(16,26): error TS1005: ';' expected.
../../../node_modules/@types/ember__object/-private/types.d.ts(16,34): error TS2304: Cannot find name 'S'.
../../../node_modules/@types/ember__object/-private/types.d.ts(16,38): error TS2304: Cannot find name 'K'.
../../../node_modules/@types/ember__object/-private/types.d.ts(16,42): error TS2693: 'never' only refers to a type, but is being used as a value here.
../../../node_modules/@types/ember__object/-private/types.d.ts(17,1): error TS1128: Declaration or statement expected.
../../../node_modules/@types/ember__object/-private/types.d.ts(17,3): error TS2304: Cannot find name 'keyof'.
../../../node_modules/@types/ember__object/-private/types.d.ts(17,9): error TS1005: ',' expected.
...

@jamescdavis thankfully explained why:

the latest ember/ember-data types require TS >= 2.8

For example:

../../../node_modules/@types/ember__object/-private/types.d.ts(16,26): error TS1005: ';' expected.

is because
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ember__object/-private/types.d.ts#L16
uses a conditional type, introduced in 2.8.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ember-data/index.d.ts#L7
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ember/index.d.ts#L13

To me this means we have to drop support for TypeScript 2.7 here as well.

@buschtoens
Copy link
Collaborator Author

I've "fixed" all setups except for the data package. I don't think, that it is possible to keep the @hasMany('boo') // $ExpectError. We need to use the following interface in order for the ember-data types to work:

export default interface ModelRegistry {
  [key: string]: any;
}

So it's an either / or situation, I guess?

Kicking off multiple concurrenct dtslint instances that all try to install TS fails.
@buschtoens
Copy link
Collaborator Author

buschtoens commented Dec 14, 2018

WTF does 8c64d83 pass on CI? I did this locally:

yarn cache clean && rm -rf node_modules/ && yarn install --frozen-lockfile
yarn exec dtslint -- --installAll
yarn dtslint

Which gave me:

Errors in typescript@next for external dependencies:
../../../node_modules/@types/ember-data/index.d.ts(92,26): error TS2344: Type 'ModelRegistry[K]' does not satisfy the constraint 'Model'.
  Type 'Book | Person' is not assignable to type 'Model'.
    Type 'Book' is not assignable to type 'Model'.
      Types of property 'eachRelationship' are incompatible.
        Type '(callback: (name: string, details: RelationshipMeta<Book>) => void, binding?: any) => any' is not assignable to type '(callback: (name: string, details: RelationshipMeta<Model>) => void, binding?: any) => any'.
          Types of parameters 'callback' and 'callback' are incompatible.
            Types of parameters 'details' and 'details' are incompatible.
              Type 'RelationshipMeta<Book>' is not assignable to type 'RelationshipMeta<Model>'.
                Types of property 'key' are incompatible.
                  Type '"toString" | "reload" | "title" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 48 more ... | "didDefineProperty"' is not assignable to type '"toString" | "reload" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 44 more ... | "didDefineProperty"'.
                    Type '"title"' is not assignable to type '"toString" | "reload" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 44 more ... | "didDefineProperty"'.
../../../node_modules/@types/ember-data/index.d.ts(1013,58): error TS2344: Type 'M' does not satisfy the constraint 'Model'.
  Type 'ModelRegistry[K]' is not assignable to type 'Model'.
    Type 'Book | Person' is not assignable to type 'Model'.
      Type 'Book' is not assignable to type 'Model'.
../../../node_modules/@types/ember-data/index.d.ts(1021,61): error TS2344: Type 'M' does not satisfy the constraint 'Model'.
  Type 'ModelRegistry[K]' is not assignable to type 'Model'.
../../../node_modules/@types/ember-data/index.d.ts(1074,28): error TS2344: Type 'ModelRegistry[K]' does not satisfy the constraint 'Model'.
  Type 'Book | Person' is not assignable to type 'Model'.
    Type 'Book' is not assignable to type 'Model'.
../../../node_modules/@types/ember-data/index.d.ts(1877,9): error TS2416: Property 'serializeIntoHash' in type 'RESTSerializer' is not assignable to the same property in base type 'JSONSerializer'.
  Type '<K extends "book" | "person">(hash: {}, typeClass: Model, snapshot: Snapshot<K>, options?: {} | undefined) => any' is not assignable to type '<K extends "book" | "person">(hash: {}, typeClass: ModelRegistry[K], snapshot: Snapshot<K>, options?: {} | undefined) => any'.
    Types of parameters 'typeClass' and 'typeClass' are incompatible.
      Type 'ModelRegistry[K]' is not assignable to type 'Model'.
        Type 'Book | Person' is not assignable to type 'Model'.
          Type 'Book' is not assignable to type 'Model'.

I need to apply 2606f69 in order for everything to pass. How the hell does it work on CI? 😂

@pzuraq
Copy link
Contributor

pzuraq commented Dec 14, 2018

@mike-north can you take a look at this too?

@pzuraq
Copy link
Contributor

pzuraq commented Dec 14, 2018

Confirmed out of band that this looks good, thanks a ton for figuring this out @buschtoens! This was huge!

@@ -1,4 +1,4 @@
// TypeScript Version: 2.7
// TypeScript Version: 2.8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was introduced here to break TS 2.7 support for this file?

@pzuraq pzuraq merged commit 958fdc8 into ember-decorators:master Dec 14, 2018
@mike-north
Copy link
Collaborator

we should not be dropping TS 2.7 support here, unless the types for this library require types that can only be expressed using TS 2.8+ features. Is this the case? Can an older version of @types/ember not meet similar needs?

@jamescdavis
Copy link
Contributor

It's because @types/ember-data v3 dependency, no?:

import TransformRegistry from 'ember-data/types/registries/transform';
import ModelRegistry from 'ember-data/types/registries/model';

export function hasMany<K extends keyof ModelRegistry>(

@buschtoens
Copy link
Collaborator Author

@mike-north Part of the conversation happened on Discord.

Can an older version of @types/ember not meet similar needs?

Very good point indeed. I will try whether a downgrade of the Ember types can fix this incompatibility on Monday. The question is: is this the right trade-off to make, if possible?

@jamescdavis
Copy link
Contributor

@buschtoens @mike-north
I was thinking @types/ember-data v3 needed TS 2.8+ (and ember-decorators needs @types/ember-data v3 to be compatible with the new-style registries), but after looking closely, there's nothing in @types/ember-data v3 that actually requires 2.8 (yet). I confirmed this by bumping the version down to 2.7 and running dtslint. The tests fail for 2.7 because the tsconfig says use ember__object/proxy for @ember/object/proxy, which definitely requires 2.8, but the .d.ts files themselves work fine with 2.7.

@mike-north
Copy link
Collaborator

@jamescdavis I think you're on the right track here. I have to keep reminding myself of how limited ambient type testing is. In an ideal world, we'd be able to run dtslint on these types against an older version of @types/ember and @types/ember-data and they should still pass, but I know of no such tooling that faciliates this.

@buschtoens
Copy link
Collaborator Author

@jamescdavis @mike-north So do we keep it at 2.8 or is there a possibility to downgrade again?

@buschtoens buschtoens deleted the fix/ci branch December 18, 2018 10:08
@pzuraq
Copy link
Contributor

pzuraq commented Jan 2, 2019

@mike-north @jamescdavis where are we at on this? There are some things blocked on a release of decorators, but I don't want to release unless we're ok with dropping TS 2.7 support

@mike-north
Copy link
Collaborator

mike-north commented Jan 2, 2019

I'd say drop 2.7 support, since you require types that need 2.8 in their most recent release. This kind of change (excessively bumping minimum supported TS version) bugs me, but the tooling for a better way of handling it doesn't exist.

@jamescdavis
Copy link
Contributor

I agree on both counts. The safer thing to do here is drop 2.7 because the user is highly likely to need 2.8+ anyways, but it sure would be nice to know for sure.

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

Successfully merging this pull request may close these issues.

None yet

4 participants