Closed nomego closed 3 years ago
@kum-deepak can answer this better, but dc.js doesn't depend on d3-collection, which was removed from d3@6. This module is attempting to detect whether d3@5 or d3@6 is active and won't call nest
in the latter case. It is expecting non-existent imports to yield null.
Perhaps we need better support for users doing their own transpilation.
@gordonwoodhull Well even though it's not specified in package.json
, using the es6 modules approach, it's an unconditional import statement dependency, so it's technically a dependency for the es6 module approach as the code is designed right now.
There's not a strict need to transpile either, since es6 modules are supported natively in the browser. The reason it's being handled by the server is because it's a bare import without and import map.
Either it should be added as a package.json dep, imported conditionally or import removed altogether.
Yes, it indeed would cause issues. Let me see how to resolve it.
Thanks! The dev ux of modern web app development with es modules is amazing and the tree shaking has huge potential in the dc.js/crossfilter/d3js setup. I'll gladly compare my example bundles when this is sorted out if you're interested.
I created a sample open-wc app at https://github.com/nomego/dc-owc to highlight some ES6 issues with dc.js
First off is that just by doing
import { BarChart } from 'dc'
I get an error:So the d3-collection dep is missing from dc.js 4.2.5 but mandatory