launchdarkly / react-client-sdk

LaunchDarkly Client-side SDK for React.js
Other
86 stars 68 forks source link

Consider providing ES6 builds #146

Closed wojtekmaj closed 2 years ago

wojtekmaj commented 2 years 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" :)

XieX commented 2 years ago

Good catch, thanks for the suggestion. We were just gearing up to give the React SDK a little attention, I'll add this to the list!

XieX commented 2 years ago

By my testing this knocks off a little under 2kb (compressed), which isn't bad, and I will try to work this into a release. Mind if I ask what your experimental method is for getting nearly 1/4? I'm just going by npm packs output, which may be naive.

XieX commented 2 years ago

This went out in 2.27. Managed to shave off just over 1kb zipped, not as much as I'd hoped, but not nothing.

wojtekmaj commented 2 years ago

A good chunk of react-client-sdk size is js-client-sdk, so I would expect further improvements to follow.