Skip to content

[6.x] [ts] enable support for iterators in browsers (#22986)#23014

Merged
spalger merged 1 commit intoelastic:6.xfrom
spalger:backport/6.x/pr-22986
Sep 13, 2018
Merged

[6.x] [ts] enable support for iterators in browsers (#22986)#23014
spalger merged 1 commit intoelastic:6.xfrom
spalger:backport/6.x/pr-22986

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented Sep 13, 2018

Backports the following commits to 6.x:

I was surprised when I tried to spread a `Set` in TypeScript and the browser complained about `Set.slice()` not being defined. This is because TypeScript does not automatically enable support for iterators when targeting earlier ES versions, like we do in the browser, unless you use the `"downlevelIteration": true` compiler option. This injects some helpers into the necessary files for reading/spreading iterators, which can be stuffed behind an import statement with using the `"importHelpers": true` compiler option and include `tslib` in our dependencies. This is already a dependency of several of our packages, so it shouldn't cause any additional modules.
@spalger spalger added the backport This PR is a backport of another PR label Sep 13, 2018
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@spalger spalger merged commit 489779a into elastic:6.x Sep 13, 2018
@spalger spalger deleted the backport/6.x/pr-22986 branch September 13, 2018 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants