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

[Fabric] Reanimated for Fabric #3206

Merged
merged 419 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
419 commits
Select commit Hold shift + click to select a range
6a27c00
Use single lock when updating newest shadow node
tomekzaw Apr 11, 2022
312ffed
Make it compile on Android again
tomekzaw Apr 11, 2022
f20a321
Improve transaction implementation
tomekzaw Apr 12, 2022
82f14d9
Fabric init on ios
graszka22 Apr 12, 2022
e6cbd07
Remove listeners to avoid memory leaks
graszka22 Apr 13, 2022
b1f8448
Events on UI thread
piaskowyk Apr 13, 2022
db69d0a
Clena up events
piaskowyk Apr 13, 2022
628306f
Add const
piaskowyk Apr 13, 2022
5658b49
Fix a lot of things
tomekzaw Apr 13, 2022
628efa4
Works
piaskowyk Apr 13, 2022
248a59e
Fix crash when animating layout props of recently removed view
tomekzaw Apr 14, 2022
ead048b
Remove dispatcher
piaskowyk Apr 14, 2022
88d0857
Add BokehExample
tomekzaw Apr 14, 2022
c74d4ae
Fabric Android init - call createAndInstallIfNeeded
graszka22 Apr 19, 2022
2af6493
Remove old ShadowNodes from `NewestShadowNodesRegistry`
tomekzaw Apr 19, 2022
be73ccc
Merge branch 'fabric-events-v2' into fabric
piaskowyk Apr 19, 2022
cf7ab11
Merge branch 'fabric' into @graszka22/fabric-android-init
graszka22 Apr 19, 2022
aab6db5
Review changes
graszka22 Apr 20, 2022
4e80cca
Review changes
graszka22 Apr 20, 2022
35a658e
Review changes
graszka22 Apr 20, 2022
0ed82d2
Improve and cleanup `NewestShadowNodesRegistry`
tomekzaw Apr 20, 2022
7f987c9
Return `nullptr` instead of argument
tomekzaw Apr 20, 2022
f770359
Move implementation from `cloneWithNewProps` to `performOperations`
tomekzaw Apr 20, 2022
cefbcc5
Add `const`
tomekzaw Apr 20, 2022
fcb2c24
Rename function to `getUIManagerFromRuntime`
tomekzaw Apr 20, 2022
fd6d0d8
Remove initializeForFabric
piaskowyk Apr 21, 2022
cdb3996
Apply changes from facebook/react-native#33688
tomekzaw Apr 21, 2022
6d1066a
Replace `getShadowTreeRegistryFromUIManager` with `UIManager::getShad…
tomekzaw Apr 21, 2022
3eeb0af
Patch-package `UIManagerBinding.cpp` so it works on both platforms
tomekzaw Apr 21, 2022
6e0e02b
Improve comments
tomekzaw Apr 21, 2022
542352e
Add weak pointer
piaskowyk Apr 22, 2022
7c64357
Add assert
piaskowyk Apr 22, 2022
25480b6
Bump react-native-gesture-handler in FabricExample to 2.4.1
tomekzaw Apr 22, 2022
4996e70
Weak self
piaskowyk Apr 22, 2022
63b2f4f
Merge branch 'fabric-remove-initForFabric' into fabric
piaskowyk Apr 22, 2022
66d1251
Add asserts and TODOs
tomekzaw Apr 22, 2022
603f901
Added hook
piaskowyk Apr 22, 2022
73b1b5a
Android events
graszka22 Apr 25, 2022
7f6b572
Replace `getReactSchedulerFromBinding` with `Binding::getScheduler`
tomekzaw Apr 25, 2022
031fe8b
Move event listener implementation to `NativeReanimatedModule::handle…
tomekzaw Apr 25, 2022
892959d
Keep `jsi::Runtime &` instead of pointer
tomekzaw Apr 25, 2022
8252a26
Remove `getUIManagerFromRuntime`
tomekzaw Apr 25, 2022
befe45e
Remove `getUIManagerFromBinding`
tomekzaw Apr 25, 2022
0d5f243
Reorder things
tomekzaw Apr 25, 2022
121e63e
Added Surface
piaskowyk Apr 25, 2022
64570dd
Fix event listeners on iOS reload
graszka22 Apr 25, 2022
6181383
Revert patch
piaskowyk Apr 26, 2022
a1155cf
Clean up v1
piaskowyk Apr 26, 2022
c62de35
Clean up v2
piaskowyk Apr 26, 2022
0776cd4
Refactor v1
piaskowyk Apr 26, 2022
82c9dcf
Refactor v2
piaskowyk Apr 26, 2022
11f55cf
newestShadowNodesRegistry as field
piaskowyk Apr 26, 2022
bc864e1
clear patch
piaskowyk Apr 26, 2022
1a24e15
remove assert
piaskowyk Apr 26, 2022
38db3f2
remove unused imports
piaskowyk Apr 26, 2022
0c7ceca
Added ifdef
piaskowyk Apr 26, 2022
a330e47
Add BubblesExample
tomekzaw Apr 26, 2022
cdd3fce
Add `ShadowNodeWrapper` in TypeScript
tomekzaw Apr 27, 2022
06fcf00
Restore original `ConfigHelper.ts`
tomekzaw Apr 27, 2022
61f026f
Add missing newline
tomekzaw Apr 27, 2022
946838b
Rename back to `REAEventDispatcher.m`
tomekzaw Apr 27, 2022
2736566
Improve App.tsx
tomekzaw Apr 27, 2022
cf51c54
Fix handling events from Gesture Handler
tomekzaw Apr 27, 2022
e36b9d4
Improve event handling
tomekzaw Apr 27, 2022
2efd0f8
Improvents after review
piaskowyk Apr 27, 2022
0ca3638
Typo
piaskowyk Apr 27, 2022
25b9008
Remove `rt_` field from NativeReanimatedModule
tomekzaw Apr 27, 2022
53517f2
Typo
piaskowyk Apr 27, 2022
592afb4
Typo v2
piaskowyk Apr 27, 2022
bbb97ea
Name update
piaskowyk Apr 27, 2022
c95174b
Merge branch 'fabric-events-v2' into fabric
piaskowyk Apr 27, 2022
6c8d2dd
Remove `getNewestShadowNodesRegistry`
tomekzaw Apr 27, 2022
2276aa5
Fix `NativeReanimatedModule` constructor call on Android
tomekzaw Apr 27, 2022
b6ced4f
Remove `empty` and `clear` methods
tomekzaw Apr 27, 2022
fd91360
Rename `installUIManagerBindingAfterReload`
tomekzaw Apr 27, 2022
6d333c7
Merge branch 'main' into fabric
tomekzaw Apr 27, 2022
14ba825
Remove leftover `console.log`
tomekzaw Apr 27, 2022
485d6b2
Fix fast refresh when changing onScroll handler
graszka22 Apr 27, 2022
c7bc30b
Set NewestShadowNodeRegistry
piaskowyk Apr 27, 2022
044fc19
Move initialization from `initHybrid` to constructor
tomekzaw Apr 27, 2022
f7d17ed
Call `removeEventListener` on Android
tomekzaw Apr 27, 2022
1be47df
Merge branch '@graszka22/fix-onscroll-fast-refresh' into fabric
tomekzaw Apr 27, 2022
0f81a5a
Resolve conflicts
piaskowyk Apr 28, 2022
41956a2
Merge
piaskowyk Apr 28, 2022
46fba26
Add `react-native-gesture-handler`
tomekzaw Apr 28, 2022
94d3e45
Fix runtime warnings related to calling UI API not from main thread
tomekzaw Apr 28, 2022
600a69d
Update `ScreenStackHeaderConfigExample`
tomekzaw Apr 28, 2022
6c338c6
Run `yarn react-native init FabricExample --version 0.69.0-rc.0`
tomekzaw Apr 28, 2022
9a8f37a
Update JS and iOS
piaskowyk Apr 29, 2022
1c8cf66
Bump FabricExample to 0.69.0-rc.0
tomekzaw Apr 29, 2022
61297f8
Update Android updateProps
piaskowyk Apr 29, 2022
36d74cf
Merge branch 'fabric' of github.com:software-mansion/react-native-rea…
piaskowyk Apr 29, 2022
cb64df0
Merge branch '@tomekzaw/FabricExample' into fabric
tomekzaw Apr 29, 2022
15bde30
Merge branch 'fabric' of https://github.com/software-mansion/react-na…
tomekzaw Apr 29, 2022
5e42d8a
Start with measure and scrollTo
piaskowyk Apr 29, 2022
fd7cb3d
Restore `react-native-screens` on Android
tomekzaw Apr 29, 2022
ccf3e1b
Restore `react-native-screens` on iOS
tomekzaw Apr 30, 2022
2e5ae32
Add animated text width example
tomekzaw Apr 30, 2022
ffc3c3d
Improve Gesture Handler example
tomekzaw Apr 30, 2022
dcc2fae
Add assert
tomekzaw May 1, 2022
8da1b8d
Add `RCT_NEW_ARCH_ENABLED` flag in CMakeLists.txt
tomekzaw May 2, 2022
425c75d
Update plugin
piaskowyk May 4, 2022
0f390df
Merge
piaskowyk May 4, 2022
890c112
Compiltion for Paper
piaskowyk May 4, 2022
d0d65bd
Add UI thread check in event listener on iOS
tomekzaw May 5, 2022
1c5c213
Add missing return (thx Wojtek)
tomekzaw May 5, 2022
abdc18e
Add `useJSThreadKiller` hook
tomekzaw May 5, 2022
7eb7d3a
Bump version
tomekzaw May 5, 2022
f92fdca
Add comment
tomekzaw May 5, 2022
5a541bf
Remove unused `uiManagerValue`
tomekzaw May 5, 2022
ed7e659
Add `_IS_FABRIC` flag on Android
tomekzaw May 5, 2022
494eb1c
Bump dependencies
tomekzaw May 5, 2022
97b5787
Fix TypeScript errors
tomekzaw May 5, 2022
b39f6e9
Update Podfile.lock
tomekzaw May 5, 2022
75575f1
Move `asObject` outside the loop
tomekzaw May 5, 2022
8c62321
Fix example names
tomekzaw May 5, 2022
463bdb2
Move `View` component to `Screen`
tomekzaw May 5, 2022
29522ff
Update ios/REANodesManager.mm
tomekzaw May 5, 2022
691004c
Split `_updateProps` into `_updatePropsPaper` and `_updatePropsFabric`
tomekzaw May 5, 2022
65de4ad
Reorder functions
tomekzaw May 5, 2022
fd38859
Add `#ifdef RCT_NEW_ARCH_ENABLED` in Fabric-only sources
tomekzaw May 5, 2022
30043c9
Add `#ifdef` for `dispatchCommand` function
tomekzaw May 5, 2022
c08799f
Minor TS improvements
tomekzaw May 5, 2022
e97c7f9
Remove from package.json
tomekzaw May 5, 2022
a698241
Remove TODO
tomekzaw May 5, 2022
b13d5c4
Restore `_scrollTo` in global
tomekzaw May 5, 2022
ed8ce0f
iOS works
piaskowyk May 6, 2022
c7e82d8
Merge
piaskowyk May 6, 2022
235b1d9
UpdateProps definition for Paper
piaskowyk May 6, 2022
5c17b5c
Fix example names vol. 2
tomekzaw May 6, 2022
78711e5
Move `ShadowNodeWrapper` type to other `commonTypes.ts`
tomekzaw May 6, 2022
a9bc72d
Update tsconfig.json
tomekzaw May 6, 2022
550a484
Remove TODO
tomekzaw May 6, 2022
2d43f62
Remove comment
tomekzaw May 6, 2022
56f72ca
Reorder method names in warning message
tomekzaw May 6, 2022
509f310
Layout props on Paper
piaskowyk May 6, 2022
6613d0a
Merge branch 'fabric' of github.com:software-mansion/react-native-rea…
piaskowyk May 6, 2022
a87f17b
Add `fabric_enabled` in Podspec
tomekzaw May 6, 2022
8449eb6
Merge branch 'fabric' of https://github.com/software-mansion/react-na…
tomekzaw May 6, 2022
4f92ba5
Fix circular dependency
tomekzaw May 6, 2022
466c6bc
Trigger CI
tomekzaw May 6, 2022
7863705
Trigger CI again
tomekzaw May 6, 2022
b68b4c2
Trigger CI again and again
tomekzaw May 6, 2022
a449e4f
Fix ESLint and Prettier errors
tomekzaw May 6, 2022
d967696
FabricUIManager Events
piaskowyk May 6, 2022
5f57380
Fabric + Paper on Android (#3223)
piaskowyk May 7, 2022
e49e1ab
Update CMake
piaskowyk May 7, 2022
096e1f8
Layout Animation for iOS
piaskowyk May 9, 2022
482e591
Fix cpplint errors
tomekzaw May 9, 2022
1d8e337
Add ifdefs for `configureProps`
tomekzaw May 9, 2022
b2867d9
Remove explicit config for building Reanimated in FabricExample from …
tomekzaw May 9, 2022
7c927e3
Eliminate code repetition while making linter happy
tomekzaw May 9, 2022
7cae530
Fix Java linter
tomekzaw May 9, 2022
e91bb84
Merge branch 'fabric' of github.com:software-mansion/react-native-rea…
piaskowyk May 9, 2022
75c6b1a
Paper+Fabric Improvements
piaskowyk May 9, 2022
4cdade4
Improve ifdefs
tomekzaw May 9, 2022
f6b427d
Temporarily comment out `useJSThreadKiller`
tomekzaw May 9, 2022
66ac8b9
CMake+Gradle update v1
piaskowyk May 9, 2022
1e044f4
Merge branch 'fabric' of github.com:software-mansion/react-native-rea…
piaskowyk May 9, 2022
976f777
Gradle def variable
piaskowyk May 9, 2022
20270a8
Revert
piaskowyk May 9, 2022
35a9c64
Task ordef for Fabric
piaskowyk May 9, 2022
3d64c47
Add missing include for JSC
piaskowyk May 9, 2022
8f87e26
Fix ts check
graszka22 May 9, 2022
fbb8354
Remove unnecessary `#pragma once`
tomekzaw May 9, 2022
4cfe61e
Reorder field initialization
tomekzaw May 9, 2022
101b41f
Add newlines
tomekzaw May 9, 2022
6301cb0
Add min distance
tomekzaw May 9, 2022
59397c2
Rename file to `fabricUtils.ts`
tomekzaw May 9, 2022
5d43a04
Rename `shareableNode` to `shadowNodeWrapper`
tomekzaw May 9, 2022
960de70
Remove duplicated import
tomekzaw May 9, 2022
e6f940b
Schedule calling `dropAllGestureHandlers on main queue` from software…
tomekzaw May 9, 2022
8a1b52b
Uncomment `RCTLogError` call
tomekzaw May 9, 2022
79352a1
Minor improvements in `NativeProxy.mm`
tomekzaw May 9, 2022
1881606
Fix linking folly for React Native 0.68 on Android
tomekzaw May 10, 2022
54716ef
Fix error "Duplicate class com.facebook.jni.CppException" when buildi…
tomekzaw May 10, 2022
b236434
Clean up Gradle
piaskowyk May 10, 2022
f17b54c
Merge
piaskowyk May 10, 2022
31aa96d
Merge branch 'main' into @piaskowyk/rip-rea-1
tomekzaw May 10, 2022
b9980e1
Remove rea1 type
piaskowyk May 10, 2022
b1ac95c
Merge branch '@piaskowyk/rip-rea-1' into @tomekzaw/FabricExample
tomekzaw May 10, 2022
e2e800e
Merge branch '@tomekzaw/FabricExample' into fabric
tomekzaw May 10, 2022
938249e
Propagate `_WORKLET_RUNTIME` change to `REAModule.mm`
tomekzaw May 10, 2022
cb2a112
Merge branch 'fabric' into @graszka22/fix-ts-check
graszka22 May 10, 2022
b23891e
Code style improvements
tomekzaw May 10, 2022
740bcc3
Move `UpdatePropsFunction` somewhere else
tomekzaw May 10, 2022
5b2aeb0
Add newline and comment
tomekzaw May 10, 2022
d88d5d0
Add ifdef
tomekzaw May 10, 2022
5e8897a
Minor improvements
tomekzaw May 10, 2022
5783cf3
Update RNReanimated.podspec
tomekzaw May 10, 2022
6dd55d0
Update build.gradle
tomekzaw May 10, 2022
9fa10df
Update CMakeLists.txt
tomekzaw May 10, 2022
72b8011
Update build.gradle
tomekzaw May 10, 2022
e658041
Update NativeProxy.java
tomekzaw May 10, 2022
7b31c85
Move implementation
tomekzaw May 10, 2022
3ecde21
Move `castReadableMap` to ifdef
tomekzaw May 10, 2022
8c095df
Remove redundant `_IS_FABRIC` assignment
tomekzaw May 10, 2022
caf3d83
Minor changes
tomekzaw May 10, 2022
0848a21
Remove unnecessary stuff
tomekzaw May 10, 2022
252f0c3
Add lint:js script
graszka22 May 10, 2022
5b37790
Move import
tomekzaw May 10, 2022
41397c5
Add ifdef
tomekzaw May 10, 2022
4c7d1f2
Minor improvements
tomekzaw May 10, 2022
979091d
Improve ifdefs
tomekzaw May 10, 2022
d9b23d5
Remove unnecessary import
tomekzaw May 10, 2022
853833c
Minor improvements
tomekzaw May 10, 2022
4a890c9
Improve imports
tomekzaw May 10, 2022
c74e2a4
Update Podfile.lock
tomekzaw May 10, 2022
93aa424
Merge branch '@graszka22/add-lintjs' into fabric
tomekzaw May 10, 2022
271065b
Merge branch '@graszka22/fix-ts-check' into fabric
tomekzaw May 10, 2022
1fa470c
Update version
tomekzaw May 10, 2022
4dcd091
Remove Reanimated 1 stuff
tomekzaw May 10, 2022
3d12d77
Outstanding move suggested by @piaskowyk
tomekzaw May 10, 2022
4d9bffb
Remove comment
tomekzaw May 10, 2022
b615eb5
Add `overflow: hidden` in examples
tomekzaw May 10, 2022
93ee963
Improve FabricExample app
tomekzaw May 10, 2022
89ee77b
Improve examples
tomekzaw May 10, 2022
0a2c348
Add bouncing box example
tomekzaw May 10, 2022
79186e6
Minor improvements
tomekzaw May 10, 2022
3185a7e
Minor improvements
tomekzaw May 10, 2022
921647c
Minor improvements
tomekzaw May 10, 2022
80615b6
Minor improvements
tomekzaw May 10, 2022
bf0d564
Minor improvements
tomekzaw May 10, 2022
c7811ad
Minor improvements
tomekzaw May 10, 2022
3a6370d
Minor improvements
tomekzaw May 10, 2022
5ff4754
Move `configureProps` to ifdef
tomekzaw May 10, 2022
afb33f7
Restore propObtainer on Android and iOS
tomekzaw May 10, 2022
e9d1ce3
Don't override UIResponder on Fabric
tomekzaw May 10, 2022
fd11bfe
Move `enqueueUpdateViewOnNativeThread` to ifdef
tomekzaw May 10, 2022
226ef81
Minor improvements
tomekzaw May 10, 2022
0598eaa
Reorder methods
tomekzaw May 10, 2022
57921a8
Restore excluding `libreact_render*.so`
tomekzaw May 11, 2022
c052541
Merge branch 'main' into @piaskowyk/rip-rea-1
tomekzaw May 11, 2022
d9bd106
Merge branch '@piaskowyk/rip-rea-1' into @tomekzaw/FabricExample
tomekzaw May 11, 2022
1b3d967
Merge branch '@tomekzaw/FabricExample' into fabric
tomekzaw May 11, 2022
0b65c26
Improve FabricExample app
tomekzaw May 11, 2022
451b657
Fix linter
tomekzaw May 11, 2022
d30210d
Remove unnecessary ESLint directive
tomekzaw May 11, 2022
0332fae
Add missing `--noEmit` in Example app
tomekzaw May 11, 2022
b783fa4
Update prettier.config.js
tomekzaw May 11, 2022
e6104f2
Remove `postRunUpdatesAfterAnimation`
tomekzaw May 11, 2022
67be080
Merge branch '@piaskowyk/rip-rea-1' into @tomekzaw/FabricExample
tomekzaw May 11, 2022
b032755
Merge branch '@tomekzaw/FabricExample' into fabric
tomekzaw May 11, 2022
0bf8c9f
Fix linter in Example app
tomekzaw May 11, 2022
f974fa5
Fix build gradle for RN66
piaskowyk May 11, 2022
6459bf0
Add missing task order in Gradle
piaskowyk May 11, 2022
b675801
Fix TypeScript config
tomekzaw May 11, 2022
d464f5b
Merge branch 'fabric' of https://github.com/software-mansion/react-na…
tomekzaw May 11, 2022
498ffeb
Merge branch 'main' into fabric
tomekzaw May 11, 2022
6e14e9d
Remove unnecessary files
tomekzaw May 11, 2022
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
11 changes: 5 additions & 6 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Test Android build
on:
pull_request:
branches:
- main
paths:
- 'android/**'
- 'Common/**'
Expand All @@ -12,8 +10,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: Example
strategy:
matrix:
working-directory: [Example, FabricExample]
Comment on lines +13 to +15
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes in workflows should be moved to a separate PR.

concurrency:
group: android-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -41,8 +40,8 @@ jobs:
- name: Install root node dependencies
run: yarn
- name: Install example app node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
working-directory: ${{ matrix.working-directory }}
run: yarn
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}/android
working-directory: ${{ matrix.working-directory }}/android
run: ./gradlew assembleDebug --console=plain
2 changes: 0 additions & 2 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Test docs build

on:
pull_request:
branches:
- main
paths:
- 'docs/**'

Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/ios-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Test iOS build
on:
pull_request:
branches:
- main
paths:
- 'ios/**'
- 'Common/**'
Expand All @@ -13,8 +11,9 @@ jobs:
build:
# runs-on: macos-latest // issue: https://github.com/actions/virtual-environments/issues/4060
runs-on: macos-11
env:
WORKING_DIRECTORY: Example
strategy:
matrix:
working-directory: [Example, FabricExample]
concurrency:
group: ios-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -29,11 +28,11 @@ jobs:
- name: Install Reanimated node dependencies
run: yarn
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
working-directory: ${{ matrix.working-directory }}
run: yarn
- name: Install pods
working-directory: ${{ env.WORKING_DIRECTORY }}/ios
working-directory: ${{ matrix.working-directory }}/ios
run: pod install
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
working-directory: ${{ matrix.working-directory }}
run: npx react-native run-ios
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Test Example App TypeScript and Lint
name: Test TypeScript and Lint
on:
pull_request:
branches:
- main
paths:
- 'Example/**'
- 'FabricExample/**'
push:
branches:
- main
jobs:
check:
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: Example
strategy:
matrix:
working-directory: [Example, FabricExample]
concurrency:
group: static-example-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -26,12 +26,12 @@ jobs:
cache: 'yarn'
- name: Install root node dependencies
run: yarn
- name: Install example app node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: Install ${{ matrix.working-directory }} app node dependencies
working-directory: ${{ matrix.working-directory }}
run: yarn
- name: Check types
working-directory: ${{ env.WORKING_DIRECTORY }}
working-directory: ${{ matrix.working-directory }}
run: yarn tsc --noEmit
- name: Lint
working-directory: ${{ env.WORKING_DIRECTORY }}
working-directory: ${{ matrix.working-directory }}
run: yarn lint:js
2 changes: 0 additions & 2 deletions .github/workflows/static-root-checks.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Test TypeScript and Lint
on:
pull_request:
branches:
- main
paths:
- 'src/**'
- '*'
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/tv-os-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Test tvOS build
on:
pull_request:
branches:
- main
paths:
- 'ios/**'
- 'Common/**'
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/validate-java.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Java Lint
on:
pull_request:
branches:
- main
paths:
- 'android/src/main/java/**'
push:
Expand Down
128 changes: 128 additions & 0 deletions Common/cpp/Fabric/FabricUtils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#ifdef RCT_NEW_ARCH_ENABLED

#include "FabricUtils.h"

#include <react/renderer/uimanager/UIManagerBinding.h>

using namespace facebook::react;

namespace reanimated {

#ifdef ANDROID
RuntimeExecutor getRuntimeExecutorFromBinding(Binding *binding) {
BindingPublic *bindingPublic = reinterpret_cast<BindingPublic *>(binding);
SchedulerPublic *schedulerPublic =
reinterpret_cast<SchedulerPublic *>((bindingPublic->scheduler_).get());
return schedulerPublic->runtimeExecutor_;
}
#endif

inline static const UIManagerPublic *getUIManagerPublic(
const UIManager *uiManager) {
return reinterpret_cast<const UIManagerPublic *>(uiManager);
}

std::shared_ptr<const ContextContainer> getContextContainerFromUIManager(
const UIManager *uiManager) {
return getUIManagerPublic(uiManager)->contextContainer_;
}

inline static UIManagerDelegate *getDelegateFromUIManager(
const UIManager *uiManager) {
return getUIManagerPublic(uiManager)->delegate_;
}

void UIManager_dispatchCommand(
const std::shared_ptr<UIManager> &uiManager,
const ShadowNode::Shared &shadowNode,
std::string const &commandName,
folly::dynamic const &args) {
auto delegate_ = getDelegateFromUIManager(&*uiManager);

// copied from UIManager.cpp
if (delegate_) {
delegate_->uiManagerDidDispatchCommand(shadowNode, commandName, args);
}
}

LayoutMetrics UIManager_getRelativeLayoutMetrics(
const std::shared_ptr<UIManager> &uiManager,
ShadowNode const &shadowNode,
ShadowNode const *ancestorShadowNode,
LayoutableShadowNode::LayoutInspectingPolicy policy) {
// based on implementation from UIManager.cpp
const auto &shadowTreeRegistry = uiManager->getShadowTreeRegistry();

// We might store here an owning pointer to `ancestorShadowNode` to ensure
// that the node is not deallocated during method execution lifetime.
auto owningAncestorShadowNode = ShadowNode::Shared{};

if (!ancestorShadowNode) {
shadowTreeRegistry.visit(
shadowNode.getSurfaceId(), [&](ShadowTree const &shadowTree) {
owningAncestorShadowNode =
shadowTree.getCurrentRevision().rootShadowNode;
ancestorShadowNode = owningAncestorShadowNode.get();
});
} else {
// It is possible for JavaScript (or other callers) to have a reference
// to a previous version of ShadowNodes, but we enforce that
// metrics are only calculated on most recently committed versions.
owningAncestorShadowNode =
uiManager->getNewestCloneOfShadowNode(*ancestorShadowNode);
ancestorShadowNode = owningAncestorShadowNode.get();
}

auto layoutableAncestorShadowNode =
traitCast<LayoutableShadowNode const *>(ancestorShadowNode);

if (!layoutableAncestorShadowNode) {
return EmptyLayoutMetrics;
}

return LayoutableShadowNode::computeRelativeLayoutMetrics(
shadowNode.getFamily(), *layoutableAncestorShadowNode, policy);
}

SharedShadowNode UIManager_cloneNode(
const UIManager *uiManager,
const ShadowNode::Shared &shadowNode,
const SharedShadowNodeSharedList &children,
const RawProps *rawProps) {
auto delegate_ = getDelegateFromUIManager(uiManager);
auto contextContainer_ = getContextContainerFromUIManager(uiManager);

// copied from UIManager.cpp
PropsParserContext propsParserContext{
shadowNode->getFamily().getSurfaceId(), *contextContainer_.get()};

auto &componentDescriptor = shadowNode->getComponentDescriptor();
auto clonedShadowNode = componentDescriptor.cloneShadowNode(
*shadowNode,
{
/* .props = */
rawProps ? componentDescriptor.cloneProps(
propsParserContext, shadowNode->getProps(), *rawProps)
: ShadowNodeFragment::propsPlaceholder(),
/* .children = */ children,
});

if (delegate_) {
delegate_->uiManagerDidCloneShadowNode(
*shadowNode.get(), *clonedShadowNode);
}

return clonedShadowNode;
}

void UIManager_appendChild(
const ShadowNode::Shared &parentShadowNode,
const ShadowNode::Shared &childShadowNode) {
// copied from UIManager.cpp
auto &componentDescriptor = parentShadowNode->getComponentDescriptor();
componentDescriptor.appendChild(parentShadowNode, childShadowNode);
}

} // namespace reanimated

#endif // RCT_NEW_ARCH_ENABLED
Loading