Uploaded image for project: 'Nuxeo Mobile'
  1. Nuxeo Mobile
  2. NXMOB-332

Update React Native version to latest

    XMLWordPrintable

    Details

      Description

      Pick the latest version of React Native compatible with the external libraries we use.
      -----------------------------------------------
      Upgraded to RN 0.47.2.
      RN 0.48.0 was just released at his time but not stable enough...
      Updated most of the RN external libraries.

      Upgrade Process

      Followed https://facebook.github.io/react-native/docs/upgrading.html
      react-native-git-upgrade didn't work (git diff was done but couldn't be applied) so used the alternative with react-native upgrade.

      Main breaking changes

      Updated RN libraries

      -    "bugsnag-react-native": "1.2.3",
      +    "bugsnag-react-native": "2.3.2",
           "extend": "3.0.0",
           "jssha": "^2.3.1",
           "moment": "2.17.0",
           "nuxeo": "^3.2.1",
           "query-string": "^4.3.4",
           "random-js": "^1.0.8",
      -    "react": "15.4.1",
      -    "react-native": "0.38.0",
      -    "react-native-cookies": "2.0.0",
      +    "react": "16.0.0-alpha.12",
      +    "react-native": "0.47.2",
      +    "react-native-cookies": "3.2.0",
           "react-native-custom-tabs": "0.1.6",
      -    "react-native-device-info": "0.9.6",
      -    "react-native-drawer": "2.3.0",
      -    "react-native-fetch-blob": "0.10.0",
      -    "react-native-i18n": "0.1.1",
      -    "react-native-photo-view": "1.2.0",
      -    "react-native-router-flux": "3.37.0",
      +    "react-native-device-info": "0.11.0",
      +    "react-native-drawer": "2.5.0",
      +    "react-native-fetch-blob": "0.10.8",
      +    "react-native-i18n": "2.0.5",
      +    "react-native-photo-view": "1.4.0",
      +    "react-native-router-flux": "3.41.0",
           "react-native-safari-view": "2.0.0",
      -    "react-native-segment-analytics": "0.1.9",
      -    "react-native-share": "1.0.17",
      +    "react-native-segment-analytics": "git+https://github.com/chitezh/react-native-segment-analytics#88d764270b8c221b0dd483ef9e3c71d5fe4cf056",
      +    "react-native-share": "1.0.21",
      

      Notes:

      • react-native-showdown: seems dead so we should study an alterative, see NXMOB-296
      • react-native-swipeout: still relying on a patched fork, let's try to align on the main repository or study an alternative, see NXMOB-387
      • react-native-router-flux: updated to the latest version of the v3 branch, see NXMOB-385 for upgrading to v4 and about the npm shrinkwrap hack
      • react-native-segment-analytics: now relying on a patched fork, let's try to align on the main repository, see NXMOB-388
      • react-native-fetch-blob: we now get an non blocking error when downloading a file from Android, see NXMOB-390
      • devDependencies: didn't update any lib, about this see NXMOB-389

      Build

      Had some Xcode compilation issues depending on the way of linking some RN libraries.

      • Sometimes react-native link worked (now need to use node_modules/react-native/local-cli/cli.js link instead of the deprecated rnpm link).
      • Sometimes needed to not use react-native link but rely on Cocoapods only as for react-native-i18n.
        => running react-native link globally will add some libRNI18n.a entries in project.pbxproj that mustn't be committed as they would interfere with the pod installation and make the compilation fail.
      • Sometimes needed to link manually in Xcode.

      After aligning on master here's the process:

      gem install fastlane -NV
      gem install cocoapods
      
      rm -rf node_modules
      npm cache clean --force
      npm install
      npm prune
      pod repo update
      cd ios
      rm -rf Pods
      pod install
      # make sure it compiles
      fastlane gym --scheme NuxeoMobile --export_method app-store --workspace './ios/NuxeoMobile.xcworkspace'
      npm start -- --reset-cache
      npm run ios
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 days, 4 hours
                  4d 4h