Comments (5)
Do you mind if I reopen this issue? I think this is a valuable discussion to have.
This year we have started converging with TS where it makes sense. e.g. we now have conditional types, mapped types and type guards. We are also in the process of changing some syntax to align with TS, such as the casting syntax (prettier/prettier#15130) and some smaller items (prettier/prettier#15429, prettier/prettier#15466). You can follow some progress in #8989.
The next logical step is .d.ts
support. This is an umbrella project that contains a lot of smaller items (e.g. declaration merging, namespace, TS syntax, etc). That being said, I cannot promise anything concrete or a timeline here. In the internal prioritization process, OSS is unlikely to make it to the top. However, I am more optimistic this time. We finally finished big architecture changes (types first) and big rewrites (LTI) so that our performance and type checker are no longer on fire, so we can focus more time on DevX issues like this. Lack of interoperability with the TS ecosystem is also an internal developer pain.
I appreciate your passion for Flow even though a lot of things are stacked against us now. I do have a personal passion for this, since I was on your side before. In 2018-2019, I used Flow but eventually gave up due to lack of well-maintained flow-typed definitions. I believe there is something we can do here.
from flow.
We planned next year that we are going to tackle this. More specifically, I will look into the following aspects, in order of priorities:
- namespaces (only for type definitions)
- declaration merging
- some cosmetic syntax changes to directly understand TS definitions
By the end of next year, our goal is not to understand every single .d.ts file without issue, but hopefully as we progress, you will need fewer and fewer manual edits to an upstream d.ts file to make it usable in Flow
from flow.
Once we make the next release, it will contain d8bba3c, which will make it less hostile to use TS type names.
Note that this is best effort support (e.g. eslint and prettier support might not be ready when we allow more stuff under the flag), but if you actually managed to use other tools only designed for TS but use flow for type checking, we'd like to hear from your experience.
from flow.
Sorry to not really bring much to the table with this, but wanted to say this would be an absolute game changer for us as well. Flow is a fantastic tool, we particularly appreciate the integration with relay, but the lack of support for typescript defs really causes us headaches on a weekly basis. I truely believe this is the only major headache we have with it and adding def support would save an enormous amount of time.
from flow.
Thanks for the great answer. I was regretfully a bit passive aggressive in places cause I was in the middle of converting some d.ts π Actually tbh I just renamed the files and merged them together and there wasn't much work besides that which was cool to see - definitely getting closer.
That's encouraging to hear and the closing feature parity is noticeable, understandable if you're not at the stage to make stable automatic conversion yet/don't have the time. Side note: cool I find the as
syntax more visually pleasing anyway ;)
from flow.
Related Issues (20)
- Does not narrow down type after undefined/falsy check HOT 1
- Recursive/deep Partial HOT 2
- Bugs in negated `instanceof` expressions HOT 1
- [Question]: How to fix flowgen test after flow update HOT 3
- Higher order type parameter support HOT 1
- Readme links to 404
- Strange index signature error if you use $Keys<O> instead of the equivalent literal union inside $ReadOnlyArray HOT 1
- [homebrew] automation script needs update HOT 2
- "Unxepcted identifier, expected the token ;" when using await inside of ES module HOT 3
- Can't iterate through chars in a string HOT 4
- Flow does not catch invalid switch statements HOT 1
- Conditional type only works if I inline it HOT 5
- Object with null prototype does not extend interface {} HOT 3
- Missing documentation for "render-types"? HOT 2
- Relay + graphql literals HOT 11
- [homebrew] regression test failure with 0.226.0,0.227.0 HOT 2
- FLOW BUG: This is a misplaced error HOT 3
- The `experimental.ts_syntax` doesnβt seem to do anything HOT 2
- Parameters<> does not support optional params HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flow.