reSolve and React Native integration - react-native

Is there any working example available involving reSolve in React Native?
Suggestions of comparable solutions (running without any back-end connectivity in place) either in React Native or Flutter are also most appreciated.
GitHub contains an example in the reimagined/react-native-example repository but unfortunately it isn't working. It seems the current version is pretty outdated.
Referring to that repository, the command yarn create resolve-app -e shopping-list-advanced shopping-list-advanced results in the following error message.
Error: No such example, shopping-list-advanced. The following examples are available
So you are unable to download the sample code since it does not appear to exist.
So I tried downloading and inflating the ZIP manually. Afterwards I ran yarn install (which takes a while and reports quite a lot of warnings). Next, I used the command yarn start:native. This doesn't work either and results in the following error message.
ERROR: Node.js version 16.13.2 is no longer supported.expo-cli supports following Node.js versions: >=10.13.0 <11.0.0 (Active LTS) >=12.0.0 <13.0.0 (Active LTS) >=13.0.0 <14.0.0 (Current Release)
In an attempt to solve the problem, I updated the expo-cli version in the native\package.json file to 5.0.3. Running yarn install and yarn start:native again results in a new error message being thrown error.
Invalid regular expression:
/(ui[\]node_modules[\]react-native[\].|ui[\]node_modules[\]expo[\].|node_modules[\]react[\]dist[\].|website\node_modules\.|heapCapture\bundle.js|.\tests\.)$/:
Range out of order in character class.
This doesn't seem to go anywhere... In other words, I am a bit stuck here since I don't know what this message actually means.
Thank you for your feedback.

The team decided to extract the React Native example to a separate repository and postpone its maintenance to keep focused on more important tasks like polishing the server-side.
As you mentioned, the example is outdated, there are many changes in the client configuration since then. In the future, we may work on some guide on how to use reSolve in React Native and other frameworks.
In the meantime, you can try to add reSolve in your ReactNative app using our docs.
We provide several client libraries that can be helpful:
https://reimagined.github.io/resolve/docs/api/client/resolve-client/
https://reimagined.github.io/resolve/docs/api/client/resolve-react-hooks/
https://reimagined.github.io/resolve/docs/api/client/resolve-redux/
Feel free to contact us through Github in case of any difficulties, we'll be glad to help you.

Related

Given an npm package, how do I know whether it will work in browser?

I've recently installed some npm package (recommended Kubernetes client) for my react app.
After writing code that uses the package and deploying the code for testing I got some weird errors about missing functions or packages. Then I've read the documentation and realized that the package was Node-only.
Is there any way to check that the npm package works in browser before writing code that uses the package?
Python packages specify compatible python versions. Do npm packages have something like this whether they indicate support for particular Node versions and the browsers?
Some packages/libraries contain .browserlistrc file which I've found to be a starting point to find out the browsers and platforms the devs intend to support or have their code compile for. While it may not always be true and the package might just be able to support a browser that isn't mentioned, it's a good starting point. It surely helps to find out if IE (the bane of front-end dev) is supported or not.
Then again many packages don't necessarily include a .browserlistrc. You can then check the package.json for a "browserslist" field.
If neither are found, you can always clone the repo and add your own .browserlistrc in the root with queries that will let you know if the package supports your intended browser or platform - little more work but yeah it can help. Not full proof but a decent enough way to find out.
Though the best answer is really to just ask the maintainers.

Outdated React Native Project

I posted this question yesterday, but apparently worded it badly, so I'm trying again.
I'm working on a project that had been closed for a couple of years and reopened. During that time, a large number of the included node_modules have gone out of support (or at least the versions being used), React Native has been updated several times, new rules came out for building iOS projects, etc. leaving the project in a pretty broken state.
The previous team that worked on the project didn't leave much in the way of documentation, and we're stuck figuring out the details on our own.
There are two of us on the UI development, and we're able to build the project as-is using all of the old components. However, as soon as we start upgrading anything, we run into conflicts.
I've spent a good bit of time (several different times combined) trying to find a way to get the upgrade started, but everything I've tried runs into conflicts.
For purposes of clarity, he problems that I encounter include:
npm reports ERESOLVE Unable to resolve dependency tree
many errors (hundreds) come out of the XCode build - version compatibility, not allowed to use deprecated components, legacy build system outdated, conflicting pointer assignments, etc
All tools need to be upgraded (Node, npm, Android Studio, Xcode, React, React Native, Gradle, etc
Is there somewhere I can find an article or tutorial or something with a step-by-step, repeatable process for creating a project from scratch and adding the required components in an orderly way so that I can upgrade the whole process at once?
Also, I know that a lot of open source projects support their products with paid services, but that doesn't appear to be the case with React Native as far as I can tell. Is there somewhere we can find a project / build expert to come in and work with us on this?
Any help would really be appreciated!
Thanks in advance!

How to troubleshoot React Native build error?

Below you can see the output I get when I try to run npx react-native run-android. It suggests some options to try in order to further pinpoint the problem, however they don't work with the aforementioned command so I assume that they are related to a gradle (just an educated guess).
I know ZERO about gradle; I have just seen the name here and there and in the output shown below. So please keep that in mind when you answer. If I need to learn how to run some gradle command(s) directly, please be as verbose as possible in your answer.
The project was working fine just a bit ago, but I wanted the ability to force portrait mode for certain screens but without configuring my entire app to always have to stick to portrait mode. So I found what looked to be a solution in the react-native-orientation-locker module. I installed it with yarn and then proceeded to update files as directed: https://www.npmjs.com/package/react-native-orientation-locker.
After updating the appropriate files, I got an error that suggested axios was the problem. I uninstalled and reinstalled axios. After that didn't work, I proceeded to undo all the file changes I had just made. Then I uninstalled the react-native-orientation-locker module.
To my knowledge, I have undone everything I did between the time the project worked and stopped working.
Sadly, I had not put this into source control yet (a mistake I won't make again), so I can't revert.
Where to go from here?
Problems like this are hard to pin point. What you can do is open the android project in android studio and see the logs as the project is being assembled. I assume you do not have much knowledge about android either so you might need some senior resource to help you.
What I usually do in this case is open android studio and if I am lucky enough, it tells me which file has an issue and I go to the file and do what android studio suggests me. Some times it fixes the problem and sometimes it doesn't.
Another thing I would like to mention is that the documentation of the package you are using is important to follow. I assume you did that already but I would suggest to review it narrowly and closely.
Another guess I can tell you is try to go to your-project/android/build.gradle and over there, you'll see something like this in the start. The package you are using mentions something about target SDK 27. I think you should check that out too. May be it helps
Lastly I would say always use source control while working with react native. It can easily blow up at any time so you should always have a safety net to fallback to :)

Androidx and gradle feature errors after running update

I returned to a react native project after about a month or two and updated the packages along with all the packaged. However, it seems that in the time since I worked on it there have been some major changes which is now preventing react-native run-android from completing and results in a list of errors which seem related to the camera module, gradle and androidx.
Apologies, I could not paste the error in the post as it exceeds the character limit.
https://hatebin.com/bvsjcldeby
After initializing a new project all seems well so it appears to be something wrong with the configuration of the project itself.
Any help is really appreciated. Thanks in advance.
Google moves from the Support Library to the AndroiX library. So the first one is deprecated.
RN 0.60.X migrates to AndroidX ans so should each of the dependencies that you use. 0.60.X is a major breaking change and the way to solve it could be very wide. You would need to check each of your modules or dependencies that you use and find if they upgrades to use AndroidX. There is also a workaround where you could use Jetifier, which is a tool that will migrate old dependencies to the new AndroidX imports however I found it a little buggy dependening on your project.
My 2 cents right now would be to go to 0.59.8 until all major dependencies have time to upgrade and release their updated versions. Otherwise I think it is too much work right now.
You can see more here: https://facebook.github.io/react-native/blog/2019/07/03/version-60

Is there a way to establish a connection between a Firebird database and a React-Native application?

Our project relies on displaying data from a Firebird database on a React-Native application.
If I import the Firebird library we get the error:
"Module 'net' does not exist in the Haste module map"
Following the given instructions doesn't change anything.
Typing so much as this is enough to cause the error:
var Firebird = require('node-firebird');
We tried working with this npm package.
My colleague spoke to an online React-Native teacher and it seems both frameworks are indeed incompatible. If possible, I'd hope to get more clear input on the matter, and if there exists any alternatives, I'd be glad to hear them.