Comments (6)
We should consider providing a codemod that users can apply to their codebase to upgrade some/all of these.
from flow2dts.
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.
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.
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.
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.
Looks like TypeScript people are working on supporting this scenario
from flow2dts.
Related Issues (20)
- ACTION REQUIRED: Microsoft needs this private repository to complete compliance info
- [TS2503] Should we override `Animated` to be a TS `namespace`? HOT 4
- [need verification] Do `import typeof` right HOT 1
- Clean export HOT 1
- Port typings from DT to upstream RN Flow codebase.
- Keep `typeof` when getting types of a class' properties HOT 7
- [TS2322] Component class with wider defaultProps typing
- Difference between RN's and DT's SyntheticEvent type
- Don't store classes in intermediate variables HOT 1
- Make a decision on converting opaque type alias in Flow
- Diff between generated type descriptions and @types/react-native HOT 1
- Classes are not correctly exported in index.d.ts HOT 3
- Make a decision on converting "*" type alias in Flow
- Convert type alias to interface? HOT 1
- Import as if es6 module export from default exported object
- babel/parser can't parse restricted types HOT 1
- Upstream local patches
- Throw nicer errors from transforms
- Generate a hint file for identifiers for workbench input HOT 3
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 flow2dts.