-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bridge the syntax gap between _Flow_ and _TypeScript_ #8989
Comments
We already have |
I updated the issue :)
Thanks for the info :) The main goal of this issue is improving compatibility between Flow and TypeScript. |
The first step to potentially changing out syntax is parsing it, and then updating all tooling (Prettier, ESLint, etc.) to handle these new AST nodes. That process takes a while (but by parsing and erroring, we're starting it). Once that is done, all that would be required is for Flow to make the change, and we will have discussions on a case by case basis - it's something we're thinking about for sure |
Thanks for your input :) |
We have |
Firstly thank you for flow! It’s been an amazing tool for us at mixcloud, especially when combine with relay. However unfortunately we’re fighting an uphill battle compared to the typescript 3rd party library support. I wonder if there is any appetite for allowing flow to ingest typescript types for 3rd party libraries or using flow-gen to automate bridging the gap somehow? Allowing us to benefit from flows speed/correctness and the typescript ecosystem? |
Proposal
The goal of this proposal is to improve interoperability between Flow and TypeScript.
export declare
as an alias ofdeclare export
as const
type assertionsconst isNumber = (x: unknown): x is number => typeof x === "number"
unknown
type as an alias ofmixed
undefined
type as an alias ofvoid
readonly
as an alias of+
in object type and interface. e.g.type Person = { readonly name: string }
.in
,out
as aliases of-
and+
for type parameter varianceextends
as an alias of:
for type parameter bounds. e.g.function f<A extends string>(a:A){}
.never
type as an alias ofempty
(x: unknown) => x is X
as
type assertion as an alias of(:)
keyof T
as an alias of$Keys<T>
readonly string[]
readonly [string, number]
Readonly
,ReadonlyArray
,ReadonlySet
,ReadonlyMap
,Record<K, V>
as aliases of$ReadOnly
,$ReadOnlyArray
,$ReadOnlySet
,$ReadOnlyMap
,{ [key: K]: V }
Partial
,Required
utility typesUse case
I would like to use Flow. However, it is hard to give up all TypeScript tooling.
More interoperability could help to use Flow.
The text was updated successfully, but these errors were encountered: