{"action":"created","issue":{"url":"https://api.github.com/repos/crossfilter/reductio/issues/57","repository_url":"https://api.github.com/repos/crossfilter/reductio","labels_url":"https://api.github.com/repos/crossfilter/reductio/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/crossfilter/reductio/issues/57/comments","events_url":"https://api.github.com/repos/crossfilter/reductio/issues/57/events","html_url":"https://github.com/crossfilter/reductio/issues/57","id":409587470,"node_id":"MDU6SXNzdWU0MDk1ODc0NzA=","number":57,"title":"Correct `crossfilter2` dependency for AMD usage.","user":{"login":"shea-parkes","id":5782892,"node_id":"MDQ6VXNlcjU3ODI4OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5782892?v=4","gravatar_id":"","url":"https://api.github.com/users/shea-parkes","html_url":"https://github.com/shea-parkes","followers_url":"https://api.github.com/users/shea-parkes/followers","following_url":"https://api.github.com/users/shea-parkes/following{/other_user}","gists_url":"https://api.github.com/users/shea-parkes/gists{/gist_id}","starred_url":"https://api.github.com/users/shea-parkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shea-parkes/subscriptions","organizations_url":"https://api.github.com/users/shea-parkes/orgs","repos_url":"https://api.github.com/users/shea-parkes/repos","events_url":"https://api.github.com/users/shea-parkes/events{/privacy}","received_events_url":"https://api.github.com/users/shea-parkes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-02-13T01:59:13Z","updated_at":"2019-02-15T12:32:10Z","closed_at":null,"author_association":"NONE","body":"The current ~UMD build doesn't correctly specify the `crossfilter2` dependency for AMD style dependencies.\r\n\r\nIn particular, this is on the first line of the ~compiled `reductio.js`:\r\n```javascript\r\nif(\"function\"==typeof define&&define.amd)define([],e)\r\n```\r\nAnd then it later tries to load `crossfilter` via:\r\n```javascript\r\nvar crossfilter = (typeof window !== \"undefined\" ? window['crossfilter'] : typeof global !== \"undefined\" ? global['crossfilter'] : null);\r\n```\r\n\r\n\r\nI believe the dependency should be properly expressed via something like this:\r\n```javascript\r\nif(\"function\"==typeof define&&define.amd)define(['crossfilter2'],e)\r\n```\r\n\r\nI'm sure this is all supposed to be handled by the build tools, but their current settings are causing me to have to export `crossfilter2` as a global to use in an AMD environment.\r\n\r\nFor what it's worth, `dc.js` works well in an AMD environment.  Their ~compiled form includes this definition:\r\n```javascript\r\nif(typeof define === \"function\" && define.amd) {\r\n        define([\"d3\", \"crossfilter2\"], _dc);\r\n    }\r\n```\r\n\r\nI realize this may not be a high priority for you, but I can always hope that it's an easy fix.  Or at least I can warn other users (that might still be using an AMD environment).\r\n\r\nThanks for the nice tool.  It's working very nicely in a 2-level aggregation scenario with a `dc.js` solution."},"comment":{"url":"https://api.github.com/repos/crossfilter/reductio/issues/comments/464032953","html_url":"https://github.com/crossfilter/reductio/issues/57#issuecomment-464032953","issue_url":"https://api.github.com/repos/crossfilter/reductio/issues/57","id":464032953,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2NDAzMjk1Mw==","user":{"login":"shea-parkes","id":5782892,"node_id":"MDQ6VXNlcjU3ODI4OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5782892?v=4","gravatar_id":"","url":"https://api.github.com/users/shea-parkes","html_url":"https://github.com/shea-parkes","followers_url":"https://api.github.com/users/shea-parkes/followers","following_url":"https://api.github.com/users/shea-parkes/following{/other_user}","gists_url":"https://api.github.com/users/shea-parkes/gists{/gist_id}","starred_url":"https://api.github.com/users/shea-parkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shea-parkes/subscriptions","organizations_url":"https://api.github.com/users/shea-parkes/orgs","repos_url":"https://api.github.com/users/shea-parkes/repos","events_url":"https://api.github.com/users/shea-parkes/events{/privacy}","received_events_url":"https://api.github.com/users/shea-parkes/received_events","type":"User","site_admin":false},"created_at":"2019-02-15T12:32:10Z","updated_at":"2019-02-15T12:32:10Z","author_association":"NONE","body":"Oh, and my current workaround if someone is looking for a way to make this work:\r\n```javascript\r\ndefine('globalCrossfilter', ['crossfilter2'], crossfilter2 => window.crossfilter = crossfilter2)\r\n```\r\nAnd then be sure to require `globalCrossfilter`.  The current ~compiled reductio will use a ~global crossfilter if available."}}
{"actor":{"display_login":"shea-parkes"}}