Coder Social home page Coder Social logo

Comments (10)

brentvatne avatar brentvatne commented on May 2, 2024 1

unless someone steps up and commits to being the person who will maintain the typescript type definitions this will not happen anytime in the near future. if you would like to do this, please open a pr to add typescript definition to react-navigation and also some way for them to be tested automatically on CI for each PR (see how for flow we run the definition against NavigationPlayground). I can add you as a collaborator to help you keep them up to date

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024 1

congrats and good luck @jhalborg :)

from rfcs.

jednano avatar jednano commented on May 2, 2024 1

@brentvatne I just put up a PR to start this effort. See react-navigation/react-navigation#4075

I can pull the d.ts file from DefinitelyTyped until the source files are generating more accurate type definitions.

I paved the way, so who wants to help me convert stuff to TypeScript!? @fbartho, @jhalborg, you in?

from rfcs.

fbartho avatar fbartho commented on May 2, 2024

@brentvatne -- so just to be clear, the option you'd be suggesting would be side-written TypeScript types, that are manually kept in sync, rather than migrating the core codebase to self-generate the TypeScript interface?

If that is your suggestion, I'll have a think about my availability and answer next friday about such a commitment.

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024

right. we recently removed flow from the codebase for some reasons described here: react-navigation/react-navigation#3350 and I'm not super eager to add a comparable tool back right now. I'd prefer to just provide flow/typescript definitions and not actually use them to build the library for the moment -- in the future when the API/design of react-navigation stabilizes more and either flow stabilizes or typescript integration with react native is more smooth (eg: http://artsy.github.io/blog/2017/11/27/Babel-7-and-TypeScript/) we're open to reconsidering that! for now we lean more on unit tests

from rfcs.

fbartho avatar fbartho commented on May 2, 2024

Thanks for the context!

from rfcs.

jhalborg avatar jhalborg commented on May 2, 2024

+1 for this. And just providing a d.ts file along with the repo, published along with SDK updates is fine for me, as a user.

I can't commit to being responsible though, as I have a baby on the way (as in due date this very day), so my availability in the next month(s) is more limited than usual. I can help out when things settle, though, at least with minor changes.

I hope @fbartho or someone else might be able to take on the task

from rfcs.

jednano avatar jednano commented on May 2, 2024

I am wholeheartedly ready to contribute to this effort, whatever the cost.

I am concerned about manually typing the .d.ts files, because it doesn't have as much integrity as generated type definitions. I've already gone through this with the PostCSS library, where I converted the entire library to TypeScript just to generate perfect type defs that are now a bit stale because (back then) the author thought introducing TypeScript would deter community contributions somehow?

I think a good strategy for this would be to:

  1. Introduce TypeScript into the build system first.
  2. Configure it in such a way that TypeScript and JavaScript can co-exist.
  3. Incrementally convert existing JavaScript files into TypeScript, starting with the ones that have no dependencies and working our way up to the root.

I'll submit a PR with the build configuration and we'll see who likes it or not.

from rfcs.

jhalborg avatar jhalborg commented on May 2, 2024

As much as I'd like to help out, it won't be possible within the foreseeable future on my part, unfortunately. I really do hope that some process can be built :)

from rfcs.

brentvatne avatar brentvatne commented on May 2, 2024

tracking here: https://github.com/react-navigation/react-navigation-core/issues/2

if anyone wants to help out you can collaborate there

from rfcs.

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.