js-client-sdk icon indicating copy to clipboard operation
js-client-sdk copied to clipboard

Consider providing ES6 builds

Open wojtekmaj opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe.

Currently, the code is compiled to ES5. This makes js-client-sdk way heavier than it needs to be. From my experiments, as much as 1/4 could be shaved off by compiling code to ES6.

Describe the solution you'd like

target: "es6" :)

wojtekmaj avatar Jul 28 '22 08:07 wojtekmaj

Hello @wojtekmaj,

Thank you for the request.

The main interest here is the packaged size of the SDK, correct?

Filed internally as 162092

Thank you, Ryan

kinyoklion avatar Jul 28 '22 16:07 kinyoklion

Yep! You technically can use e.g. Webpack alias to rewrite imports to use src folder & build the library yourself, but I think it's too much of a hassle for most developers. Even having two builds alongside, if you don't want any breaking changes for the time being, would be a big quality of life improvement.

wojtekmaj avatar Jul 28 '22 16:07 wojtekmaj

@kinyoklion any updates here? Looks like react sdk was already converted to ES6

vitalikda avatar Sep 06 '22 10:09 vitalikda

Same, it would be helpful to get it compiled to ES6 so the bundle size improves. I would have expected it to be smaller in the first place

adrigardi90 avatar Oct 05 '22 09:10 adrigardi90

Looks like the size of the lib is growing:

image

As mentioned above, react SDK benefited from the switch:

image

although the numbers are not as impressive as @wojtekmaj's predictions maybe the result would be better for this project 🤷‍♂️ . Anyway, maybe compiling to ES6 is not a bad idea?

tniezurawski avatar Sep 27 '23 21:09 tniezurawski