digidem / mapeo-mobile

Monitor and document the world around you
GNU General Public License v3.0
95 stars 16 forks source link

Upgrade React Native Dependency #1102

Open ErikSin opened 1 year ago

ErikSin commented 1 year ago

Upgrade React Native

Upgrade React Native to the latest stable version (v0.71.0). Currently Mapeo Mobile uses v0.66.5.

Changelog:

https://github.com/facebook/react-native/blob/main/CHANGELOG.md

ErikSin commented 1 year ago

Patch Package for React-Native

React Native Patch Package Needs to be upgraded for new react native version. According to ReadMe we are adding an environment variable.

ErikSin commented 1 year ago

Moving to sprint 8: About a weeks worth of work until completion

ErikSin commented 1 year ago

Current problems that is holding up development.

Polyfill for text-encoder is not working. The upgrade of react-native necessitates an upgrade in react and react-dom versions. This upgrade means the text-encoder in react-dom/server is not working. React-dom/server is being used in ObservationShare.js. There is a polyfill for text-encoder, but that is not working. I have tried changing the polyfill to use polyfillGlobal from react-native/Libraries/Utilities/PolyfillFunctions and text-encoding-polyfill , and it did not fix the problem.

Just wanted to flag this and see if there are any other considerations before I put the work into changing the app code to not use react-dom/server. @gmaclennan @achou11

ErikSin commented 1 year ago

Maintenance Consideration

A minimum version of node 16 is required by react-native. Unfortunately the version (0.8.1) of nodejs-mobile-react-native that we use utilizes node 12. This leads to a problem with out e2e tests (and ci), as the backend needs to be built using node 12, but is using node 16 in the dev environment. The fix is to specify what version of node is being used in CI, rather then just defaulting to the dev version. This causes some upkeep issues as dev environment and ci environments are using different versions. This is possible to do, just worth mentioning