Commit 124ced5
Remove non-bridgeless code paths from
Summary:
Third in a stack that collapses Android-side branches on `ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture()` under the standing assumption that on Android the flag is always `true`. The underlying generated `ReactNativeFeatureFlags.enableBridgelessArchitecture()` is untouched.
This is the cascade cleanup: with every lifecycle method in `ReactDelegate` always taking the `ReactHost` path, the fields, constructors, and helper methods that exist only to support the `ReactNativeHost`/`ReactInstanceManager` (bridge) path are now dead.
Removed from `ReactDelegate`:
- The deprecated 4-arg `(Activity, ReactNativeHost?, String?, Bundle?)` constructor
- The deprecated 5-arg `(Activity, ReactNativeHost?, String?, Bundle?, Boolean)` constructor
- `getReactInstanceManager()` (was reading through the removed `ReactNativeHost`)
- `createRootView()` (only the legacy `loadApp` branch called it)
- `isFabricEnabled` (only `createRootView` read it)
- `internalReactRootView` field and the corresponding `reactRootView` setter (the property is now a `val` returning `reactSurface?.view`)
- The private `reactNativeHost` field
Every public lifecycle method (`onHostResume`, `onUserLeaveHint`, `onHostPause`, `onHostDestroy`, `onBackPressed`, `onNewIntent`, `onActivityResult`, `onWindowFocusChanged`, `onConfigurationChanged`, `onKeyDown`, `onKeyLongPress`, `reload`, `loadApp`, `unloadApp`, `currentReactContext`) collapses to the `ReactHost`-only path.
Removed from `ReactActivityDelegate`:
- `getReactNativeHost()` and `getReactInstanceManager()` (both deprecated, fed the dead `ReactDelegate` machinery)
- `setReactRootView(ReactRootView)` (matched the removed `ReactDelegate.reactRootView` setter)
- The non-bridgeless branch in `onCreate` (the anonymous-subclass override of `createRootView` goes with it)
- The non-bridgeless branch in `onRequestPermissionsResult`
Removed from `ReactActivity`:
- `getReactNativeHost()` and `getReactInstanceManager()` (matched the delegate removals)
Removed from `ReactFragment`:
- The `reactNativeHost` property
- The non-bridgeless branch in `onCreate` (the `ARG_FABRIC_ENABLED` argument is now ignored; the constant + Builder API remain for backward compatibility)
`ReactAndroid.api` regenerated to reflect the 12 removed public/protected methods. `arc f` auto-removed the now-unused `ReactNativeNewArchitectureFeatureFlags` imports.
Subsequent diff in the stack will handle the wrapper method + lint detector.
Changelog:
[Android][Breaking] - Remove deprecated `ReactDelegate(Activity, ReactNativeHost, String, Bundle)` and `ReactDelegate(Activity, ReactNativeHost, String, Bundle, boolean)` constructors. Use the `ReactHost` constructor instead.
[Android][Breaking] - Remove `ReactDelegate.getReactInstanceManager()`, `ReactDelegate.createRootView()`, `ReactDelegate.isFabricEnabled`, and the `ReactDelegate.reactRootView` setter.
[Android][Breaking] - Remove `ReactActivityDelegate.getReactNativeHost()`, `ReactActivityDelegate.getReactInstanceManager()`, and `ReactActivityDelegate.setReactRootView(ReactRootView)`. Use `getReactHost()` and `setReactSurface(ReactSurface)` instead.
[Android][Breaking] - Remove `ReactActivity.getReactNativeHost()` and `ReactActivity.getReactInstanceManager()`. Use `getReactHost()` instead.
[Android][Breaking] - Remove `ReactFragment.reactNativeHost` property. Use `reactHost` instead.
Reviewed By: christophpurrer
Differential Revision: D106719840ReactDelegate / ReactActivityDelegate / ReactActivity / ReactFragment
1 parent d77ccbe commit 124ced5
5 files changed
Lines changed: 47 additions & 402 deletions
File tree
- packages/react-native/ReactAndroid
- api
- src/main/java/com/facebook/react
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
| |||
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
102 | | - | |
103 | | - | |
104 | 100 | | |
105 | 101 | | |
106 | 102 | | |
| |||
119 | 115 | | |
120 | 116 | | |
121 | 117 | | |
122 | | - | |
123 | 118 | | |
124 | 119 | | |
125 | 120 | | |
| |||
130 | 125 | | |
131 | 126 | | |
132 | 127 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 128 | | |
137 | 129 | | |
138 | | - | |
139 | 130 | | |
140 | | - | |
141 | 131 | | |
142 | 132 | | |
143 | 133 | | |
| |||
152 | 142 | | |
153 | 143 | | |
154 | 144 | | |
155 | | - | |
156 | 145 | | |
157 | 146 | | |
158 | 147 | | |
| |||
170 | 159 | | |
171 | 160 | | |
172 | 161 | | |
173 | | - | |
174 | 162 | | |
175 | 163 | | |
176 | 164 | | |
| |||
Lines changed: 0 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 170 | | |
175 | 171 | | |
176 | 172 | | |
177 | 173 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | 174 | | |
183 | 175 | | |
184 | 176 | | |
| |||
Lines changed: 6 additions & 65 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 85 | | |
102 | 86 | | |
103 | 87 | | |
| |||
113 | 97 | | |
114 | 98 | | |
115 | 99 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 100 | | |
127 | 101 | | |
128 | 102 | | |
| |||
144 | 118 | | |
145 | 119 | | |
146 | 120 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
170 | 124 | | |
171 | 125 | | |
172 | 126 | | |
| |||
182 | 136 | | |
183 | 137 | | |
184 | 138 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | 139 | | |
190 | 140 | | |
191 | 141 | | |
| |||
256 | 206 | | |
257 | 207 | | |
258 | 208 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
271 | 212 | | |
272 | 213 | | |
273 | 214 | | |
| |||
0 commit comments