{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/4917","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/4917/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/4917/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/4917/events","html_url":"https://github.com/facebook/flow/issues/4917","id":258649505,"number":4917,"title":"RFC: Versioned .js.flow files","user":{"login":"mruzekw","id":108522,"avatar_url":"https://avatars0.githubusercontent.com/u/108522?v=4","gravatar_id":"","url":"https://api.github.com/users/mruzekw","html_url":"https://github.com/mruzekw","followers_url":"https://api.github.com/users/mruzekw/followers","following_url":"https://api.github.com/users/mruzekw/following{/other_user}","gists_url":"https://api.github.com/users/mruzekw/gists{/gist_id}","starred_url":"https://api.github.com/users/mruzekw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruzekw/subscriptions","organizations_url":"https://api.github.com/users/mruzekw/orgs","repos_url":"https://api.github.com/users/mruzekw/repos","events_url":"https://api.github.com/users/mruzekw/events{/privacy}","received_events_url":"https://api.github.com/users/mruzekw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-09-18T23:17:33Z","updated_at":"2017-10-31T19:52:12Z","closed_at":null,"author_association":"NONE","body":"# The Problem\r\n\r\nImagine you have a shared library of (React) components shared across your company's projects. \r\n\r\nThis library is on its own version of flow, while all consumers are also on different versions of flow.\r\n\r\nSometimes this results in different flow errors in each project. For example, a comment suppression may be needed and valid in the library, but the consuming app's version of flow throws an `Unused suppression` error. Another case might be the use of opaque types in the library, but the app's flow doesn't support them yet. \r\n\r\nAnother side effect is that it's difficult to make major upgrades (e.g. 0.53.x regarding React).\r\n\r\n# Proposed Solution\r\n\r\nCurrently flow consumes *.js.flow files found in a published (public or private) package.\r\n\r\nTo solve the problem, flow could also consume version-tagged files.\r\n\r\nFor example, type definitions intended for 0.52 would be available with a *.js.flow-0.52.x file\r\n\r\nNote: Generating the different versions of types would be a separate issue\r\n\r\n# Why not...\r\n\r\n## Force consumers to upgrade\r\n\r\nThis is a reasonable solution with minor changes between versions, but quickly becomes unreasonable with larger changes (again, 0.53.x regarding React).\r\n\r\n## Keep with the lowest common denominator\r\n\r\nFlow keeps getting better with each version. It would be a shame to miss out on all the improvements. This would greatly slow the adoption of a new version.\r\n\r\n## Submit types to flow-typed\r\n\r\nIn many cases, companies do not want to release or open source their code. There needs to be a way to share (versioned) types privately.\r\n\r\n## Build and maintain a private flow-typed repository\r\n\r\nThis would be a viable option. The flow-typed CLI already contains the logic to resolve libdefs with different versions of flow. However, the company would need to set up and maintain their own repository and tools. It's possible the resources aren't there to do this, or it's not worth it for one library.\r\n\r\nI'm happy to submit a PR, but I wanted to refine the idea first with the community before starting."},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/340886954","html_url":"https://github.com/facebook/flow/issues/4917#issuecomment-340886954","issue_url":"https://api.github.com/repos/facebook/flow/issues/4917","id":340886954,"user":{"login":"jedwards1211","id":1448194,"avatar_url":"https://avatars0.githubusercontent.com/u/1448194?v=4","gravatar_id":"","url":"https://api.github.com/users/jedwards1211","html_url":"https://github.com/jedwards1211","followers_url":"https://api.github.com/users/jedwards1211/followers","following_url":"https://api.github.com/users/jedwards1211/following{/other_user}","gists_url":"https://api.github.com/users/jedwards1211/gists{/gist_id}","starred_url":"https://api.github.com/users/jedwards1211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedwards1211/subscriptions","organizations_url":"https://api.github.com/users/jedwards1211/orgs","repos_url":"https://api.github.com/users/jedwards1211/repos","events_url":"https://api.github.com/users/jedwards1211/events{/privacy}","received_events_url":"https://api.github.com/users/jedwards1211/received_events","type":"User","site_admin":false},"created_at":"2017-10-31T19:52:12Z","updated_at":"2017-10-31T19:52:12Z","author_association":"CONTRIBUTOR","body":"@mruzekw first you'd need to make sure you've run `npm install` or `yarn` to make sure the packages are present.  Then you run `flow-typed install` or `flow-typed update`."}}
{"actor":{"display_login":"jedwards1211"}}