dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 62 forks source link

Problem since TypeScript 2.7.1 – Type 'M[keyof M]' does not satisfy the constraint 'EventObject<keyof M>' #382

Closed inad9300 closed 6 years ago

inad9300 commented 6 years ago

I have a dependency on @dojo/loader version 0.1.1 for testing (I'm using the Intern framework and this seems to be required for some use case). After upgrading to TypeScript 2.7.1 (from 2.6.2), I started to see this exceptions coming from @dojo/core:

node_modules/@dojo/core/Evented.d.ts(32,95): error TS2344: Type 'M[keyof M]' does not satisfy the constraint 'EventObject<keyof M>'.
node_modules/@dojo/core/Evented.d.ts(58,72): error TS2344: Type 'M[K]' does not satisfy the constraint 'EventObject<K>'

This happens when I run intern, but seems to be related with Dojo alone.

agubler commented 6 years ago

Currently Dojo 2 packages only support up to typescript ~2.6.2

inad9300 commented 6 years ago

Any plan to fix that in the near future?

agubler commented 6 years ago

It’s an enhancement and it’s on the roadmap but it’s unlikely to be before release candidate and release.

dylans commented 6 years ago

@inad9300 To be clear, the first release candidate for Dojo 2 is due this week, and the release shortly thereafter (probably 2 more weeks?), and then as soon as 2.0 ships, one of the first items on our list is to update to TS 2.7. So it depends on your definition of near future being 1 week (no) or 1 month (most likely).

inad9300 commented 6 years ago

Is a release including this merge scheduled? Thank you!

agubler commented 6 years ago

Hey @inad9300, @dojo/core has been released with these changes on 0.5.0.

inad9300 commented 6 years ago

My question is about @dojo/loader. (Edit Which I guess depends on @dojo/core.)

agubler commented 6 years ago

@inad9300 dojo/loader does not depend on dojo/core

inad9300 commented 6 years ago

OK, I see it is Intern which is depending on it, which still uses version 0.3.0. Thanks for the update, I'll see with them.