launchdarkly / js-client-sdk

LaunchDarkly Client-side SDK for Browser JavaScript
Other
109 stars 62 forks source link

Consider providing ES6 builds #254

Open wojtekmaj opened 1 year ago

wojtekmaj commented 1 year ago

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" :)

kinyoklion commented 1 year ago

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

wojtekmaj commented 1 year ago

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.

vitalikda commented 1 year ago

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

adrigardi90 commented 1 year ago

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

tniezurawski commented 9 months ago

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?