Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Fabric and TurboModules on iOS & Android #13767

Merged
merged 259 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
259 commits
Select commit Hold shift + click to select a range
709b733
Merge branch 'main' into andrew-fabric
AndrewGable Oct 28, 2022
0f66f43
Update from main
AndrewGable Oct 28, 2022
273cf07
Merge branch 'main' into andrew-fabric
roryabraham Nov 30, 2022
c3f4342
Reinstall packages after merging main
roryabraham Nov 30, 2022
b53e39e
chore: merge current main
WoLewicki Feb 10, 2023
803aaa7
feat: apply all changes from the PR and revert crashing blob-util on …
WoLewicki Feb 10, 2023
d647804
feat: add image manipulator
WoLewicki Feb 13, 2023
77eebae
chore: merge current main
WoLewicki Feb 13, 2023
9f1fd05
Update `@onfido/react-native-sdk` and `react-native-blob-util`
j-piasecki Feb 13, 2023
dc53c90
Update GH patch, add workaround for gestures attaching too soon
j-piasecki Feb 13, 2023
6ef5158
Update fast image patch in the fork
j-piasecki Feb 14, 2023
917386a
Patch `react-native-image-picker` to fallback to filename for extenst…
j-piasecki Feb 14, 2023
d93217a
Update `react-native-blob-util`
j-piasecki Feb 14, 2023
09129d9
Update `react-native-image-picker`
j-piasecki Feb 14, 2023
9792308
Update `react-native-image-size`
j-piasecki Feb 15, 2023
d1214b2
Merge branch 'main' into andrew-fabric
j-piasecki Feb 21, 2023
efd0c2c
Update `react-native-config`
j-piasecki Feb 21, 2023
27faac2
Update netinfo
j-piasecki Feb 23, 2023
2f91d6d
feat: bump image picker and update permissions
WoLewicki Feb 24, 2023
887d75a
Update haptic-feedback
j-piasecki Feb 27, 2023
03fbf7e
feat: migrate permissions and plaid
WoLewicki Feb 28, 2023
63ead1f
chore: merge current main
WoLewicki Feb 28, 2023
8ade94f
feat: add fabric version of lottie-react-native
WoLewicki Feb 28, 2023
7e8197e
feat: migrate react native document picker
WoLewicki Feb 28, 2023
ce6f1e3
feat: migrate datetimepicker and fix document picker on paper
WoLewicki Mar 2, 2023
ea814c2
feat: migrate react-native-device-info
WoLewicki Mar 6, 2023
52cb65f
chore: merge current main
WoLewicki Mar 6, 2023
f160bf0
fix: remove freeze to fix linter
WoLewicki Mar 13, 2023
3347186
chore: merge current main
WoLewicki Mar 13, 2023
964a0d5
Add mocks
j-piasecki Mar 13, 2023
6bdfd6f
Update `premissions` mock
j-piasecki Mar 22, 2023
9570196
Merge branch 'main' into andrew-fabric
j-piasecki Mar 22, 2023
426c69c
Increase `setupNode` action timeout
j-piasecki Mar 24, 2023
c9dbecf
Don't use composite action in `testBuild` workflow
j-piasecki Mar 24, 2023
09e729c
Revert changes in `testBuild` action
j-piasecki Mar 28, 2023
0383d47
feat: add fabric version of react-native-webview
WoLewicki Mar 29, 2023
0320be5
Merge branch 'main' into andrew-fabric
j-piasecki Apr 11, 2023
ed64098
feat: build android from source
WoLewicki Apr 18, 2023
64c53e5
fix: camera-roll
WoLewicki Apr 18, 2023
b9dbb12
chore: merge current main
WoLewicki Apr 18, 2023
18d5a5f
Merge branch 'main' into andrew-fabric
WoLewicki Apr 18, 2023
a9c5bcb
fix: vscode main merge problems
WoLewicki Apr 19, 2023
c9f3af4
chore: merge current main
WoLewicki Apr 24, 2023
36a6ff5
fix: RCTBootSplash on Fabric and add patch to reanimated
WoLewicki Apr 26, 2023
8a3b24f
fix: move onyx logic to the Indicator component that uses it
WoLewicki Apr 27, 2023
ead9034
Update patch for Reanimated
j-piasecki Apr 27, 2023
6eb9a85
Add patch for font resolution on iOS
j-piasecki Apr 27, 2023
894dc31
Update blob-util
j-piasecki Apr 28, 2023
31d51c8
Merge branch 'main' into andrew-fabric
j-piasecki May 8, 2023
620d3f5
fix: patch lib and remove freeze
WoLewicki May 8, 2023
34a4fc2
Update patches
j-piasecki May 8, 2023
88b31a4
Fix tests
j-piasecki May 15, 2023
e15e5fd
Merge branch 'main' into andrew-fabric
j-piasecki May 15, 2023
4b44473
Merge branch 'main' into andrew-fabric
j-piasecki May 15, 2023
390f727
Make tests pass
j-piasecki May 15, 2023
de4de08
Merge branch 'main' into andrew-fabric
j-piasecki May 18, 2023
e8358bd
Update Gesture Handler
j-piasecki May 18, 2023
22a657b
Fix flickering issues
j-piasecki May 18, 2023
f4df6be
Make magic codes work on iOS
j-piasecki May 19, 2023
d64693a
Merge branch 'main' into andrew-fabric
j-piasecki May 29, 2023
5b429a2
Fix splash screen flickering
j-piasecki May 29, 2023
4a0604c
Update boot splash
j-piasecki May 30, 2023
e5a9b63
Update xcode project
j-piasecki Jun 5, 2023
4c41ea1
Merge branch 'main' into andrew-fabric
j-piasecki Jun 5, 2023
8ba1842
Apply patched onfido
j-piasecki Jun 5, 2023
ec77725
Fix focus not visible on MagicCodeInput on iOS
j-piasecki Jun 5, 2023
ddcdd82
Upgrade lottie
j-piasecki Jun 6, 2023
91d89d6
Merge branch 'main' into andrew-fabric
j-piasecki Jun 7, 2023
d73d5c6
Merge branch 'main' into andrew-fabric
j-piasecki Jun 12, 2023
6909f43
Remove fast image patch
j-piasecki Jun 12, 2023
156bb3f
Merge branch 'main' into andrew-fabric
j-piasecki Jun 16, 2023
918931e
Disable `ReportActionsList` animation
j-piasecki Jun 16, 2023
770db6b
Merge branch 'main' into andrew-fabric
j-piasecki Jun 19, 2023
70992f2
Merge branch 'main' into andrew-fabric
j-piasecki Jun 20, 2023
e12c1cf
Workaround for `didScreenTransitionEnd` being constantly false
j-piasecki Jun 20, 2023
c7fb02d
Fix composer lagging on every render on Android
j-piasecki Jun 20, 2023
887b040
Merge branch 'main' into andrew-fabric
j-piasecki Jun 21, 2023
f5d0ae8
chore: merge current main
WoLewicki Jun 26, 2023
446d878
chore: run prettier and lint
WoLewicki Jun 26, 2023
13eb0eb
Merge branch 'main' into andrew-fabric
j-piasecki Jun 27, 2023
b7d2930
Merge remote-tracking branch 'fabioh/feature/rn-update-0.72' into and…
j-piasecki Jun 27, 2023
0d7e68a
Update fast image
j-piasecki Jun 29, 2023
f3ba0a9
Merge branch 'main' into andrew-fabric
j-piasecki Jul 3, 2023
7d93d37
Merge branch 'main' into andrew-fabric
j-piasecki Jul 10, 2023
d45a4c8
Audit patches
j-piasecki Jul 10, 2023
2b9026b
Update React Native patch
j-piasecki Jul 11, 2023
e0e2afd
Merge branch 'main' into andrew-fabric
j-piasecki Jul 11, 2023
78f1ef8
Fix `react-native-performance` patch
j-piasecki Jul 11, 2023
ea7c193
Lower `async-storage` target iOS version
j-piasecki Jul 12, 2023
350044f
Update dependencies
j-piasecki Jul 12, 2023
6812a52
Workaround for attachement carousel not working
j-piasecki Jul 13, 2023
00e13d8
Dont compare bool to number
j-piasecki Jul 13, 2023
9f4c4d6
Merge branch 'main' into andrew-fabric
j-piasecki Jul 17, 2023
3766590
Merge branch 'main' into andrew-fabric
j-piasecki Jul 19, 2023
46280c6
Merge branch 'main' into andrew-fabric
j-piasecki Jul 20, 2023
7cc5776
WIP: 46280c6cb8 Merge branch 'main' into andrew-fabric
j-piasecki Jul 20, 2023
6cf41d8
Fix patches
j-piasecki Jul 20, 2023
1931619
Merge branch 'main' into andrew-fabric
j-piasecki Jul 24, 2023
f9c2166
Update lottie
j-piasecki Jul 24, 2023
2966ada
Merge branch 'main' into andrew-fabric
j-piasecki Jul 27, 2023
59aa3cd
Use updated onyx from branch
j-piasecki Jul 27, 2023
7595037
Merge branch 'main' into andrew-fabric
j-piasecki Aug 1, 2023
f57712d
Add patch for suspense
j-piasecki Aug 1, 2023
fcd1455
Make `updatePropsPaperWorklet` also work when not using paper
j-piasecki Aug 2, 2023
779cd8b
Merge branch 'main' into andrew-fabric
j-piasecki Aug 2, 2023
b38b563
Merge branch 'main' into andrew-fabric
j-piasecki Aug 3, 2023
5f4d2d5
chore: merge current main
WoLewicki Aug 4, 2023
a043c11
fix: add patch for kotlin in react-native-plaid-link-sdk
WoLewicki Aug 4, 2023
45072c2
Merge branch 'main' into andrew-fabric
j-piasecki Aug 7, 2023
2bbb710
Update the logic responsible for showing skeleton
j-piasecki Aug 7, 2023
4106e04
Add document picker mock
j-piasecki Aug 8, 2023
ced4767
Don't show skeleton every time on web
j-piasecki Aug 8, 2023
602d4fd
chore: merge current main
WoLewicki Aug 8, 2023
d5839a6
chore: merge current main
WoLewicki Aug 21, 2023
8b1eed2
chore: prettiefy code
WoLewicki Aug 21, 2023
d357a73
chore: remove unnecessary line
WoLewicki Aug 21, 2023
7cfb73b
fix: lint
WoLewicki Aug 21, 2023
3b6a387
fix: make apps build correctly on new arch
WoLewicki Aug 21, 2023
605e7df
chore: merge current main
WoLewicki Sep 18, 2023
e0e17d2
chore: run prettier
WoLewicki Sep 18, 2023
3f1fba9
Merge branch 'main' into andrew-fabric
mczernek Oct 12, 2023
b060ed5
Fix RN patch.
mczernek Oct 18, 2023
d97ba94
Update Podfile.lock
mczernek Oct 18, 2023
e90e20d
chore: merge current main
WoLewicki Nov 8, 2023
31099b9
fix: remove unused file
WoLewicki Nov 8, 2023
8d25254
fix: remove some leftover
WoLewicki Nov 8, 2023
3a9136d
chore: merge current main
WoLewicki Nov 10, 2023
18f2dc8
Merge branch '@jpiasecki/rn-73' into andrew-fabric
j-piasecki Nov 27, 2023
2543db6
Merge remote-tracking branch 'origin/andrew-fabric' into andrew-fabric
j-piasecki Nov 27, 2023
eee12f8
feat: bump rn and deps versions
WoLewicki Nov 29, 2023
670415f
Add a few patches
j-piasecki Nov 29, 2023
57d5b3f
Fix some things I think
j-piasecki Nov 29, 2023
bb3d493
iOS builds again
j-piasecki Dec 1, 2023
baff4ac
Patch codegen not to override cpp flags
j-piasecki Dec 1, 2023
fcd23e3
Android builds again
j-piasecki Dec 1, 2023
8bcbab1
Don't subscribe to `editFocused` on native to prevent blinking
j-piasecki Dec 6, 2023
b313ecf
Move most onyx subscriptions to the child component to prevent blinking
j-piasecki Dec 6, 2023
ffb8f71
chore: merge current main
WoLewicki Jan 12, 2024
550b0c2
feat: bump one of PRs and remove some of unused patches
WoLewicki Jan 15, 2024
18a7f99
fix: remove flipper usage
WoLewicki Jan 17, 2024
82c4050
fix: bump some packages and remove some patches
WoLewicki Jan 17, 2024
e37dd43
feat: both archs building
WoLewicki Jan 17, 2024
58bd033
fix: remove unused dev dep
WoLewicki Jan 23, 2024
774404a
fix: indent
WoLewicki Jan 23, 2024
e79bc1c
fix: make view with changing prop non collapsable to avoid crashes
WoLewicki Jan 23, 2024
924eb82
chore: merge current main
WoLewicki Jan 23, 2024
3100b72
fix: quick workaround for android testing
WoLewicki Jan 23, 2024
ea3cd94
fix: composer with new dep
WoLewicki Jan 23, 2024
df6f2b9
fix: quick workaround for android testing part 2
WoLewicki Jan 23, 2024
7e043c1
Fix crashes in preferences on iOS
j-piasecki Jan 24, 2024
21b8668
fix: bump location enabler to get non crashing google location services
WoLewicki Jan 24, 2024
6816b93
Fix popover not being visible on the receipt screen
j-piasecki Jan 24, 2024
75b2e51
Fix composer flicker
j-piasecki Jan 24, 2024
c33a4ee
Fix calendar not being visible
j-piasecki Jan 24, 2024
27846dd
Fix backdrop flashes on Android
j-piasecki Jan 24, 2024
dfc6e9a
Merge branch 'main' into andrew-fabric
j-piasecki Jan 24, 2024
0fbbe08
chore: merge current main
WoLewicki Jan 26, 2024
5657157
Add a workaround for ios build failing on CI
j-piasecki Jan 26, 2024
167738f
Add a workaround for layout issues on ios
j-piasecki Jan 26, 2024
bb15efa
Merge branch 'main' into andrew-fabric
j-piasecki Jan 29, 2024
23b283a
fix: restore building rn from source
WoLewicki Jan 29, 2024
b3b706b
fix: make more granular patches
WoLewicki Jan 29, 2024
84b6f67
Fix flashlist not working with Reanimated's `scrollTo`
j-piasecki Jan 29, 2024
24d3a23
Clip background so it doesn't overlap chat items
j-piasecki Jan 30, 2024
36e2d0c
feat: update patches
WoLewicki Jan 30, 2024
2894ec0
Add patch for keyboard layout issues
j-piasecki Jan 31, 2024
98ccf99
Merge branch 'main' into andrew-fabric
j-piasecki Feb 1, 2024
b43e3b8
Fix keyboard flickering on Android during navigation
j-piasecki Feb 1, 2024
48c7929
Merge branch 'main' into andrew-fabric
j-piasecki Feb 1, 2024
41fd7ed
Merge branch 'main' into andrew-fabric
j-piasecki Feb 2, 2024
4890aff
Workaround for issues with android navigation
j-piasecki Feb 2, 2024
20e38ec
Link against DeviceCheck to possibly fix iOS build on CI
j-piasecki Feb 2, 2024
a994c6d
Remove flipper from `package-lock.json`
j-piasecki Feb 5, 2024
4bb00a3
Merge branch 'main' into andrew-fabric
j-piasecki Feb 5, 2024
2c02bb5
Init selection to point to the end of the drafted message
j-piasecki Feb 5, 2024
ad11168
Don't minify `com.facebook` package to prevent release build crashing
j-piasecki Feb 6, 2024
142f760
Fix wrong animation when navigating between settings screens
j-piasecki Feb 6, 2024
a186f5c
Merge branch 'main' into andrew-fabric
j-piasecki Feb 6, 2024
aa708ef
Fix emojis being cut off
j-piasecki Feb 6, 2024
4346c92
chore: merge current main
WoLewicki Feb 6, 2024
5a5998a
Workaround for emojis being too high
j-piasecki Feb 8, 2024
8190df0
Merge branch 'main' into andrew-fabric
j-piasecki Feb 8, 2024
6a3ba0f
Fix crash when sending photos
j-piasecki Feb 8, 2024
9d2f0d5
Adapt current `plaid-link-sdk` to the new arch code
j-piasecki Feb 8, 2024
57b0bbe
Merge remote-tracking branch 'origin/andrew-fabric' into andrew-fabric
j-piasecki Feb 8, 2024
e2aea4c
Merge branch 'main' into andrew-fabric
j-piasecki Feb 9, 2024
7f73a17
Merge branch 'main' into andrew-fabric
j-piasecki Feb 12, 2024
6a7183d
Use a vision camera fork
j-piasecki Feb 12, 2024
c3679bb
Add patch for non-translucent status bar
j-piasecki Feb 13, 2024
940bdf5
Merge branch 'main' into andrew-fabric
j-piasecki Feb 13, 2024
39ef764
Fix layout issues with keyboard on android
j-piasecki Feb 14, 2024
88b73a9
Merge branch 'main' into andrew-fabric
j-piasecki Feb 14, 2024
fa88644
Update patches
j-piasecki Feb 15, 2024
82dc93f
Merge branch 'main' into andrew-fabric
j-piasecki Feb 15, 2024
401afe5
Remove unnecessary entitlements
j-piasecki Feb 15, 2024
7477e9b
Update mapbox
j-piasecki Feb 15, 2024
27a35a4
Merge branch 'main' into andrew-fabric
j-piasecki Feb 16, 2024
c7640b0
Merge branch 'main' into andrew-fabric
j-piasecki Feb 19, 2024
b87a430
fix: make svg in share code appear correctly
WoLewicki Feb 19, 2024
abef0f6
Update screens patch
j-piasecki Feb 19, 2024
a3b3835
Merge branch 'main' into andrew-fabric
j-piasecki Feb 26, 2024
f7a665f
Fix blank space on the bottom part of the screen
j-piasecki Feb 26, 2024
b0f97e6
Merge branch 'main' into andrew-fabric
j-piasecki Feb 27, 2024
9dd828a
Update onfido sdk
j-piasecki Feb 27, 2024
f630ab2
Merge branch 'main' into andrew-fabric
j-piasecki Feb 28, 2024
fb918d8
Use `modal` again on android
j-piasecki Feb 28, 2024
d6287ba
Merge branch 'main' into andrew-fabric
j-piasecki Mar 13, 2024
101f6d0
Use patches instead of forks
j-piasecki Mar 13, 2024
f9ef36d
Restore newline
j-piasecki Mar 14, 2024
7e95348
Restore type
j-piasecki Mar 14, 2024
b0d3be8
Remove ModalWithoutChildren
j-piasecki Mar 14, 2024
0a3782f
Use Expensify fork of `react-native-image-size`
j-piasecki Mar 14, 2024
cb0327c
Add helper function to remove `Platform.OS`
j-piasecki Mar 14, 2024
15d2aba
Add helper function to remove `Platform.OS`
j-piasecki Mar 14, 2024
6a4306b
Add new lines at the file endings
j-piasecki Mar 14, 2024
d9c4ea2
Merge branch 'main' into andrew-fabric
j-piasecki Mar 14, 2024
9635858
Restore `react-native.config.js`
j-piasecki Mar 14, 2024
2ea4a56
Merge branch 'main' into andrew-fabric
j-piasecki Mar 15, 2024
03401a1
Run prettier
j-piasecki Mar 15, 2024
c9e45b2
Fix patch types
j-piasecki Mar 15, 2024
4b3fe1a
Fix podfile
j-piasecki Mar 15, 2024
38351ef
Merge branch 'main' into andrew-fabric
j-piasecki Mar 15, 2024
86aa15f
Fix web crash on `About` page
j-piasecki Mar 15, 2024
b79ca78
Live Markdown new arch support!
j-piasecki Mar 20, 2024
a065df4
Update live markdown so it works in production build
j-piasecki Mar 21, 2024
f1f3a7a
Merge branch 'main' into andrew-fabric
j-piasecki Mar 22, 2024
df0fc26
Don't use live markdown fork
j-piasecki Mar 22, 2024
05dadd6
Fix cocoapods version
j-piasecki Mar 25, 2024
8a1f3df
Merge branch 'main' into andrew-fabric
j-piasecki Mar 25, 2024
ac1996d
Fix cocoapods version in lock
j-piasecki Mar 25, 2024
465661d
Merge branch 'main' into andrew-fabric
j-piasecki Mar 26, 2024
d16ed22
Merge branch 'main' into andrew-fabric
j-piasecki Mar 27, 2024
77d4483
Update patches
j-piasecki Mar 27, 2024
19af1d6
Add live markdown patch
j-piasecki Mar 27, 2024
639a4be
Merge branch 'main' into andrew-fabric
j-piasecki Mar 28, 2024
4782fb4
Merge branch 'main' into andrew-fabric
j-piasecki Mar 29, 2024
9400810
Patch vision camera to work on Android
j-piasecki Mar 29, 2024
df53b76
Update vision camera patch
j-piasecki Mar 29, 2024
1667520
Fix import paths in vision camera
j-piasecki Mar 29, 2024
614fdaf
chore: merge current main
WoLewicki Apr 4, 2024
c500d45
chore: merge current main
WoLewicki Apr 4, 2024
e47a84d
chore: merge current main
WoLewicki Apr 5, 2024
2a27f30
Merge branch 'main' into andrew-fabric
WoLewicki Apr 5, 2024
c7dc1ff
Merge branch 'main' into andrew-fabric
j-piasecki Apr 8, 2024
3fd1d84
fix: remove gemfile and gemfile.lock changes
WoLewicki Apr 8, 2024
7d0efd1
fix: update package-lock.json
WoLewicki Apr 9, 2024
a342826
Merge branch 'main' into andrew-fabric
WoLewicki Apr 9, 2024
1fbac0c
feat: update Podfile.lock
WoLewicki Apr 9, 2024
063f3a0
Merge branch 'main' into andrew-fabric
WoLewicki Apr 9, 2024
444bfaa
Merge branch 'main' into andrew-fabric
WoLewicki Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# Add any project specific keep options here:
-keep class com.expensify.chat.BuildConfig { *; }
-keep class com.facebook.** { *; }
-keep, allowoptimization, allowobfuscation class expo.modules.** { *; }

# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
Expand Down
3 changes: 2 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ AsyncStorage_useNextStorage=true
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
8 changes: 8 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ project(':react-native-dev-menu').projectDir = new File(rootProject.projectDir,
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
includeBuild('../node_modules/react-native') {
dependencySubstitution {
substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid"))
substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid"))
substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
}
}

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
472 changes: 270 additions & 202 deletions ios/NewExpensify.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug Production"
buildConfiguration = "DebugProduction"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/RCTBootSplash.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

+ (void)invalidateBootSplash;
+ (void)initWithStoryboard:(NSString * _Nonnull)storyboardName
rootView:(RCTRootView * _Nullable)rootView;
rootView:(UIView * _Nullable)rootView;

@end
147 changes: 0 additions & 147 deletions ios/NewExpensify/RCTBootSplash.m

This file was deleted.

186 changes: 186 additions & 0 deletions ios/NewExpensify/RCTBootSplash.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
#import "RCTBootSplash.h"

#import <React/RCTUtils.h>

#if RCT_NEW_ARCH_ENABLED
#import <React/RCTSurfaceHostingProxyRootView.h>
#import <React/RCTSurfaceHostingView.h>
#else
#import <React/RCTRootView.h>
#endif

static NSMutableArray<RCTPromiseResolveBlock> *_resolveQueue = nil;
static UIView *_loadingView = nil;
static UIView *_rootView = nil;
static float _duration = 0;
static bool _nativeHidden = false;
static bool _transitioning = false;

@implementation RCTBootSplash

RCT_EXPORT_MODULE();

- (dispatch_queue_t)methodQueue {
return dispatch_get_main_queue();
}

+ (void)invalidateBootSplash {
_resolveQueue = nil;
_rootView = nil;
_nativeHidden = false;
}

+ (bool)isLoadingViewHidden {
return _loadingView == nil || [_loadingView isHidden];
}

+ (bool)hasResolveQueue {
return _resolveQueue != nil;
}

+ (void)clearResolveQueue {
if (![self hasResolveQueue])
return;

while ([_resolveQueue count] > 0) {
RCTPromiseResolveBlock resolve = [_resolveQueue objectAtIndex:0];
[_resolveQueue removeObjectAtIndex:0];
resolve(@(true));
}
}

+ (void)hideLoadingView {
if ([self isLoadingViewHidden])
return [RCTBootSplash clearResolveQueue];

if (_duration > 0) {
dispatch_async(dispatch_get_main_queue(), ^{
_transitioning = true;

if (_rootView == nil)
return;

[UIView transitionWithView:_rootView
duration:_duration / 1000.0
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
_loadingView.hidden = YES;
}
completion:^(__unused BOOL finished) {
[_loadingView removeFromSuperview];
_loadingView = nil;

_transitioning = false;
return [RCTBootSplash clearResolveQueue];
}];
});
} else {
_loadingView.hidden = YES;
[_loadingView removeFromSuperview];
_loadingView = nil;

return [RCTBootSplash clearResolveQueue];
}
}

+ (void)initWithStoryboard:(NSString * _Nonnull)storyboardName
rootView:(UIView * _Nullable)rootView {
if (rootView == nil
#ifdef RCT_NEW_ARCH_ENABLED
|| ![rootView isKindOfClass:[RCTSurfaceHostingProxyRootView class]]
#else
|| ![rootView isKindOfClass:[RCTRootView class]]
#endif
|| _rootView != nil
|| [self hasResolveQueue] // hide has already been called, abort init
|| RCTRunningInAppExtension())
return;

#ifdef RCT_NEW_ARCH_ENABLED
RCTSurfaceHostingProxyRootView *proxy = (RCTSurfaceHostingProxyRootView *)rootView;
_rootView = (RCTSurfaceHostingView *)proxy.surface.view;
#else
_rootView = (RCTRootView *)rootView;
#endif

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil];

_loadingView = [[storyboard instantiateInitialViewController] view];
_loadingView.hidden = NO;

[_rootView addSubview:_loadingView];

[NSTimer scheduledTimerWithTimeInterval:0.35
repeats:NO
block:^(NSTimer * _Nonnull timer) {
// wait for native iOS launch screen to fade out
_nativeHidden = true;

// hide has been called before native launch screen fade out
if ([self hasResolveQueue])
[self hideLoadingView];
}];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onJavaScriptDidLoad)
name:RCTJavaScriptDidLoadNotification
object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onJavaScriptDidFailToLoad)
name:RCTJavaScriptDidFailToLoadNotification
object:nil];
}

+ (void)onJavaScriptDidLoad {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}

+ (void)onJavaScriptDidFailToLoad {
[self hideLoadingView];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)hide:(double)duration
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject {
if (_resolveQueue == nil)
_resolveQueue = [[NSMutableArray alloc] init];

[_resolveQueue addObject:resolve];

if ([RCTBootSplash isLoadingViewHidden] || RCTRunningInAppExtension())
return [RCTBootSplash clearResolveQueue];

_duration = lroundf((float)duration);

if (_nativeHidden)
return [RCTBootSplash hideLoadingView];
}

- (void)getVisibilityStatus:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject {
if ([RCTBootSplash isLoadingViewHidden])
return resolve(@"hidden");
else if (_transitioning)
return resolve(@"transitioning");
else
return resolve(@"visible");
}

RCT_REMAP_METHOD(hide,
resolve:(RCTPromiseResolveBlock)resolve
rejecte:(RCTPromiseRejectBlock)reject) {
[self hide:0
resolve:resolve
reject:reject];
}

RCT_REMAP_METHOD(getVisibilityStatus,
getVisibilityStatusWithResolve:(RCTPromiseResolveBlock)resolve
rejecte:(RCTPromiseRejectBlock)reject) {
[self getVisibilityStatus:resolve
reject:reject];
}

@end
Loading
Loading