{"action":"created","issue":{"url":"https://api.github.com/repos/koajs/koa/issues/1196","repository_url":"https://api.github.com/repos/koajs/koa","labels_url":"https://api.github.com/repos/koajs/koa/issues/1196/labels{/name}","comments_url":"https://api.github.com/repos/koajs/koa/issues/1196/comments","events_url":"https://api.github.com/repos/koajs/koa/issues/1196/events","html_url":"https://github.com/koajs/koa/issues/1196","id":326187716,"node_id":"MDU6SXNzdWUzMjYxODc3MTY=","number":1196,"title":"Removing index signature from Typescript type definition for Context","user":{"login":"davewasmer","id":707213,"node_id":"MDQ6VXNlcjcwNzIxMw==","avatar_url":"https://avatars3.githubusercontent.com/u/707213?v=4","gravatar_id":"","url":"https://api.github.com/users/davewasmer","html_url":"https://github.com/davewasmer","followers_url":"https://api.github.com/users/davewasmer/followers","following_url":"https://api.github.com/users/davewasmer/following{/other_user}","gists_url":"https://api.github.com/users/davewasmer/gists{/gist_id}","starred_url":"https://api.github.com/users/davewasmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davewasmer/subscriptions","organizations_url":"https://api.github.com/users/davewasmer/orgs","repos_url":"https://api.github.com/users/davewasmer/repos","events_url":"https://api.github.com/users/davewasmer/events{/privacy}","received_events_url":"https://api.github.com/users/davewasmer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-24T15:59:48Z","updated_at":"2018-08-24T09:40:49Z","closed_at":"2018-08-24T09:40:49Z","author_association":"NONE","body":"I realize Koa is not a Typescript project, but I wanted to call out a potentially big change I'm proposing to the type definition over on DefinitelyTyped. DefinitelyTyped has a policy of automatically merging PRs that have no comments/objections, and I'd like to make sure this doesn't sneak in under the radar of anyone.\r\n\r\nThe full explanation can be found on [my DefinitelyTyped PR](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26008), but the tl;dr is:\r\n\r\nRemove the index signature from the Context interface to enforce stricter type checking. You can add it back yourself if you prefer a looser approach, but going the other direction (i.e. removing the index signature in your own project to enforce stricter types) is not currently possible in Typescript.\r\n\r\nThis means that by default you won't be able to randomly assign properties to `ctx` anymore - you'd need to augment the Koa module with the property's type definition:\r\n\r\n```ts\r\ndeclare module 'koa' {\r\n  export interface Context {\r\n    myCustomProp: boolean;\r\n  }\r\n}\r\n```\r\n\r\nOr add the index signature to get back today's behavior:\r\n\r\n```ts\r\ndeclare module 'koa' {\r\n  export interface Context {\r\n    [key: string]: any;\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/koajs/koa/issues/comments/415708696","html_url":"https://github.com/koajs/koa/issues/1196#issuecomment-415708696","issue_url":"https://api.github.com/repos/koajs/koa/issues/1196","id":415708696,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTcwODY5Ng==","user":{"login":"fl0w","id":71882,"node_id":"MDQ6VXNlcjcxODgy","avatar_url":"https://avatars3.githubusercontent.com/u/71882?v=4","gravatar_id":"","url":"https://api.github.com/users/fl0w","html_url":"https://github.com/fl0w","followers_url":"https://api.github.com/users/fl0w/followers","following_url":"https://api.github.com/users/fl0w/following{/other_user}","gists_url":"https://api.github.com/users/fl0w/gists{/gist_id}","starred_url":"https://api.github.com/users/fl0w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fl0w/subscriptions","organizations_url":"https://api.github.com/users/fl0w/orgs","repos_url":"https://api.github.com/users/fl0w/repos","events_url":"https://api.github.com/users/fl0w/events{/privacy}","received_events_url":"https://api.github.com/users/fl0w/received_events","type":"User","site_admin":false},"created_at":"2018-08-24T09:40:49Z","updated_at":"2018-08-24T09:40:49Z","author_association":"MEMBER","body":"Thank you for posting this. I'm closing this informational issue as it's still searchable."}}
{"actor":{"display_login":"fl0w"}}