cljsjs / packages

DEPRECATED: Javascript libraries packaged up with Google Closure externs
http://cljsjs.github.io
786 stars 816 forks source link

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

Open hzhu opened 8 years ago

hzhu commented 8 years ago

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?

ducky427 commented 8 years ago

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.