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

Browser specific lib options #23156

Closed
grimly opened this issue Apr 5, 2018 · 2 comments
Closed

Browser specific lib options #23156

grimly opened this issue Apr 5, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@grimly
Copy link

grimly commented Apr 5, 2018

TypeScript Version: 2.8.1

Search Terms: lib ie11 browser

Related Issues: #14308

Hello,

I am working and making sure my application works on IE11 as it is used within my company and by most of our clients but how often did I run into this sad issue of using some part of the JS lib and finding out it doesn't exist in IE11. I often can use polyfills (Promise) or alternatives (Map instead of Set).

I was wondering if browser specific librairies has been considered an option, at least for the Microsoft browsers.

This project being maintained by Microsoft, I would have expected to be able to use any IE and Edge version as a lib option. This would make clear what to use and not to use from ES5 and ES6 and some DOM definitions.

As an example, IE11 doesn't have Promise or many of the new Array methods, but has WeakMap and MutationObserver. We can't really say IE11 is ES5 or ES6 ready but some of it is available.

I think this "request" may also be filled by an external project since this was done for NodeJS in @types/node.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 5, 2018

This issue has been referenced before in #6640 and #4692.

Keep in mind that the library file is not special. it is a .d.ts file just like any, we have included it with the compiler for convenience. you can build your own that has less or more declarations, and the compiler will check against them.

The lib file is auto-generated and is not managed manually. we auto-generate it from Edge-spec. this is easy for us to maintain and keep up to-date. we have been working on generating it from the standard webidl files. see #3027.

We do not plan on maintain that list of all versions of browsers and their matching declarations, it is just too much work that we can not commit to.

There is no reason why you cannot fork the lib file and generate one for IE11, or IE10 or any specific version of a browser you are targeting. this is a simpler problem than having to maintain a library for a all versions of all browsers.

I think this is a duplicate of #19183 and #3027

@mhegazy mhegazy added the Duplicate An existing issue was already created label Apr 5, 2018
@grimly
Copy link
Author

grimly commented Apr 5, 2018

Thank you for the response.

I will close since the answer is no but as I gave the nodejs example, it is doable by a third party.

@grimly grimly closed this as completed Apr 5, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants