Git Product home page Git Product logo

Comments (6)

alloy avatar alloy commented on May 18, 2024

We should consider providing a codemod that users can apply to their codebase to upgrade some/all of these.

from flow2dts.

alloy avatar alloy commented on May 18, 2024
  • TypeScript does not have a build in way to deal with different files for different platforms.

    • How can we offer distinctive sets of typings for iOS and Android (eg @types/react-native-ios, @types/react-native-android) and let the user configure them for their project?

Perhaps we can find a way to alias @types/react-native-ios to @types/react-native in tsconfig.json, that way people can have different configs per platform and importing from the react-native namespace should still work.

TS doesn't need to resolve specific extensions, as currently we’re generating distinctive sets per platform and dropping the platform file extension.

  • And can other DT packages that depend on RN use this too?

Additionally we could update the actual @types/react-native package to import and re-export the top-level exports of both @types/react-native-ios and @types/react-native-android so they can possibly depend on them in a platform independent manner? Unsure how feasible this is.

from flow2dts.

alloy avatar alloy commented on May 18, 2024

Could it help if we were able to release DT packages with version suffix? E.g. 0.64.0-ios and 0.64.0-android.

from flow2dts.

alloy avatar alloy commented on May 18, 2024

Also need to decide what to do with fallout in all DT packages that depend on the RN typings, assuming there will be.

from flow2dts.

alloy avatar alloy commented on May 18, 2024

One solution to providing the packages using alternate names would be to use declare module "react-native/..." {} for each module, e.g. see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/49914/files#diff-8b9d499e69407ece17612b602d5355d8a1c8b2e5fdb6628e288638aab682ef29R7

from flow2dts.

ZihanChen-MSFT avatar ZihanChen-MSFT commented on May 18, 2024

Looks like TypeScript people are working on supporting this scenario

from flow2dts.

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.