Giter VIP home page Giter VIP logo

Comments (5)

SamChou19815 avatar SamChou19815 commented on June 9, 2024 15

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.

SamChou19815 avatar SamChou19815 commented on June 9, 2024 6

We planned next year that we are going to tackle this. More specifically, I will look into the following aspects, in order of priorities:

  1. namespaces (only for type definitions)
  2. declaration merging
  3. 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.

SamChou19815 avatar SamChou19815 commented on June 9, 2024 4

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.

matclayton avatar matclayton commented on June 9, 2024 2

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.

sekoyo avatar sekoyo commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.