Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

feat: Provide access to bundled libraries when in browser #732

Merged

Conversation

vasco-santos
Copy link
Contributor

@vasco-santos vasco-santos commented Apr 4, 2018

In this PR, the bundled libraries mentioned in 406, as well as ipfs/js-ipfs#525 (comment) were added the same way as in js-ipfs.

The stream was not added since the current bundlers, such as browserify, rollup and webpack automatically add native implementations for it. Moreover, the same occurs with the Buffer, which is already being exported in the root of the object. For consistency, I added it to types as it is on js-ipfs and maintained it on the object root, for avoiding a breaking change. However, I think that we should remove the export of the Buffer in both places in a future breaking change, in order to decrease the bundle size, as a result of it being automatically added by the bundlers, such as stream.

It is also important pointing out that adding this exports increased the bundled size as follows:

Original

  • Webpack build = 2.75MB
  • Minify = 1.35MB

PR

  • Webpack build = 2.92MB
  • Minify = 1.42MB

For this issue, other 2 PRs were created

Close #406

@vasco-santos vasco-santos force-pushed the feat_provide-access-to-bundled-libraries-when-in-browser branch from 3d4b90a to 3d468f3 Compare April 5, 2018 10:25
@ghost ghost assigned daviddias Apr 5, 2018
@daviddias daviddias merged commit 994bdad into master Apr 5, 2018
@daviddias daviddias deleted the feat_provide-access-to-bundled-libraries-when-in-browser branch April 5, 2018 15:05
@ghost ghost removed the in progress label Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide access to bundled libraries when run in browser
2 participants