Open danilvalov opened 2 months ago
Maybe a better solution would be to compile TS to JS when new version releasing?
Interesting request. I'll be honest, nobody has asked yet, so I'm hesitant to make any changes until we receive more feedback.
Also when I run a type checking process using
tsc --noEmit
command in my project I see many errors fromnode_modules/@jitsi/react-native/sdk
:
I think our SDK should ship with the tsconfig file we use (tsconfig.native.json at the root folder) and that would be solved.
Interesting request. I'll be honest, nobody has asked yet, so I'm hesitant to make any changes until we receive more feedback.
Maybe you're right. But this is the first time I've seen a library that doesn't compile Typescript into Javascript before release. In particular, this is due to the fact that the Typescript versions may not match within the project and within the library, which will lead to problems. More often I see compiled files into Javascript and separately files of Typescript types (*.d.ts
, declaration option in tsconfig.json
).
Also, as I know, it is impossible in Typescript when compiling to set separate compilation rules for a separate directory (this is not ifint or gitignor), as a result, all developers will have to forcefully change the compilation rules on their projects to the compilation rules of this library, which is strange and often impossible.
I don't think we have special rules in our sample app though, it's a standard TS RN app.
Description:
Jitsi React Native SDK contains a Typescript-only version of the package (there are Typescript files instead of Javascript files): npmjs/@jitsi/react-native-sdk#codeTab
Maybe a better solution would be to compile TS to JS when new version releasing? I know people who doesn't use Typescript, they use Javascript inside their React Native projects
Also when I run a type checking process using
tsc --noEmit
command in my project I see many errors fromnode_modules/@jitsi/react-native/sdk
:It happens because Typescript (inside my project) imports the Jitsi RN SDK package as part of its own code rather than detecting it as an external package (because when we use
import ... from '@jitsi/react-native-sdk'
we import aindex.tsx
file instead of aindex.js
file which does not exist).