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

Make es6-promise polyfill optional for consumers of npm package

Open alanpearce opened this issue 4 years ago • 0 comments

Libraries should not provide their own polyfills. I can see that some have already been removed from this package in the past, so I assume that's already well-understood here.

In order to keep a smooth upgrade process, I opted to add the polyfill to the webpack configuration rather than removing it outright. This way, consumers of the browser files (in dist/) will notice no changes. Consumers of the files in lib/ will either be consuming this package in nodejs or using a frontend build tool to generate output for a browser, where they will presumably already have configured their preferred polyfills (if applicable). The changes here allow such consumers to enjoy a smaller bundle size.

alanpearce avatar Mar 24 '21 16:03 alanpearce