teambit / envs

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

The Flow env is missing a preset: "@babel/preset-react" #43

Closed diego-caceres closed 4 years ago

diego-caceres commented 4 years ago

Describe the bug

I tried to use the flow compiler but it failed to build my components, which use ES6, React and Flow.

Specifications

Additional context

I tried to build a new compiler based in the Flow one, I added to the .babelrc file the preset "@babel/preset-react", exported it, used it as my compiler and now it builds successfully.

JoshK2 commented 4 years ago

Hey @diego-caceres, thanks for opening an issue. I see you solve your problem by forking the compiler component for creating a new one and it is a good solution for now. In the coming future, I'll rewrite this compiler as I'll do for the Babel one. And after that, it will be easy to add or overrides the Babel-Flow compiler configuration with no need to fork the compiler.

JoshK2 commented 4 years ago

I published a temporary react-flow compiler https://bit.dev/bit/envs/compilers/react-flow In the future, I'll update the react compiler to work with rawConfig feature like in the new TypeScript and ReactNative compiler for example. Then, the react compiler will be able to receive any config to change the babel config file without the need to fork it.