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

Update the Typescript target to ES2015 or beyond #956

Closed
3 tasks
monfera opened this issue Dec 23, 2020 · 0 comments · Fixed by #2054
Closed
3 tasks

Update the Typescript target to ES2015 or beyond #956

monfera opened this issue Dec 23, 2020 · 0 comments · Fixed by #2054
Labels
enhancement New feature or request

Comments

@monfera
Copy link
Contributor

monfera commented Dec 23, 2020

Is your feature request related to a problem? Please describe.
There's no longer a known motivation for transpiling to ES5. Meanwhile, transpiling to ES5 has negatives:

  • bundling may need more time and work, due to rolling more polyfills and doing more code transforms
  • the bundle is larger and slower, including certain functions in some hot loops, eg. the spread functions
  • the larger the transpilation source->target delta, the poorer the job the source map does, and the more mangled the things, leading to impaired dev tools use

Describe the solution you'd like
Identify a new target; not yet sure what it should be, but feel like it should be everything that is an intersection of our code use, and what the evergreen browsers provide. Examples:

  • everything ES2015
  • all the spreads / destructuring assignments we use, incl. object spread, ...rest etc.
  • null coalescing
  • optional chaining

I think it'd be a good goal for us to only stick to language constructs that are either in ES2015 or at least, directly supported by the browsers we support as the mainstream. This adds convenience and language expressivity, while does not remove direct mapping to code that the browser runs. Avoids implicitly rolled polyfills that have all kinds of performance costs.

Another motive is that avoidance of polyfills is good practice in that polyfills routinely throw exceptions on otherwise good input, so in many ways, they're temporary hacks.

Kibana Cross Issues
Add any Kibana related issues/feature requests here.

Checklist

Delete any items that are not applicable to this feature request.

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants