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
Feat/ts #818
Feat/ts #818
Conversation
Do we want TS to emit types and declarations or just type-check? |
Ohhh 🤤 |
@MateusAndrade on a good spot for a review, specially around the ts-ignore stuffs |
Co-authored-by: luancurti <luancurti@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @Thomazella. I have some considerations about splitting the types
from the main file into different files, something like types.d.ts
or index.d.ts
. By doing this we would need to export the types letting this easier to use outside the library.
Also, we don't need to declare a namespace or something similar to that? 🤔
I'm hoping we can emit that file using the source code as base. |
Yep - device-info emits the file for what it's worth, using |
Co-authored-by: Mateus Andrade <mateus.andrade47@outlook.com>
This reverts commit 6fe8222.
So the last thing is to build the js with tsc, and double check types. I think we'll get the .d.ts files "for free" like that, which should make it easier to maintain. I think it may make sense to type the bridge stuff too, but we'd probably need to do that in a file and maintain it. Maybe another PR for that. Overall we're close. |
All of that should be for free with bob I think here is the stanza from device info https://github.com/react-native-community/react-native-device-info/blob/master/package.json "@react-native-community/bob": {
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module",
"typescript"
]
} |
@mikehardy ok, didn't know bob, I get it now. Thanks! |
@Thomazella what's the status of this PR? Do you need some help? |
@luancurti nope, should be able to finish, will aim for this week. I was just busy with my new job that's all. |
Let me know if you need any help. 👯 |
@MateusAndrade , @tcodes0 |
feel free to complete it :) |
Let me know if there is anything we can do to help. 🚀 |
Overview
see #805
Introduces typescript to project
Test Plan
run
yarn validate:ts
todo