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

requireJS can't find crossfilter2 #1304

Open
gordonwoodhull opened this issue May 24, 2017 · 2 comments
Open

requireJS can't find crossfilter2 #1304

gordonwoodhull opened this issue May 24, 2017 · 2 comments
Labels
Milestone

Comments

@gordonwoodhull
Copy link
Contributor

I'm going to file this issue preemptively, because we are changing the way dc.js loads crossfilter and it is going to break requireJS and other AMD package loaders.

https://github.com/crossfilter/crossfilter, the community fork of crossfilter, has a different filename (crossfilter.js) from its module name (crossfilter2). But requireJS (and presumably other AMD loaders) assumes that the module name will be the same as the filename.

From dc.js 2.0.3 and 2.1.5 onward, index.js and the UMD footer of dc.js will refer to the module name crossfilter2 instead of crossfilter.

requireJS users will need to rename crossfilter.js to crossfilter2.js when copying it into position, or use the requireJS paths, or map configuration options to specify that the filename is different from the module name.

http://requirejs.org/docs/api.html#config-paths
http://requirejs.org/docs/api.html#config-map

For further discussion, please see crossfilter/crossfilter#75

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone May 24, 2017
gordonwoodhull added a commit that referenced this issue May 24, 2017
this breaks requireJS but fixes webpack - since the community fork of
crossfilter has a different package name from its filename, one or the
other packaging system is going to be unhappy.

requireJS users will need to rename crossfilter.js to crossfilter2.js
when copying it into position, or use the requireJS paths or map
configuration options to specify that the filename is different from the
module name.

http://requirejs.org/docs/api.html#config-paths
http://requirejs.org/docs/api.html#config-map

fixes #1213
fixes #1214
fixes #1261
fixes #1293
fixes #1302
breaks #1304!
@mtraynham
Copy link
Contributor

mtraynham commented May 25, 2017

With Webpack, the workaround for older versions was:

    resolve: {
        alias: {
            crossfilter: 'crossfilter2'
        }
    },

Thanks for fixing though, I can finally remove that.

@gordonwoodhull
Copy link
Contributor Author

Yes, the problem was that some webpack based projects e.g. angular-cli did not permit changing the config at all. Whereas requireJS is always open for configuration afaik.

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

No branches or pull requests

2 participants