Skip to content

[6.4] [ts] enable support for iterators in browsers (#22986)#23015

Merged
spalger merged 1 commit intoelastic:6.4from
spalger:backport/6.4/pr-22986
Sep 21, 2018
Merged

[6.4] [ts] enable support for iterators in browsers (#22986)#23015
spalger merged 1 commit intoelastic:6.4from
spalger:backport/6.4/pr-22986

Conversation

@spalger
Copy link
Copy Markdown
Contributor

@spalger spalger commented Sep 13, 2018

Backports the following commits to 6.4:

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 73c8166 into elastic:6.4 Sep 21, 2018
@spalger spalger deleted the backport/6.4/pr-22986 branch September 21, 2018 19:58
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