Integrating non-compiled es modules #3365
MiguelNiblock
started this conversation in
Proposals
Replies: 1 comment
-
I'm getting ready to startup a react native project next week, so I'll be able to try out these options to see what works. Thanks for getting a sample project setup. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There's been a few suggestions that a feasible approach to integrate libraries that require compilation/ transpilation would be to pre-compile locally to es5. I created a pet repo in the hopes we can develop a sample of how this approach would work. My aim is to demonstrate whether it's possible to use remix with ui component libraries that use react-native-web, specifically native-base, since they have the best documentation and official integration with nextjs.
here's the starter repo. https://github.com/MiguelNiblock/remix-samples-rn . I followed the installation instructions except for the compiler setup, which made the compilation fail with:
and native base says there's a few different ways to integrate it into a web project. there's directions for 1)CRA, 2)nextjs via expo adapter, and 3)nextjs via their own adapter. Here's all the info:
Interestingly, the CRA directions don't require any additional setup, it seems to work the same as a simple installation in react-native for mobile.
Some of the requirements for transpiling for nextjs:
"react-native-svg",
"native-base",
"react-native-svg",
@Kilian do you think this is feasible? I think these requirements are based on the current paradigm of on-the-fly compilation, so compiling statically becomes non-trivial when all the proven-to-work resources and official docs & examples assume you will compile onthefly like everybody does. I don't even find any guides online for how to approach transpiling a module statically & locally to use as a dependency. Perhaps that's why they don't ship it pre-compiled?
Beta Was this translation helpful? Give feedback.
All reactions