-
Notifications
You must be signed in to change notification settings - Fork 38
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
React Native support #1013
Comments
This would be much appreciated. If the example used expo that would be a win, https://docs.expo.dev/versions/latest/sdk/sqlite/. |
This is currently being addressed well by https://github.com/Braden1996/react-native-replicache, but we should consider making it first-class. |
@aboodman I've been recently trying to go that way but unfortunately
Also, Can you share any plans for an official and reliable solution? Edit: I just tested with |
Ah, I did not know that react-native-replicache had stopped working. Thanks for the information. |
@aboodman It's not just I'd really like to use Replicache in my mobile apps (I think that's where local-first apps really shine), but these problems related to browser-only APIs make me think that react native support is not even being considered, which is fair but it'd be great to know that before committing to anything. Would you mind sharing your team's plans about this, if any? |
Thanks @darioielardi. So we fixed the This wasn't for React Native, but older Safaris. Unfortunately, we introduced the The real issue here is that we don't have a RN sample, and thus aren't testing RN as part of our release process. I agree you should not rely on RN for anything real if we're not doing that. I do not have a concrete timeline for this right now other than 2024. I'll have a better idea in January. |
@aboodman that makes sense, I'll look forward to any updates on official React Native support and take some other route in the meantime, thank you! |
wanted to post some updates here as we just completed a successful upgrade to replicache 14 on react-native. here are the workarounds to everything we ran into:
also, hope all of this this helps somebody! |
@robsoden thank you very much! Inspired by your comment I went ahead and tried to make it work again, this time with I successfully setup babel and patched all the packages, but I'm still getting errors with
Do you mind sharing your setup? Or at least what version of these libraries you are using? |
@darioielardi glad it was helpful! so I'm using the following: and then I've used patch-package to apply those 2 changes to the ReplicacheQuickSQLiteTransaction class (since my PR you found hasn't been merged yet) the generated patch ends up looking like this:
let me know if there's any other info that might help |
oh and also FWIW here's my replicache instantiation, nothing really unique here:
|
If anyone here is interested in contracting for Rocicorp to get this cleaned up, I would pay for it. I want to (a) fix Replicache to install cleanly in rn and expo, (b) if there are any automated unit style tests we can add to avoid regressions do that, (c) have a working sample of todo thst works in in rn and expo with instructions on how to set up and run that any react (web) dev can successfully follow to test and debug changes. If you’re interested dm me on discord.replicache.dev. |
@robsoden I realized the reason it wasn't working is that I was using Everything works now! I think I'll try to make it work with |
@aboodman apparently on your side the only necessary change is to add the About the |
Anyone else working with Repliache and react-native may have also noticed that react-native-quick-sqlite has recently been deprecated, with the maintainer suggesting a migration to op-sqlite (https://github.com/ospfranco/react-native-quick-sqlite) quick-sqlite was the main underlying store implemented by the (very excellent) react-native-replicache package (https://github.com/Braden1996/react-native-replicache) Luckily, thanks to the very solid work on that package, it was pretty trivial to swap in op-sqlite. I've submitted a PR there in the hopes that they'll publish a new adapter. Feel free to reach out if anyone needs this and has trouble implementing. If there's no movement on the PR over there, we may just publish it ourselves depending on outside interest. Thanks! |
Ran into the same issues and your fixes worked like a charm. Thank you! I've pinged the owner of https://github.com/Braden1996/react-native-replicache and he said he'll have a look at the open PRs tomorrow. |
Hello all! Over the weekend I upgraded the React Native Replicache libraries in a few ways. Sorry for not being better with this.
It is worth noting:
@aboodman as for an example app you can add to your test flow, the example provided in that repo should work pretty well and I've added some instructions to the Readme. More than happy to hop on a call and go through it! Also, regarding |
I would love to do this. It has been a pet peeve of mine for the last year at least. We do have a lot of bindings (through IDB and fetch) so we need to maintain a copy of those entire type hierarchies. Is your "universal types" package available? |
We don't plan on publishing it, unfortunately. |
I'd very much like to use Replicache in an Expo (v51) project. Wondering if this is advisable or if I should hold off for now? |
Currently it is possible to use Replicache with React Native by implementing
experimentalKVStore
and hooking it to SQLite. However it's quite manual. We should have first-class support for RN, including:The text was updated successfully, but these errors were encountered: