Skip to content

Commit

Permalink
feat: Upgrade to React Native v0.60.4 (#183)
Browse files Browse the repository at this point in the history
Updating to latest React Native (from our current v0.58) gives us lots of benefits:

Fixes to bugs with JSC (JavaScriptCore) which were causing crashes with Samsung S7 phones and other phones (we had some hacky workarounds)
Ready for 64-bit versions which will be required for listing on Google Play after August 2019.
Support for new React features (react hooks which make the code easier to debug and more concise
It's now much easier to use native modules - this means things like the camera and gps - without complicated integration. This should mean that building for iOS should be much easier
It uses AndroidX which is a redesigned module system for Android with clearer naming and versions, which should make compatibility and upgrading a lot less bug-prone.
More info in the announcements of RN v0.59 and RN v0.60

The latest version of nodejs-mobile (which we use for Mapeo Core) has not been working for Mapeo, and we needed to do some hacky fixes for bugs we were hitting which were already fixed in the latest version. Now we're running latest nodejs-mobile, so we get the bug fixes from there.
  • Loading branch information
gmaclennan authored Aug 5, 2019
1 parent e9711bd commit e2bf58b
Show file tree
Hide file tree
Showing 52 changed files with 147,650 additions and 14,339 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"react-native/no-unused-styles": 2,
"react-native/no-raw-text": 2,
"react/display-name": 0,
"camelcase": 0
"camelcase": 0,
"lines-between-class-members": 0
},
"settings": {
"react": {
Expand Down
59 changes: 44 additions & 15 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ android/.*
; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
node_modules/react-native/Libraries/react-native/React.js

; Ignore polyfills
.*/Libraries/polyfills/.*
node_modules/react-native/Libraries/polyfills/.*

; Ignore metro
.*/node_modules/metro/.*
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/HMRLoadingView.js

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

; Ignore module-deps test
.*/node_modules/module-deps/test/.*
Expand All @@ -32,14 +39,17 @@ nodejs-assets/.*
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
Expand All @@ -52,27 +62,46 @@ module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.89.0
^0.98.0
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ yarn-error.log
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
Expand All @@ -60,3 +61,6 @@ package-lock.json
/nodejs-assets
# docz
.docz

# CocoaPods
/ios/Pods/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.16
Loading

0 comments on commit e2bf58b

Please sign in to comment.