{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJS/issues/870","labels_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/870/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/870/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/870/events","html_url":"https://github.com/ReactiveX/RxJS/pull/870","id":120214469,"number":870,"title":"Adding plumbing to support more granular and maintainable typings","user":{"login":"david-driscoll","id":1269157,"avatar_url":"https://avatars.githubusercontent.com/u/1269157?v=3","gravatar_id":"","url":"https://api.github.com/users/david-driscoll","html_url":"https://github.com/david-driscoll","followers_url":"https://api.github.com/users/david-driscoll/followers","following_url":"https://api.github.com/users/david-driscoll/following{/other_user}","gists_url":"https://api.github.com/users/david-driscoll/gists{/gist_id}","starred_url":"https://api.github.com/users/david-driscoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-driscoll/subscriptions","organizations_url":"https://api.github.com/users/david-driscoll/orgs","repos_url":"https://api.github.com/users/david-driscoll/repos","events_url":"https://api.github.com/users/david-driscoll/events{/privacy}","received_events_url":"https://api.github.com/users/david-driscoll/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-03T16:29:33Z","updated_at":"2015-12-08T23:27:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ReactiveX/RxJS/pulls/870","html_url":"https://github.com/ReactiveX/RxJS/pull/870","diff_url":"https://github.com/ReactiveX/RxJS/pull/870.diff","patch_url":"https://github.com/ReactiveX/RxJS/pull/870.patch"},"body":"This is based on the original #715, I've broken it out into 2 branches so far, with other branches to follow after getting some feedback.\r\n\r\nToday Rx has 3 or 4 places where the typings have to be updated, for the consumer to be able to actually get type information and consume that type information.\r\n\r\n* Observable.ts\r\n* Rx.KitchenSink.ts\r\n* CoreOperators.ts\r\n* The operator in question\r\n\r\nThe goal here is to be able to add well defined typings for an operator, and then extract that type information using a common convention, into another interface.  This extraction is an automated process, such that as changes are made to the operator the interface will automatically be updated.\r\nThis new interface for the operator can then be used where it needs to be, by simply using `typeof`.  \r\n\r\n#715 was a proof of concept for me, and I only added all the typings I did because I was testing it with `omnisharp-atom` and `omnisharp-client`, both which use Rx4 extensively.  Once all the work was done, the compile times were reduced, and there were minimal changes that needed to be made to the source for things to \"compile\" correctly (I ran into other issues, but that isn't important to this case)\r\n\r\n#### Pros\r\n* All the type information now lives with the operator\r\n* Only have to make a change to 1 file, to update the consumer.\r\n* Allows us to have enhanced types for the operators, things like tuples for `combineLatest` instead of `Observable<any[]>\r\n\r\n#### Cons\r\n* Additional step in the build workflow.\r\n* Adds some magic contributors need to know about\r\n* The operator injection onto `Observable` might be obsolete with TS 1.8\r\n  * I don't think we'll have the ability to type `this` yet, which is still one thing this tooling would be valuable for.\r\n* Currently doing this one operator at a time breaks the build, for no other reason than a stackoverflow. :(\r\n* _I'm sure there are cons I'm missing at the moment_\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxJS/issues/comments/163055339","html_url":"https://github.com/ReactiveX/RxJS/pull/870#issuecomment-163055339","issue_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/870","id":163055339,"user":{"login":"kwonoj","id":1210596,"avatar_url":"https://avatars.githubusercontent.com/u/1210596?v=3","gravatar_id":"","url":"https://api.github.com/users/kwonoj","html_url":"https://github.com/kwonoj","followers_url":"https://api.github.com/users/kwonoj/followers","following_url":"https://api.github.com/users/kwonoj/following{/other_user}","gists_url":"https://api.github.com/users/kwonoj/gists{/gist_id}","starred_url":"https://api.github.com/users/kwonoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwonoj/subscriptions","organizations_url":"https://api.github.com/users/kwonoj/orgs","repos_url":"https://api.github.com/users/kwonoj/repos","events_url":"https://api.github.com/users/kwonoj/events{/privacy}","received_events_url":"https://api.github.com/users/kwonoj/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T23:27:48Z","updated_at":"2015-12-08T23:27:48Z","body":"> It may also be worth investigating Microsoft/TypeScript#5290 to see\r\n\r\n: would you able to elaborate usecases for this PR to those feature?"}}