{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/types-publisher/issues/214","repository_url":"https://api.github.com/repos/Microsoft/types-publisher","labels_url":"https://api.github.com/repos/Microsoft/types-publisher/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/types-publisher/issues/214/comments","events_url":"https://api.github.com/repos/Microsoft/types-publisher/issues/214/events","html_url":"https://github.com/Microsoft/types-publisher/issues/214","id":194499510,"number":214,"title":"Need a long term solution to supporting users on bleeding edge versions of typescript","user":{"login":"ericanderson","id":120899,"avatar_url":"https://avatars.githubusercontent.com/u/120899?v=3","gravatar_id":"","url":"https://api.github.com/users/ericanderson","html_url":"https://github.com/ericanderson","followers_url":"https://api.github.com/users/ericanderson/followers","following_url":"https://api.github.com/users/ericanderson/following{/other_user}","gists_url":"https://api.github.com/users/ericanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/ericanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericanderson/subscriptions","organizations_url":"https://api.github.com/users/ericanderson/orgs","repos_url":"https://api.github.com/users/ericanderson/repos","events_url":"https://api.github.com/users/ericanderson/events{/privacy}","received_events_url":"https://api.github.com/users/ericanderson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-09T02:38:04Z","updated_at":"2016-12-09T05:51:37Z","closed_at":null,"body":"It makes sense to not want to break existing users with a \"^\" dependency on something like `@types/react`, but it hinders the very users and organizations that help the TS ecosystem. The introduction of `Partial<>` and co in particular is a big game changer, and many users would benefit from updates to react and lodash in particular.\r\n\r\nThe current policy has been stated as waiting 30 days before allowing new features into DefinitelyTyped to avoid breaking people. While I disagree with the policy, I think it we as a community can do better to support those on the bleeding edge.\r\n\r\nConsidering the situation, I'd like to propose a few options.\r\n\r\n**Option A**, do nothing. There are work arounds if you want to start moving fast, such as hacking `paths` and `typeRoots` in your tsconfig. I have documented one such solution here: https://medium.com/@ericlanderson/using-custom-typescript-definitions-with-ts-2-x-3121db84015d#.tvqw3rmth\r\n\r\nWhile this works, its a hassle.\r\n\r\n**Option B**: Someone (maybe me) forks DefinitelyTyped and allows changes for the latest and greatest right away. I could publish this as something like \"types-edge\" in npm and provide documentation for how to configure your tsconfig to allow for it to work. \r\n\r\nWhile this works, it half forks the community, and creates a burden on myself to keep up to date with DefinitelyTyped. It also hinders discoverability. I think this hurts the ecosystem, but its better than everyone manually forking type definitions.\r\n\r\n**Option C**: DefinitelyTyped and Microsoft support the development of these edge versions on a branch within DefinitelyTyped (lets call it \"edge\" or even use \"master\"). Microsoft could then register the org @types-edge and publish the edge branch. The DefinitelyTyped and Microsoft people could then as a group keep merging types-2.0 (which should really be called \"stable\" in this world) into edge, while allowing the community to grow and move quickly. If desired, there could also be a \"nightly\" branch and a corresponding @types-nightly (I would have personally liked this as the second `Partial<>` and `keyof` got merged, I started using it immediately). This would also mean the types are already being updated and ready to go when the next TS release happens.\r\n\r\nThere could also be a release of typescript 2.1.1 pretty quickly that adds \"./node_modules/@types-edge\" to the default list of for the `paths` and the `typeRoots` in tsconfig. \r\n\r\nI think this is the best short-term solution.\r\n\r\n**Option D**: Add macros to TS. (Yeah this is dirty). But the macros could allow things like `#if typescriptVersion >= 2.1.0` and allow additional definitions to be placed into the type files. This would still require the 30 day grace period before it could be introduced (maybe in TS 2.2?) but would future proof this problem and allow just a single npm org for publishing types. Its also not backwards compatible, but it would be the easiest to maintain in DefinitelyTyped.\r\n\r\n**Option E**: Add additional meta-data support to package.json to declare types with a minimum version. This could look something like:\r\n```json\r\n{\r\n  \"...\": \"...\",\r\n  \"types2\": {\r\n    \">=2.1.0\": \"index-2.1.0.d.ts\"\r\n  }\r\n}\r\n```\r\n\r\nNewer versions of typescript can look at this instead of `types` and choose the highest version that maps.\r\n\r\nThis would be a PITA to support, IMHO. You could do it with branches in DT, but now we have to support forward merging changes to types-2.0 to types-2.1 and then types-2.2, etc. Or you have to keep the different versions in the same branch and remember to change them all when adding new functionality.\r\n\r\nAnother way to do this, which I have no idea if it would work given future changes to TS are unknown, is write scripts that convert the latest typings into older versions. For example, pretty much every typing that would want `Partial<T>` could just be mutated at the time the publisher runs to replace it with `T`. `Pick` is probably `any` in the old world. `ReadonlyArray` support wouldn't have been broken cause it could just be `Array`. This would require custom scripts for each new release but it might not be awful.\r\n\r\nThere are probably other ways to do it, but these are the ones that came to me today. I would really love to hear the opinions of a bunch of people: @andy-ms, @ahejlsberg, @pspeter3 @vsiao @johnnyreilly, @jkillian, and more.\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/Microsoft/types-publisher/issues/comments/265939436","html_url":"https://github.com/Microsoft/types-publisher/issues/214#issuecomment-265939436","issue_url":"https://api.github.com/repos/Microsoft/types-publisher/issues/214","id":265939436,"user":{"login":"pspeter3","id":607701,"avatar_url":"https://avatars.githubusercontent.com/u/607701?v=3","gravatar_id":"","url":"https://api.github.com/users/pspeter3","html_url":"https://github.com/pspeter3","followers_url":"https://api.github.com/users/pspeter3/followers","following_url":"https://api.github.com/users/pspeter3/following{/other_user}","gists_url":"https://api.github.com/users/pspeter3/gists{/gist_id}","starred_url":"https://api.github.com/users/pspeter3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pspeter3/subscriptions","organizations_url":"https://api.github.com/users/pspeter3/orgs","repos_url":"https://api.github.com/users/pspeter3/repos","events_url":"https://api.github.com/users/pspeter3/events{/privacy}","received_events_url":"https://api.github.com/users/pspeter3/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T05:51:37Z","updated_at":"2016-12-09T05:51:37Z","body":"I agree that this seems like an issue that should be solved by npm and not @types or DefinitelyTyped. Since the 2.0 types are published, nothing is force upgrading users. Eg, if you have pinned the version of TypeScript, you have hopefully pinned the version of your type definitions."}}
{"actor":{"display_login":"pspeter3"}}