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

Remove IE-only types from lib.d.ts #2698

Closed
Arnavion opened this issue Apr 9, 2015 · 9 comments
Closed

Remove IE-only types from lib.d.ts #2698

Arnavion opened this issue Apr 9, 2015 · 9 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@Arnavion
Copy link
Contributor

Arnavion commented Apr 9, 2015

The various MS* interfaces and vars don't exist except in IE, and their extra properties are added to the standard properties. Eg: HTMLElement.style is of type MSStyleCSSProperties instead of CSSStyleDeclaration, which allows element.style.pixelWidth to compile but be undefined at runtime.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 9, 2015

@zhengbli has a change to update lib.d.ts to remove them. see PR #2645

@mhegazy mhegazy added the Bug A bug in TypeScript label Apr 9, 2015
@Arnavion
Copy link
Contributor Author

Arnavion commented Apr 9, 2015

That PR gets rid of pixelWidth and style is now CSSStyleDeclaration, but I see it's added ms- and webkit-prefixed properties and functions. That would lead to the same problem.

But I can see the usefulness of wanting to support code like var animation = style.animation || style.webkitAnimation; Should it also include moz-prefixed stuff then?

@mhegazy
Copy link
Contributor

mhegazy commented Apr 9, 2015

These are auto generated; @zhengbli has a script that allows creating the lib file from webidl definitions. we can augment the script to add these definitions as well, assuming we have a webidl for them.

@zhengbli
Copy link
Contributor

Yeah the new spec got ride of many of those interfaces but some still remain. I guess after publishing the script it is possible to create a customized version that removes all IE-only content.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 10, 2015

Can we remove the ones that are not needed from extensions.d.ts, specifically Map, Set and the typed arrays?

@mhegazy mhegazy added this to the TypeScript 1.5 milestone Apr 10, 2015
@zhengbli
Copy link
Contributor

Yeah I'm working on that too. Thanks!

@zhengbli
Copy link
Contributor

I ran a little analysis of the extension interfaces, and found out the use count of each one in the new spec:

ArrayBuffer: 5
ArrayBufferView: 17
Int8Array: 0
Uint8Array: 7
Int16Array: 0
Uint16Array: 0
Int32Array: 4
Uint32Array: 0
Float32Array: 21
Float64Array: 0
DataView: 0
Map: 0
WeakMap: 0
Set: 0

I plan to remove the unused ones and keep the others if that looks good.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 11, 2015

Here is what i propose:

From extenstions.d.ts remove:
DataView: 0
Map: 0
WeakMap: 0
Set: 0

Update types in extentions.d.ts to use the same typings in es.d.ts
ArrayBuffer: 5
ArrayBufferView: 17
Int8Array: 0
Uint8Array: 7
Int16Array: 0
Uint16Array: 0
Int32Array: 4
Uint32Array: 0
Float32Array: 21
Float64Array: 0

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 18, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Apr 18, 2015

should be fixed by #2739

@mhegazy mhegazy closed this as completed Apr 18, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants