Skip to content

Remove reference to WeakMap from tslib.d.ts #94

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

Merged
merged 3 commits into from
Feb 26, 2020

Conversation

rbuckton
Copy link
Contributor

@rbuckton rbuckton commented Feb 26, 2020

Unfortunately, WeakMap may not be declared when using tslib with a project that has "lib": ["es5"] set.

Fixes: #93

Unfortunately, `WeakMap` may not be declared when using tslib with a project that has `"lib": ["es5"]` set.
Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

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

Honestly I wonder if we should just make them any. Even that constraint of object is limiting us to 2.1. But let's just get this in.

@rbuckton
Copy link
Contributor Author

I don't see that as an issue since 2.1 is also the first version of TypeScript that supported tslib/--importHelpers: http://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html#support-for-external-helpers-library-tslib

@ExE-Boss
Copy link
Contributor

Would adding the following solve this?

/// <reference lib="es2015.collection"/>

Or would it cause unintended consequences?

@HolgerJeromin
Copy link

Would adding the following solve this?
/// <reference lib="es2015.collection"/>
Or would it cause unintended consequences?

This would pull the collection in every consumer of tslib.d.ts, would it?

@DanielRosenwasser
Copy link
Member

/// <reference lib /> doesn't work for older versions. Honestly, tslib isn't meant to be used directly, so even having these types be accurate isn't useful.

@DanielRosenwasser DanielRosenwasser merged commit 5d26e24 into master Feb 26, 2020
@DanielRosenwasser DanielRosenwasser deleted the remove-weakmap branch February 26, 2020 18:46
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.

v1.11.0 contains reference to WeakMap which is breaking older TypeScript version usages
4 participants