teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
64 stars 9 forks source link

React Native Typescript Compiler? #57

Closed Oba-One closed 3 years ago

Oba-One commented 4 years ago

Hi! I'm looking to mesh both the react-typescript and react-native compilers. Does anyone have a working example or can point me in the direction to build one.

GiladShoham commented 4 years ago

moving this issue to the dedicated envs repo. @qballer @JoshK2 please take a look.

qballer commented 4 years ago

hi @Oba-One, what do you mean by meshing these compilers together!? Are you trying to implement react-native component with typescript? Do you have a project where you have both react-native and react-dom components. More details will be appreciated.

carloslibardo commented 4 years ago

@qballer i'm creating a react-native component with typescript. What i should do in this case?

qballer commented 4 years ago

@JoshK2 has been working on this problem and should be able to provide more information about it. If I have the right picture, he should release an environment soon which handles react-native-typescript We will update here.

JoshK2 commented 4 years ago

@kaduelinho I'm working on the react-native compiler that will support also typescript. I'll release it very soon.

Oba-One commented 4 years ago

Hi, Just saw this @qballer I have a react native project in typescript and want to compile it to view in bit. I haven't tried since then but will attempt to make my own/see what @JoshK2 creates.

JoshK2 commented 4 years ago

Hey @Oba-One
A few days ago I release the RN compiler but it currently not support RN with TS. I develop now the support for TS.

Oba-One commented 4 years ago

Thanks! @JoshK2

On Tue, Jan 28, 2020 at 9:21 AM Josh Kuttler notifications@github.com wrote:

Hey @Oba-One https://github.com/Oba-One A few days ago I release the RN compiler https://bit.dev/bit/envs/compilers/react-native but it currently not support RN with TS. I work now for supporting TS.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/teambit/envs/issues/57?email_source=notifications&email_token=AIPQ5FNXXU37EREBUF7M2MDRABSS3A5CNFSM4J4THZJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKEFTAQ#issuecomment-579361154, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPQ5FL56HPD545YX5X6YLDRABSS3ANCNFSM4J4THZJQ .

developerantoniosousa commented 4 years ago

@JoshK2 I look forward to the react native compiler with typescript. Is there a release date?

JoshK2 commented 4 years ago

@developerantoniosousa @Oba-One The react native is an experimental compiler. We are currently holding its maintenance die to other priorities. You are welcome to send a PR.

olgaababic commented 4 years ago

Hey @JoshK2 is there any news regarding react-native compiler with typescript support?

rafaelsaback commented 4 years ago

Looking forward to having the TypeScript support added to the RN compiler. Btw, great job you're doing with bit! :rocket:

JoshK2 commented 4 years ago

Hi, I think a possible workaround would be to add this babel preset: https://babeljs.io/docs/en/babel-preset-typescript to the .babelrc file of the compiler: https://github.com/teambit/envs/blob/master/packages/react-native/.babelrc

It will not check the types like TypeScript, but it will compile all the .ts files.

Oba-One commented 4 years ago

@JoshK2 I'm trying it out now, I'll let you know how it goes

brandonvilla21 commented 4 years ago

Hi, I think a possible workaround would be to add this babel preset: https://babeljs.io/docs/en/babel-preset-typescript to the .babelrc file of the compiler: https://github.com/teambit/envs/blob/master/packages/react-native/.babelrc

It will not check the types like TypeScript, but it will compile all the .ts files.

@JoshK2 What should be the best approach for that? Do I edit the react native compiler? something like:

  "bit": {
    "env": {
      "compiler": "bit.envs/compilers/react-native@1.0.21",
      "rawConfig": {
        ".babelrc": {
          "presets": [
            "module:metro-react-native-babel-preset",
            "@babel/preset-typescript"
          ]
        }
      }
    },
    ...
  }

Or can I create a new compiler based on react-native?

JoshK2 commented 4 years ago

Hi @brandonvilla21 My possible workaround was to create a new compiler with the right config, but I tried it and I was not able to make it work with the current Bit version. I want to update you and everyone in this thread, that we gonna release the biggest major version of Bit in the comings weeks, and it will help us to solve this kind of issue with TS.

JoshK2 commented 3 years ago

@Oba-One @carloslibardo @developerantoniosousa @olgaababic @rafaelsaback @brandonvilla21

Hi all, I published a new compiler for React native with TypeScript support! 🥳