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

[lodash] change weakmap declaration to work with TS 2.2 #14502

Closed
wants to merge 6 commits into from

Conversation

budiadiono
Copy link
Contributor

In TS 2.2 WeakMap interface for ES6 has been changed from WeakMap<K, V> to WeakMap<K extends object, V>. This changes makes @types/lodash not working with new ES6 introduced in TS2.2.

To keep the backward compatibility with ES5, I think it is safe to rename the WeakMap declaration.

I know TS 2.2 is still in RC version now, but many people using it, including me :). So if you think this is too early and also bad idea then feel free to close this PR without merging it.

If this get merged then it's should close #14324.

@dt-bot
Copy link
Member

dt-bot commented Feb 8, 2017

lodash/index.d.ts

to authors (@bczengel @chrootsu @stepancar). Could you review this PR?
👍 or 👎?

Checklist

  • pass the Travis CI test?

MartinSGill added a commit to MartinSGill/vscode-spell-checker that referenced this pull request Feb 8, 2017
Typescript 2.2.0 is in RC and npm is alrady downloading it based on the previous dependency version rules.

VSCode is currently using 2.1.5, so it seems to make sense to follow that version, additinally the 2.2 compiler has a breaking change with lodash that prevents building spellchecker if tsc 2.2 is used.  cf.  DefinitelyTyped/DefinitelyTyped#14502
@kerbyfc
Copy link

kerbyfc commented Feb 8, 2017

Please, verify it %)

@eschwartz
Copy link

What do you think about WeakMapLike instead of WeakMapES5?

I'm just thinking about how custom Promise libraries used to talk about "promise-like" objects, that conformed to the Promise/A+ spec, but were not actual native Promise objects.

@budiadiono
Copy link
Contributor Author

WeakMapLike is sounds good. @bczengel, @chrootsu, @stepancar what do you think?

@kerbyfc
Copy link

kerbyfc commented Feb 10, 2017

I can't use lodash without this fix...

@joewood
Copy link

joewood commented Feb 15, 2017

Any ETA on getting this merged?

@budiadiono
Copy link
Contributor Author

This pull request is dirty since contains another junk commits. I've made another one in pull request #14662. I also follow @eschwartz suggestion to use WeakMapLike instead of WeakMapES5.

@budiadiono budiadiono closed this Feb 16, 2017
dahlbyk added a commit to NewBoCo/DefinitelyTyped that referenced this pull request Mar 7, 2017
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.

Lodash All declarations of 'WeakMap' must have identical type parameters.
5 participants