Skip to content

Commit f515ccc

Browse files
author
Riccardo Cipolleschi
committed
chore: prepare sample apps for new and old arch
1 parent 88466b5 commit f515ccc

File tree

151 files changed

+22819
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+22819
-0
lines changed

Migration.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Migration to the New Architecture
2+
3+
This file is a tracker for what has been done to work on the migration of this library and to keep also track of the various todo:
4+
5+
## TODO
6+
7+
- [] Write JS spec in Flow for the New Architecture
8+
- [] Implent the new Native Code on iOS
9+
- [] Implent the new Native Code on Android
10+
- [] Test on OldArch app (iOS)
11+
- [] Test on OldArch app (Android)
12+
- [] Test on NewArch app (iOS)
13+
- [] Test on NewArch app (Android)
14+
- [] Open PR
15+
16+
## Done
17+
18+
### Setup
19+
1. Forked and cloned the repo
20+
1. Checked the list of APIs to migrate.
21+
1. Created an `OldArch` app (0.70) configured for the Old Architecture.
22+
1. Run the app to make sure that it works properly.
23+
1. Created a `NewArch` app (0.70) configured for the New Architecture.
24+
1. Switched the flags for iOS and Android to have the new arch enabled by default
25+
1. Run the app to make sure that it works properly.
26+
1. Moved the apps in the `examples` folder
27+
28+
### Installing blob-utils
29+
1. Move to `OldArch`
30+
1. Run `yarn add ../..` to install the blob utils.
31+
1. `cd ios`
32+
1. `bundle install && bundle exec pod install`
33+
1. `cd ..`
34+
1. `npx react-native run-ios`
35+
1. Copy the app JS code from `examples/ReactNativeBlobUtil/App.js` to `examples/OldArch/App.js`
36+
1. Fixed various JS issues
37+
1. The app depends on the `Picker`. *Note:* It does not support the New Arch, we need to figure out another way to choose.
38+
1. run `yarn add @react-native-picker/picker`
39+
1. run `bundle exec pod install` from the iOS folder
40+
1. re-run the app
41+
1. Repeat the above steps for `NewArch`

examples/NewArch/.buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

examples/NewArch/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

examples/NewArch/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

examples/NewArch/.flowconfig

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore polyfills
9+
node_modules/react-native/Libraries/polyfills/.*
10+
11+
; Flow doesn't support platforms
12+
.*/Libraries/Utilities/LoadingView.js
13+
14+
.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$
15+
16+
[untyped]
17+
.*/node_modules/@react-native-community/cli/.*/.*
18+
19+
[include]
20+
21+
[libs]
22+
node_modules/react-native/interface.js
23+
node_modules/react-native/flow/
24+
25+
[options]
26+
emoji=true
27+
28+
exact_by_default=true
29+
30+
format.bracket_spacing=false
31+
32+
module.file_ext=.js
33+
module.file_ext=.json
34+
module.file_ext=.ios.js
35+
36+
munge_underscores=true
37+
38+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
39+
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\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
40+
41+
suppress_type=$FlowIssue
42+
suppress_type=$FlowFixMe
43+
suppress_type=$FlowFixMeProps
44+
suppress_type=$FlowFixMeState
45+
46+
[lints]
47+
sketchy-null-number=warn
48+
sketchy-null-mixed=warn
49+
sketchy-number=warn
50+
untyped-type-import=warn
51+
nonstrict-import=warn
52+
deprecated-type=warn
53+
unsafe-getters-setters=warn
54+
unnecessary-invariant=warn
55+
56+
[strict]
57+
deprecated-type
58+
nonstrict-import
59+
sketchy-null
60+
unclear-type
61+
unsafe-getters-setters
62+
untyped-import
63+
untyped-type-import
64+
65+
[version]
66+
^0.182.0

examples/NewArch/.gitignore

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
35+
# node.js
36+
#
37+
node_modules/
38+
npm-debug.log
39+
yarn-error.log
40+
41+
# BUCK
42+
buck-out/
43+
\.buckd/
44+
*.keystore
45+
!debug.keystore
46+
47+
# fastlane
48+
#
49+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
50+
# screenshots whenever they are needed.
51+
# For more information about the recommended setup visit:
52+
# https://docs.fastlane.tools/best-practices/source-control/
53+
54+
**/fastlane/report.xml
55+
**/fastlane/Preview.html
56+
**/fastlane/screenshots
57+
**/fastlane/test_output
58+
59+
# Bundle artifact
60+
*.jsbundle
61+
62+
# Ruby / CocoaPods
63+
/ios/Pods/
64+
/vendor/bundle/

examples/NewArch/.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

examples/NewArch/.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

examples/NewArch/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.5

examples/NewArch/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)