-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardise type definitions #14
Comments
There was some discussion on this just recently on Discord in the meta channel. The most supported position there was (quoting @ericlewis) -
There were three thumb-up and no dissent, just as information. I think encouraging Typescript use and at least including the types (with type checks during CI etc) is a reasonable stance, personally |
Adding the initial PR and proposal that triggered all this. Both for not to forget after we reach a decision and to check the opinions expressed there. PR: react-native-maps/react-native-maps#2877 |
The quote from @ericlewis is exactly correct. Added types to DefinitelyTyped should only be done as a last resort if a package maintainer refuses to add them to the package itself. It's a much better developer experience for them to be included either by writing the library in TS or with a bundled definition file. |
Just to clarify on option one: it’s “automatically” typed in the sense that because you need to use types if you are using typescript (hence strict mode) then you’ll be able to output quality and accurate types at compile time. Furthermore, your library will also benefit from type safety. If your library is just |
Right now we have several repos that include both flow and ts definitions, or just single one or none.
It would be awesome to come up with guidelines for adding these definitions into the repositories (i.e what folders should they go in, what file names should be used etc...)
Some definitions will probably need to be created from scratch, some can be ported from
@types/react-native
package (since there are now packages that are untyped due to extraction from main rn repo).The text was updated successfully, but these errors were encountered: