Fix react-native example based expo#3903
Conversation
|
A main reason for having these example projects, is to know when a change on the rxdb code breaks compatibility. |
|
Ok, changed back. Added comment in readme.md. |
|
Can you update this line https://github.com/pubkey/rxdb/blob/master/.github/workflows/main.yml#L450 |
de3ea2a to
3b419ef
Compare
|
expo-cli doesn't support node 18. expo/expo-cli#4478 |
|
I see. |
But current code don't work any case :-) Now updated only expo-cli. I leave old expo package and it have recommendations https://docs.expo.dev/versions/latest/#each-expo-sdk-version-depends-on-a. It was downgraded to prevent notification. I'll try to update all deps |
|
With jest-expo >= 44 tests passes, but finishes with seg fauilt (yarn and npm same). Now its works. |
|
Replication does not work because you switched from the pouchdb RxStorage to the memory RxStorage. |
|
Is there a reason why you switched to the memory adapter? |
The entire PouchDb ecosystem is very outdated. For example, pouchdb-adapter-asyncstorage uses the deprecated async-storage (it was moved to community package). I had patched that package and fix that - the persistance works, but it doesn't fix sync. I tried to find working packages, but only the sqlite package with a bunch of crutches worked. So, for this PR, we should deside what requirements are needed:
|
|
Yes both is needed. The reason for making the react native example was to show that RxDB can work with the react-native SQLite storage. I assume this PR is made in context of the premium tasks, is that correct? |
Previous version doesn't use sqlite, it uses asyncstorage. I have some success with custom version of I'll try to change the adapter to sqlite in this example project. |
# Conflicts: # examples/react-native/App.js # examples/react-native/initializeDb.js # examples/react-native/package.json
|
Recent changes:
There is no persistance functionality. Pouchdb need a crunches and Sqlite need a native modules to work. I don't want to deal with it for Expo. My suggestion is - rename this module to react-native-expo and leave as is in this PR. And create a new one with bare react-native. |
|
Strange error, I restarted the failed CI test. |
|
I removed the cache settings. In any case, there is no package-lock file. And if I understood you correctly - you want to always have fresh packages. The buggy jest and CI. I don't know how to fix it. Tests passed locally. Lost my patience. I'll be back later. |
|
So... Now we will test database. |
.github/workflows/main.yml
Outdated
|
|
||
| react-native: | ||
| runs-on: ubuntu-20.04 | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
Please pin all dependencies, always. This goes for the npm modules and also for docker image versions etc.
|
The code looks good to me. |
There was the similar code before^ I haven't seen this code works. I haven't seen any server side also. |
|
Ah, you are right, sorry havent seen that there never was a server. |
|
Counting for it :-) |
|
Merged, thank you for your work. |
This PR contains
Updated example for react-native based on Expo.
Main changes at 01.09.2022: