Skip to content

Commit 1719a07

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Delete native UI template (#39487)
Summary: Pull Request resolved: #39487 changelog: [internal] renderTemplateToSurface isn't used, let's remove it. Reviewed By: javache Differential Revision: D49313868 fbshipit-source-id: 9019d5b4adbd23632f27dd61bc18a97b447575d4
1 parent d0f750e commit 1719a07

File tree

21 files changed

+6
-554
lines changed

21 files changed

+6
-554
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,8 +1237,7 @@ private void attachRootViewToInstance(final ReactRoot reactRoot) {
12371237
reactRoot.getRootViewGroup(),
12381238
initialProperties == null
12391239
? new WritableNativeMap()
1240-
: Arguments.fromBundle(initialProperties),
1241-
reactRoot.getInitialUITemplate());
1240+
: Arguments.fromBundle(initialProperties));
12421241
reactRoot.setRootViewTag(rootTag);
12431242
reactRoot.runApplication();
12441243
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public interface ReactRootViewEventListener {
9494
private @Nullable ReactInstanceManager mReactInstanceManager;
9595
private @Nullable String mJSModuleName;
9696
private @Nullable Bundle mAppProperties;
97-
private @Nullable String mInitialUITemplate;
9897
private @Nullable CustomGlobalLayoutListener mCustomGlobalLayoutListener;
9998
private @Nullable ReactRootViewEventListener mRootViewEventListener;
10099
private int mRootViewTag =
@@ -452,14 +451,6 @@ public void startReactApplication(ReactInstanceManager reactInstanceManager, Str
452451
startReactApplication(reactInstanceManager, moduleName, null);
453452
}
454453

455-
/** {@see #startReactApplication(ReactInstanceManager, String, android.os.Bundle, String)} */
456-
public void startReactApplication(
457-
ReactInstanceManager reactInstanceManager,
458-
String moduleName,
459-
@Nullable Bundle initialProperties) {
460-
startReactApplication(reactInstanceManager, moduleName, initialProperties, null);
461-
}
462-
463454
/**
464455
* Schedule rendering of the react component rendered by the JS application from the given JS
465456
* module (@{param moduleName}) using provided {@param reactInstanceManager} to attach to the JS
@@ -470,8 +461,7 @@ public void startReactApplication(
470461
public void startReactApplication(
471462
ReactInstanceManager reactInstanceManager,
472463
String moduleName,
473-
@Nullable Bundle initialProperties,
474-
@Nullable String initialUITemplate) {
464+
@Nullable Bundle initialProperties) {
475465
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "startReactApplication");
476466
try {
477467
UiThreadUtil.assertOnUiThread();
@@ -486,7 +476,6 @@ public void startReactApplication(
486476
mReactInstanceManager = reactInstanceManager;
487477
mJSModuleName = moduleName;
488478
mAppProperties = initialProperties;
489-
mInitialUITemplate = initialUITemplate;
490479

491480
mReactInstanceManager.createReactContextInBackground();
492481
// if in this experiment, we initialize the root earlier in startReactApplication
@@ -651,11 +640,6 @@ public String getJSModuleName() {
651640
return mAppProperties;
652641
}
653642

654-
@Override
655-
public @Nullable String getInitialUITemplate() {
656-
return mInitialUITemplate;
657-
}
658-
659643
@ThreadConfined(UI)
660644
public void setAppProperties(@Nullable Bundle appProperties) {
661645
UiThreadUtil.assertOnUiThread();

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ public interface UIManager extends JSIModule, PerformanceCounter {
2121
@UiThread
2222
@ThreadConfined(UI)
2323
@Deprecated
24-
<T extends View> int addRootView(
25-
final T rootView, WritableMap initialProps, @Nullable String initialUITemplate);
24+
<T extends View> int addRootView(final T rootView, WritableMap initialProps);
2625

2726
/** Registers a new root view with width and height. */
2827
@AnyThread

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public void startSurfaceWithConstraints(
3333
boolean isRTL,
3434
boolean doLeftAndRightSwapInRTL);
3535

36-
public void renderTemplateToSurface(int surfaceId, String uiTemplate);
37-
3836
public void stopSurface(int surfaceId);
3937

4038
public void setPixelDensity(float pointScaleFactor);

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/BindingImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ public native void startSurfaceWithConstraints(
6363
boolean isRTL,
6464
boolean doLeftAndRightSwapInRTL);
6565

66-
@Override
67-
public native void renderTemplateToSurface(int surfaceId, String uiTemplate);
68-
6966
@Override
7067
public native void stopSurface(int surfaceId);
7168

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ public FabricUIManager(
237237
@UiThread
238238
@ThreadConfined(UI)
239239
@Deprecated
240-
public <T extends View> int addRootView(
241-
final T rootView, final WritableMap initialProps, final @Nullable String initialUITemplate) {
240+
public <T extends View> int addRootView(final T rootView, final WritableMap initialProps) {
242241
ReactSoftExceptionLogger.logSoftException(
243242
TAG,
244243
new IllegalViewOperationException(
@@ -256,9 +255,6 @@ public <T extends View> int addRootView(
256255
FLog.d(TAG, "Starting surface for module: %s and reactTag: %d", moduleName, rootTag);
257256
}
258257
mBinding.startSurface(rootTag, moduleName, (NativeMap) initialProps);
259-
if (initialUITemplate != null) {
260-
mBinding.renderTemplateToSurface(rootTag, initialUITemplate);
261-
}
262258
return rootTag;
263259
}
264260

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ public interface ReactRoot {
2525
@Nullable
2626
Bundle getAppProperties();
2727

28-
@Nullable
29-
String getInitialUITemplate();
30-
3128
String getJSModuleName();
3229

3330
/** Fabric or Default UI Manager, see {@link UIManagerType} */

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public Map<String, Long> getPerformanceCounters() {
313313
}
314314

315315
public <T extends View> int addRootView(final T rootView) {
316-
return addRootView(rootView, null, null);
316+
return addRootView(rootView, null);
317317
}
318318

319319
/**
@@ -341,8 +341,7 @@ public void synchronouslyUpdateViewOnUIThread(int tag, ReadableMap props) {
341341
* <p>TODO(6242243): Make addRootView thread safe NB: this method is horribly not-thread-safe.
342342
*/
343343
@Override
344-
public <T extends View> int addRootView(
345-
final T rootView, WritableMap initialProps, @Nullable String initialUITemplate) {
344+
public <T extends View> int addRootView(final T rootView, WritableMap initialProps) {
346345
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIManagerModule.addRootView");
347346
final int tag = ReactRootViewTagGenerator.getNextRootViewTag();
348347
final ReactApplicationContext reactApplicationContext = getReactApplicationContext();

packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ add_react_common_subdir(react/renderer/componentregistry)
7777
add_react_common_subdir(react/renderer/mounting)
7878
add_react_common_subdir(react/renderer/scheduler)
7979
add_react_common_subdir(react/renderer/telemetry)
80-
add_react_common_subdir(react/renderer/templateprocessor)
8180
add_react_common_subdir(react/renderer/uimanager)
8281
add_react_common_subdir(react/renderer/core)
8382
add_react_common_subdir(react/renderer/element)
@@ -164,7 +163,6 @@ add_executable(reactnative_unittest
164163
${REACT_COMMON_DIR}/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp
165164
${REACT_COMMON_DIR}/react/renderer/runtimescheduler/tests/SchedulerPriorityTest.cpp
166165
${REACT_COMMON_DIR}/react/renderer/telemetry/tests/TransactionTelemetryTest.cpp
167-
${REACT_COMMON_DIR}/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp
168166
${REACT_COMMON_DIR}/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp
169167
${REACT_COMMON_DIR}/react/renderer/uimanager/tests/FabricUIManagerTest.cpp
170168

@@ -209,7 +207,6 @@ add_executable(reactnative_unittest
209207
react_render_graphics
210208
react_render_mapbuffer
211209
react_render_mounting
212-
react_render_templateprocessor
213210
react_render_textlayoutmanager
214211
react_render_uimanager
215212
react_utils

packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,6 @@ void Binding::startSurfaceWithConstraints(
219219
mountingManager->onSurfaceStart(surfaceId);
220220
}
221221

222-
void Binding::renderTemplateToSurface(jint surfaceId, jstring uiTemplate) {
223-
SystraceSection s("FabricUIManagerBinding::renderTemplateToSurface");
224-
225-
auto scheduler = getScheduler();
226-
if (!scheduler) {
227-
LOG(ERROR) << "Binding::renderTemplateToSurface: scheduler disappeared";
228-
return;
229-
}
230-
231-
auto env = jni::Environment::current();
232-
const char* nativeString = env->GetStringUTFChars(uiTemplate, JNI_FALSE);
233-
scheduler->renderTemplateToSurface(surfaceId, nativeString);
234-
env->ReleaseStringUTFChars(uiTemplate, nativeString);
235-
}
236-
237222
void Binding::stopSurface(jint surfaceId) {
238223
SystraceSection s("FabricUIManagerBinding::stopSurface");
239224

@@ -581,8 +566,6 @@ void Binding::registerNatives() {
581566
"getInspectorDataForInstance", Binding::getInspectorDataForInstance),
582567
makeNativeMethod(
583568
"startSurfaceWithConstraints", Binding::startSurfaceWithConstraints),
584-
makeNativeMethod(
585-
"renderTemplateToSurface", Binding::renderTemplateToSurface),
586569
makeNativeMethod("stopSurface", Binding::stopSurface),
587570
makeNativeMethod("setConstraints", Binding::setConstraints),
588571
makeNativeMethod("setPixelDensity", Binding::setPixelDensity),

0 commit comments

Comments
 (0)