packages icon indicating copy to clipboard operation
packages copied to clipboard

How to use microlibrary that's not in default D3 bundle?

Open hzhu opened this issue 8 years ago • 1 comments

https://github.com/d3/d3/blob/master/CHANGES.md#table-of-contents

"D3 4.0 is modular. Instead of one library, D3 is now many small libraries that are designed to work together. You can pick and choose which parts to use as you see fit. Each library is maintained in its own repository, allowing decentralized ownership and independent release cycles. The default bundle combines about thirty of these microlibraries."

In a CLJS project, how should one go about using a micro library that isn't bundled with the default CLJSJS D3 bundle?

hzhu avatar Jul 18 '16 07:07 hzhu

It should definitely be possible to create a repo per d3 submodule. But it may require a good amount of work to be done.

Generating UMD compatible JS file: By the looks of it, each submodule has a prepublish task which makes generation of the file possible.

Externs: We will need an extern file per submodule. This is likely to take most amount of time.

D3 v4.0 even supports creation of a custom bundle using Rollup which actually does tree shaking etc. to get the package even smaller. But that is out of scope for this project.

ducky427 avatar Jul 18 '16 08:07 ducky427