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

Unclear what is transpiled and what must be polyfilled #26087

Closed
SaphuA opened this issue Jul 31, 2018 · 2 comments
Closed

Unclear what is transpiled and what must be polyfilled #26087

SaphuA opened this issue Jul 31, 2018 · 2 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@SaphuA
Copy link

SaphuA commented Jul 31, 2018

Search Terms

polyfill, transpile

Suggestion

We are targeting es5 in our project and have included the following libs:
es5, es2015.collection, es2015.promise, dom, scripthost

What I do not understand is how I am supposed to know if Promises (defined in es2015.promise) must be polyfilled, but that ReadonlySet (defined in es2015.collection) is transpiled to proper es5. This will only become clear during runtime and that is exactly what we're trying to avoid when using TypeScript.

My suggestion / question is if it is possible to make it clear when adding libs when it is required to polyfill them and when it is not.

@RyanCavanaugh RyanCavanaugh added the Question An issue which isn't directly actionable in code label Jul 31, 2018
@RyanCavanaugh
Copy link
Member

Syntax is always "polyfilled". For example, TS will emit the extends helper if you use class inheritance.

Functions and values are never polyfilled. We will not provide an implementation for Promise or ReadonlySet or any other top-level value or property thereof.

@typescript-bot
Copy link
Collaborator

This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants