Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrink package size #67

Closed
TimDaub opened this issue Jun 26, 2017 · 2 comments
Closed

Shrink package size #67

TimDaub opened this issue Jun 26, 2017 · 2 comments
Assignees

Comments

@TimDaub
Copy link
Contributor

TimDaub commented Jun 26, 2017

The driver's current package sizes are - though uglified - almost 500KB.

bigchaindb-driver.amd.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.amd.min.js	application/javascript	582.1 kB	2017-07-05T16:26:28.000Z
bigchaindb-driver.amd.min.js.map	application/json	2.34 MB	2017-07-05T16:26:28.000Z
bigchaindb-driver.cjs.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.cjs.min.js	application/javascript	582.08 kB	2017-07-05T16:22:50.000Z
bigchaindb-driver.cjs.min.js.map	application/json	2.34 MB	2017-07-05T16:22:50.000Z
bigchaindb-driver.cjs2.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.cjs2.min.js	application/javascript	582.06 kB	2017-07-05T16:26:28.000Z
bigchaindb-driver.cjs2.min.js.map	application/json	2.34 MB	2017-07-05T16:26:28.000Z
bigchaindb-driver.umd.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.umd.min.js	application/javascript	582.29 kB	2017-07-05T16:22:50.000Z
bigchaindb-driver.umd.min.js.map	application/json	2.35 MB	2017-07-05T16:22:50.000Z
bigchaindb-driver.window.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.window.min.js	application/javascript	582.07 kB	2017-07-05T16:22:50.000Z
bigchaindb-driver.window.min.js.map	application/json	2.34 MB	2017-07-05T16:22:50.000Z

That's too much. I'm suspecting that we're injecting a bit to many dependencies or are using a bit to many babel shims that have to get included in the uglified bundle.

The goal here is the following:

  • see what options we have to shrink the bundle
  • aim for realistic target
  • play with uglify options to see if package size can be decreased
  • see if there is dependencies that could now be replaced with native browser functionality
  • etc.

I'm sure there's lots of tutorials on the web to shrink package sizes.

@jernejpregelj
Copy link
Contributor

Driver size: 510 kB

Biggest included packages:
./node_modules/five-bells-condition/dist/index.js 396 kB {0} [built]
./node_modules/node-libs-browser/node_modules/buffer/index.js 48.6 kB {0} [built]

To get output of all modules included in build execute webpack with --display-modules parameter.

@future-is-present
Copy link
Contributor

Seen @jernejpregelj comment, I close this issue and I create the same issue but for the js-crypto-conditions repository as is the one causing a big size of the JS BigchainDB Driver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants