Skip to content

[v8] Drop support for ES5 #9829

Closed
@mydea

Description

@mydea

Currently, we emit JS (both in the CDN bundles, as well as in the npm packages) that is ES5 (down to IE11) compatible.

In v8, we want to stop emitting ES5, and instead emit newer JS standard.

I would propose to emit ES2017. You can see a decent overview of new features here: https://en.wikipedia.org/wiki/ECMAScript_version_history#ES2017

ES2017 includes:

  • basic ES6
  • async/await
  • [].includes()
  • Object.values(), Object.entires(), object.getOwnPropertyDescriptors()

ES2018 added Promise.finally, which is nice but not so important for us I'd say.
ES 2019 added [].flat / [].flatMap(), and Object.fromEntries() (which again is nice, but nothing we use too much).
ES2020 is nice because it adds nullish coalescing and globalThis, but it is pretty recent ("just" 3 years old...)

This means that in v8, we will not ship any polyfills for stuff below ES2017. If you still need to support older browsers, you need to polyfill/transpile the SDK yourself (which most bundlers will do anyhow for you).

Open questions

  • Should we target Es2017 or something else?
  • Should we continue to provide ES5 CDN bundles?
  • We started some work to have the loader detect ES6 support. Maybe we should revisit this and actually ship this? To avoid breaking loader users that still need ES5 support (for them, providing polyfills is harder than for npm users)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions