Skip to content

Update the Typescript target to ES2015 or beyond #956

@monfera

Description

@monfera

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions