Amplitude-TypeScript icon indicating copy to clipboard operation
Amplitude-TypeScript copied to clipboard

Offer a modern build without ES5 transpilation

Open DrewML opened this issue 1 year ago • 1 comments

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 avatar Jun 19 '24 15:06 DrewML

@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.

Mercy811 avatar Jun 24 '24 22:06 Mercy811