-
Notifications
You must be signed in to change notification settings - Fork 305
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
Create Fable transformer for React Native #804
Comments
I can try and add something over the next week or so. |
Wow that would be great! |
Any news on this one? |
I think for the moment we can try to update the Fable RN sample to 1.0 using Webpack. It's just a middle step but shouldn't be much of an issue. I can try to do it next week. If @jgrund is busy, I can also try to have a look at the custom RN packager. |
Sorry for the delay, I've been busy at work open-sourcing our codebase. Starting to look at this; this may be a blocker for transpiling directly: facebook/react-native#13689. |
I'll push an initial PR skeleton and go from there. |
Something else to investigate: https://github.com/callstack-io/haul. Looks like it works better with multiple transforms and has full access to webpack ecosystem. |
@jgrund No worries, thanks a lot for your help! I checked facebook/react-native#13689. If I'm not mistaken it's about referencing non-js files without having to specify the extension. Fables does specify the extension so hopefully it shouldn't be a problem. And thanks also for the link to the haul tool. It's weird I didn't find it when searching how to use Webpack with RN. It looks very interesting, I gave it a quick try and managed to create a RN app including an F# script using haul + Webpack + fable-loader (the only problem I had is apparently the app wouldn't start in the iOS simulator if remote JS debugging was not activated). What do you think, maybe this should be the way to go? |
If people are ok with haul, it seems simpler from a long term maintenance perspective as we can reuse |
Here is WIP PR that uses haul + Fable 1.0. SAFE-Stack/SAFE-Nightwatch#18. |
Awesome, @jgrund, thank you! Yes, there're no RN bindings for Fable 1.0 yet, sorry! 😅 I'll try to update them later in the evening. |
@jgrund I've updated the RN bindings to Fable 1.0. I haven't tested them but they should work 🙏 You can install them by running Please tell me if there's any trouble. |
There's a already a PR for this in SAFE-Stack/SAFE-Nightwatch#18, so we can track progress there 👍 |
Related (partly) to #800
We haven't tried yet Fable 1.0 with RN. It should be possible to just add Webpack bundling as a previous step before RN own packaging. However, it seems it's not difficult to create a custom Fable packager which should make RN hot reloading much faster. @jgrund has already made something similar for Jest, maybe he could help here as well?
Links
Things to consider:
.babelrc
. We can use thegetBabelRC
function in RN transformer for that. Remember we must also add Fable custom Babel plugins when compiling F# files.If you want to help, please send a minimal WIP PR (please put the transformer in the
src/typescript
folder) so we can continue the discussion there. Thanks a lot for your help in advance!cc @et1975 @forki
The text was updated successfully, but these errors were encountered: