{"action":"created","issue":{"url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/issues/44","repository_url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped","labels_url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/issues/44/comments","events_url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/issues/44/events","html_url":"https://github.com/tomwanzek/d3-v4-definitelytyped/issues/44","id":166192344,"number":44,"title":"d3-request Definitions","user":{"login":"tomwanzek","id":16323903,"avatar_url":"https://avatars.githubusercontent.com/u/16323903?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwanzek","html_url":"https://github.com/tomwanzek","followers_url":"https://api.github.com/users/tomwanzek/followers","following_url":"https://api.github.com/users/tomwanzek/following{/other_user}","gists_url":"https://api.github.com/users/tomwanzek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwanzek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwanzek/subscriptions","organizations_url":"https://api.github.com/users/tomwanzek/orgs","repos_url":"https://api.github.com/users/tomwanzek/repos","events_url":"https://api.github.com/users/tomwanzek/events{/privacy}","received_events_url":"https://api.github.com/users/tomwanzek/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/labels/d3-request","name":"d3-request","color":"5319e7"},{"url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/labels/help%20wanted","name":"help wanted","color":"128A0C"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/milestones/1","html_url":"https://github.com/tomwanzek/d3-v4-definitelytyped/milestones/Standard%20Bundle%20Modules%20(TypeScript%202)","labels_url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/milestones/1/labels","id":1847956,"number":1,"title":"Standard Bundle Modules (TypeScript 2)","description":"A complete set of definitions for the d3 modules contained in the **standard bundle of D3** as defined by Mike Bostock. Initial shape tests for internal consistency of the definitions.\r\n\r\nCovered is also a definitions file for the standard d3 bundle itself (re-export from included D3 modules).\r\n\r\nThis milestone has a primary focus on testing out UMD-style definitions and the ability to type the 'this' context of key callback functions, i.p. related to selections/transitions and the D3 approach to passing in DOM element references.","creator":{"login":"tomwanzek","id":16323903,"avatar_url":"https://avatars.githubusercontent.com/u/16323903?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwanzek","html_url":"https://github.com/tomwanzek","followers_url":"https://api.github.com/users/tomwanzek/followers","following_url":"https://api.github.com/users/tomwanzek/following{/other_user}","gists_url":"https://api.github.com/users/tomwanzek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwanzek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwanzek/subscriptions","organizations_url":"https://api.github.com/users/tomwanzek/orgs","repos_url":"https://api.github.com/users/tomwanzek/repos","events_url":"https://api.github.com/users/tomwanzek/events{/privacy}","received_events_url":"https://api.github.com/users/tomwanzek/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":43,"state":"open","created_at":"2016-06-25T00:56:49Z","updated_at":"2016-07-28T01:21:01Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-07-18T21:00:08Z","updated_at":"2016-07-29T02:34:25Z","closed_at":null,"body":"Add Definitions for **d3-request** module.\r\n\r\nImportant: Under this milestone _Data Acquisition (Enhanced)_. The definitions should be structured as proper modules/UMD-style module definitions. I.e., they should be comparable to the modules tracked under milestone _Core Modules (Enhanced)_ and contained in the  master branch of this repo.\r\n\r\nCombined with their tests, they should compile successfully using Typescript 2.0.0 (beta).\r\n\r\nThey should make use of function-context `this` typing, where appropriate, comparable to its use in under the _Core Modules (Enhanced)_ milestone.\r\n\r\nFor future consideration, `null` and `undefined` types should be used, where the API indicates the explicit types to be, e.g. for a function return type, `string | null` vs `string | undefined` vs. `string` only for non-nullable defined types.\r\n\r\nNote, however, that, currently and in correspondence to the approach taken by **DefinitelyTyped/types-2.0** the compiler is using the `\"strictNullChecks\": false` option."},"comment":{"url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/issues/comments/236079890","html_url":"https://github.com/tomwanzek/d3-v4-definitelytyped/issues/44#issuecomment-236079890","issue_url":"https://api.github.com/repos/tomwanzek/d3-v4-definitelytyped/issues/44","id":236079890,"user":{"login":"tomwanzek","id":16323903,"avatar_url":"https://avatars.githubusercontent.com/u/16323903?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwanzek","html_url":"https://github.com/tomwanzek","followers_url":"https://api.github.com/users/tomwanzek/followers","following_url":"https://api.github.com/users/tomwanzek/following{/other_user}","gists_url":"https://api.github.com/users/tomwanzek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwanzek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwanzek/subscriptions","organizations_url":"https://api.github.com/users/tomwanzek/orgs","repos_url":"https://api.github.com/users/tomwanzek/repos","events_url":"https://api.github.com/users/tomwanzek/events{/privacy}","received_events_url":"https://api.github.com/users/tomwanzek/received_events","type":"User","site_admin":false},"created_at":"2016-07-29T02:34:25Z","updated_at":"2016-07-29T02:34:25Z","body":"I looked into it and created a new branch `d3-request-finalization`. I made some initial suggested changes to the definitions see [here](https://github.com/tomwanzek/d3-v4-definitelytyped/blob/d3-request-finalization/src/d3-request/index.d.ts).\r\n\r\nThe issue that I see at this point is that adding generics to the interfaces `Request` and `DSVRequest` seems to add complication with predicting, how people want to use it in practice. I.e. there is no guarantee that people would use a request object comparable to a resource for a REST API. So imposing too much, may be making too many assumptions. Your comparison to Angular is somewhat instructive (talking about Angular 1.x here with `$http`, but also with the more elaborate `$resource`).\r\n\r\nThe major suggested fixes I made so far are as follows:\r\n* I gave the `DSVRequest` related signatures a makeover, now that d3-dsv is finished. Since d3-request formally has a dependency to d3-dsv, we can readily import it. (This means some of the initial tests fail right now, as they do not adhere to the signature) I checked the source code, it invokes the `csvParse` and `tsvParse`, respectively.\r\n* I went through the source code to look into the signatures for the event listeners and the context which is bound to them and the callbacks. I broke them out based on that understanding and added `this` typing as well. I know the D3 API documentation is not very explicit in this regard. This might be a worthwhile follow-up with Mike Bostock. Additional detail might be helpful and then there is the misguiding example in the doc which seems to imply that `load` listeners are called with two arguments (i.e. node-style)\r\n\r\nInstead of the generics at the interface level, it might simply suffice to add and beef up JSDoc comments. This is most critical for the interaction of the callbacks and `load`-event listener in relation to setting a value accessor with `response(...)` and/or adding a `row`-mapper for the `DSVRequests`. For `csv` and `dsv`, the convenience DSV request factories _with_ callbacks are internally consistent now. The problem arises, when the `url`-only signature is used and the other configuration/get-steps are performed separately on the returned object.\r\n\r\nAnyway, will need to update the tests to reflect the current thinking."}}
{"actor":{"display_login":"tomwanzek"}}