ap0nia / eden-query

🙏 type-safe Elysia.js client with powerful asynchronous state management.
https://ap0nia.github.io/eden-query/
MIT License
23 stars 2 forks source link

Setup eden-react-query with React Native and Expo #59

Open AntoineAtMistral opened 3 days ago

AntoineAtMistral commented 3 days ago

I followed the eden-react-query setup documentation for my Expo project, where I also set up Elysia according to the official documentation here: https://elysiajs.com/integrations/expo.

In order to make the import import { edenPlugin } from "@ap0nia/eden-react-query/server"; work, I had to add the following to my tsconfig.json:

"moduleResolution": "bundler"

However, I'm still facing an issue Type instantiation is excessively deep and possibly infinite.ts(2589) on the line .use(edenPlugin({ batch: true })).

Not sure about the correct way to set things up with react native + expo, any help is much appreciated!

ap0nia commented 3 days ago

Could you clarify which version is installed or share a reproduction repository? I pushed a more recent version that removed the extra type-checks on the elysia plugins. The plugins are also exported from the server file in the latest version.

import { edenPlugin } from '@ap0nia/eden-react-query/server'
ap0nia commented 2 days ago

At the moment, I can't figure out anything that works to get metro to actually obey the enable packagejson exports setting...

Here's an example I setup that does not use batch or transform. Hopefully it will be ok for now... https://github.com/ap0nia/eden-query/tree/52350f7cc41494919d1e4c6496481ddc206befdb/examples/react-native

AntoineAtMistral commented 2 days ago

Thank you! I'll take a look. I tried creating a minimal repro but I was met with issues that should be fixed by: https://github.com/ap0nia/eden-query/pull/60 (ended up having two different react versions installed which broke everything...)