ReactiveX / IxJS

The Interactive Extensions for JavaScript

Home Page:https://reactivex.io/IxJS/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript 3.6

WorldMaker opened this issue · comments

IxJS version: 2.5.3

Code to reproduce:

Expected behavior:

Actual behavior:

IxJS does not compile with the updates that have been made to the standard library in Typescript 3.6, especially with the changes to Iterable types in 3.6 it appears. (Maybe especially there with strictNullTypes on because a lot of the places seem to be SomeType | undefined is not assignable to SomeType.)

Additional information:

Thanks for the report. I haven't been following the 3.6 changes, but I'll look into it. @mattpodwysocki this is probably worth fixing before releasing the rewrite branch.

FWIW, this could be related to what appears to be a TypeScript-3.6 bug that effects inference errors in RxJS: ReactiveX/rxjs#4992 microsoft/TypeScript#33131 microsoft/TypeScript#33125

Also, the problem is likely fixed in TypeScript 3.6.3 - that release fixed the problems that were effected in RxJS.

especially with the changes to Iterable types in 3.6 it appears

If you're getting errors about an Iterator or IterableIterator, it's probably because the version of @types/node in your project needs an update.

Error compiling with ixjs

ERROR in /home/LOM0227/project/ALM.AssetPush/node_modules/@reactivex/ix-es2015-cjs/asynciterable/fromnodestream.d.ts
ERROR in /home/LOM0227/project/ALM.AssetPush/node_modules/@reactivex/ix-es2015-cjs/asynciterable/fromnodestream.d.ts(12,5):
TS2416: Property 'next' in type 'ReadableStreamAsyncIterable' is not assignable to the same property in base type 'AsyncIterator<string | Buffer, any, undefined>'.
  Type '(size?: number | undefined) => Promise<IteratorResult<string | Buffer, any>>' is not assignable to type '(...args: [] | [PromiseLike<undefined> | undefined]) => Promise<IteratorResult<string | Buffer, any>>'.
    Types of parameters 'size' and 'args' are incompatible.
      Type '[] | [PromiseLike<undefined> | undefined]' is not assignable to type '[(number | undefined)?]'.
        Type '[PromiseLike<undefined> | undefined]' is not assignable to type '[(number | undefined)?]'.
          Types of property '0' are incompatible.
            Type 'PromiseLike<undefined> | undefined' is not assignable to type 'number | undefined'.
              Type 'PromiseLike<undefined>' is not assignable to type 'number'.

ixjs version

$ npm ls @reactivex/ix-es2015-cjs
assetpush@0.0.0 /home/LOM0227/project/ALM.AssetPush
    @reactivex/ix-es2015-cjs@2.5.3

Also, the problem is likely fixed in TypeScript 3.6.3

nope

$ npm ls typescript --depth 0
assetpush@0.0.0 /home/LOM0227/project/ALM.AssetPush
    typescript@3.6.3 

the version of @types/node in your project needs an update

nope

$ npm ls @types/node --depth 0
assetpush@0.0.0 /home/LOM0227/project/ALM.AssetPush
    @types/node@12.7.9