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

Offer a modern build without ES5 transpilation #785

Open
DrewML opened this issue Jun 19, 2024 · 1 comment
Open

Offer a modern build without ES5 transpilation #785

DrewML opened this issue Jun 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@DrewML
Copy link

DrewML commented Jun 19, 2024

Summary

Requesting a build of the Amplitude Browser SDK that does not transpile syntax supported by most browsers for a few years.

Motivations

My employer is using Amplitude, and we've noticed that the Amplitude TypeScript Browser SDK is compiling post-ES5 syntax (classes, async/await, rest args, etc) to ES5-compatible syntax. This works, but adds additional network I/O for our users (we do not support pre ES2015 JS engines).

We'd like to request that the npm package begin publishing non-transpiled standard JavaScript as an additional option, in addition to the CJS and ESM builds.

Screenshots

Example of build output set to target: es5

image

Example of build output set to target: es2020

image
@DrewML DrewML added the enhancement New feature or request label Jun 19, 2024
@Mercy811
Copy link
Contributor

@DrewML, I built the analytics-browser with es2020 the got the sizes

  • lib/es5/index.js 993 bytes
  • lib/es2020/index.js 962 bytes
    As improvement: (993 - 962) / 993 = 3% is low, we will put it in our roadmap and keep you updated.

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

No branches or pull requests

2 participants