Less Catalyst, more React

Summary:
Catalyst is the old project name. Rename a few files.

public

Reviewed By: bestander

Differential Revision: D2859553

fb-gh-sync-id: 65a87cc7bcc22f20326971becec02aa1c573e5b9
This commit is contained in:
Martin Konicek 2016-01-25 05:55:06 -08:00 committed by facebook-github-bot-9
parent 481f560f64
commit c95d74ac09
30 changed files with 112 additions and 112 deletions

View File

@ -18,7 +18,7 @@ import com.facebook.react.bridge.JSCJavaScriptExecutor;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.NativeModuleRegistry;
import com.facebook.react.bridge.JavaScriptModulesConfig;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec;
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.android.internal.util.Predicate;
@ -38,7 +38,7 @@ public class ReactTestHelper {
public CatalystInstanceImpl build() {
CatalystInstanceImpl instance = mTestCase.new ReactTestInstanceBuilder()
.setCatalystQueueConfigurationSpec(CatalystQueueConfigurationSpec.createDefault())
.setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault())
.setJSExecutor(new JSCJavaScriptExecutor())
.setRegistry(mNativeModuleRegistryBuilder.build())
.setJSModulesConfig(mJSModulesConfigBuilder.build())

View File

@ -46,7 +46,7 @@ import com.facebook.react.bridge.ReactMarker;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.WritableNativeMap;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec;
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.facebook.react.common.ApplicationHolder;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.VisibleForTesting;
@ -711,7 +711,7 @@ import com.facebook.systrace.Systrace;
? mNativeModuleCallExceptionHandler
: mDevSupportManager;
CatalystInstanceImpl.Builder catalystInstanceBuilder = new CatalystInstanceImpl.Builder()
.setCatalystQueueConfigurationSpec(CatalystQueueConfigurationSpec.createDefault())
.setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault())
.setJSExecutor(jsExecutor)
.setRegistry(nativeModuleRegistry)
.setJSModulesConfig(javaScriptModulesConfig)

View File

@ -11,7 +11,7 @@ package com.facebook.react.bridge;
import java.util.Collection;
import com.facebook.react.bridge.queue.CatalystQueueConfiguration;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.annotations.VisibleForTesting;
@ -29,7 +29,7 @@ public interface CatalystInstance {
@DoNotStrip
void invokeCallback(final int callbackID, final NativeArray arguments);
/**
* Destroys this catalyst instance, waiting for any other threads in CatalystQueueConfiguration
* Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration
* (besides the UI thread) to finish running. Must be called from the UI thread so that we can
* fully shut down other threads.
*/
@ -42,7 +42,7 @@ public interface CatalystInstance {
@VisibleForTesting
void initialize();
CatalystQueueConfiguration getCatalystQueueConfiguration();
ReactQueueConfiguration getReactQueueConfiguration();
<T extends JavaScriptModule> T getJSModule(Class<T> jsInterface);
<T extends NativeModule> T getNativeModule(Class<T> nativeModuleInterface);

View File

@ -21,9 +21,9 @@ import java.util.concurrent.atomic.AtomicInteger;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.queue.CatalystQueueConfiguration;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationImpl;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.bridge.queue.ReactQueueConfigurationImpl;
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.facebook.react.bridge.queue.QueueThreadExceptionHandler;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.VisibleForTesting;
@ -43,7 +43,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
private static final AtomicInteger sNextInstanceIdForTrace = new AtomicInteger(1);
// Access from any thread
private final CatalystQueueConfigurationImpl mCatalystQueueConfiguration;
private final ReactQueueConfigurationImpl mReactQueueConfiguration;
private final CopyOnWriteArrayList<NotThreadSafeBridgeIdleDebugListener> mBridgeIdleListeners;
private final AtomicInteger mPendingJSCalls = new AtomicInteger(0);
private final String mJsPendingCallsTitleForTrace =
@ -64,14 +64,14 @@ public class CatalystInstanceImpl implements CatalystInstance {
private boolean mJSBundleHasLoaded;
private CatalystInstanceImpl(
final CatalystQueueConfigurationSpec catalystQueueConfigurationSpec,
final ReactQueueConfigurationSpec ReactQueueConfigurationSpec,
final JavaScriptExecutor jsExecutor,
final NativeModuleRegistry registry,
final JavaScriptModulesConfig jsModulesConfig,
final JSBundleLoader jsBundleLoader,
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
mCatalystQueueConfiguration = CatalystQueueConfigurationImpl.create(
catalystQueueConfigurationSpec,
mReactQueueConfiguration = ReactQueueConfigurationImpl.create(
ReactQueueConfigurationSpec,
new NativeExceptionHandler());
mBridgeIdleListeners = new CopyOnWriteArrayList<>();
mJavaRegistry = registry;
@ -81,7 +81,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
mTraceListener = new JSProfilerTraceListener();
try {
mBridge = mCatalystQueueConfiguration.getJSQueueThread().callOnQueue(
mBridge = mReactQueueConfiguration.getJSQueueThread().callOnQueue(
new Callable<ReactBridge>() {
@Override
public ReactBridge call() throws Exception {
@ -101,7 +101,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
private ReactBridge initializeBridge(
JavaScriptExecutor jsExecutor,
JavaScriptModulesConfig jsModulesConfig) {
mCatalystQueueConfiguration.getJSQueueThread().assertIsOnThread();
mReactQueueConfiguration.getJSQueueThread().assertIsOnThread();
Assertions.assertCondition(mBridge == null, "initializeBridge should be called once");
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactBridgeCtor");
@ -110,7 +110,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
bridge = new ReactBridge(
jsExecutor,
new NativeModulesReactCallback(),
mCatalystQueueConfiguration.getNativeModulesQueueThread());
mReactQueueConfiguration.getNativeModulesQueueThread());
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
}
@ -133,7 +133,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
@Override
public void runJSBundle() {
try {
mJSBundleHasLoaded = mCatalystQueueConfiguration.getJSQueueThread().callOnQueue(
mJSBundleHasLoaded = mReactQueueConfiguration.getJSQueueThread().callOnQueue(
new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
@ -179,11 +179,11 @@ public class CatalystInstanceImpl implements CatalystInstance {
tracingName,
traceID);
mCatalystQueueConfiguration.getJSQueueThread().runOnQueue(
mReactQueueConfiguration.getJSQueueThread().runOnQueue(
new Runnable() {
@Override
public void run() {
mCatalystQueueConfiguration.getJSQueueThread().assertIsOnThread();
mReactQueueConfiguration.getJSQueueThread().assertIsOnThread();
Systrace.endAsyncFlow(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
@ -222,11 +222,11 @@ public class CatalystInstanceImpl implements CatalystInstance {
"<callback>",
traceID);
mCatalystQueueConfiguration.getJSQueueThread().runOnQueue(
mReactQueueConfiguration.getJSQueueThread().runOnQueue(
new Runnable() {
@Override
public void run() {
mCatalystQueueConfiguration.getJSQueueThread().assertIsOnThread();
mReactQueueConfiguration.getJSQueueThread().assertIsOnThread();
Systrace.endAsyncFlow(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
@ -248,7 +248,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
}
/**
* Destroys this catalyst instance, waiting for any other threads in CatalystQueueConfiguration
* Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration
* (besides the UI thread) to finish running. Must be called from the UI thread so that we can
* fully shut down other threads.
*/
@ -263,7 +263,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
// TODO: tell all APIs to shut down
mDestroyed = true;
mJavaRegistry.notifyCatalystInstanceDestroy();
mCatalystQueueConfiguration.destroy();
mReactQueueConfiguration.destroy();
boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
if (!wasIdle && !mBridgeIdleListeners.isEmpty()) {
for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
@ -274,7 +274,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
Systrace.unregisterListener(mTraceListener);
// We can access the Bridge from any thread now because we know either we are on the JS thread
// or the JS thread has finished via CatalystQueueConfiguration#destroy()
// or the JS thread has finished via ReactQueueConfiguration#destroy()
mBridge.dispose();
}
@ -298,8 +298,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
}
@Override
public CatalystQueueConfiguration getCatalystQueueConfiguration() {
return mCatalystQueueConfiguration;
public ReactQueueConfiguration getReactQueueConfiguration() {
return mReactQueueConfiguration;
}
@Override
@ -418,7 +418,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
@Override
public void call(int moduleId, int methodId, ReadableNativeArray parameters) {
mCatalystQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread();
mReactQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread();
// Suppress any callbacks if destroyed - will only lead to sadness.
if (mDestroyed) {
@ -430,7 +430,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
@Override
public void onBatchComplete() {
mCatalystQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread();
mReactQueueConfiguration.getNativeModulesQueueThread().assertIsOnThread();
// The bridge may have been destroyed due to an exception during the batch. In that case
// native modules could be in a bad state so we don't want to call anything on them. We
@ -457,7 +457,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
// framework/native code, it was triggered by JS and theoretically since we were able
// to set up the bridge, JS could change its logic, reload, and not trigger that crash.
mNativeModuleCallExceptionHandler.handleException(e);
mCatalystQueueConfiguration.getUIQueueThread().runOnQueue(
mReactQueueConfiguration.getUIQueueThread().runOnQueue(
new Runnable() {
@Override
public void run() {
@ -481,16 +481,16 @@ public class CatalystInstanceImpl implements CatalystInstance {
public static class Builder {
private @Nullable CatalystQueueConfigurationSpec mCatalystQueueConfigurationSpec;
private @Nullable ReactQueueConfigurationSpec mReactQueueConfigurationSpec;
private @Nullable JSBundleLoader mJSBundleLoader;
private @Nullable NativeModuleRegistry mRegistry;
private @Nullable JavaScriptModulesConfig mJSModulesConfig;
private @Nullable JavaScriptExecutor mJSExecutor;
private @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;
public Builder setCatalystQueueConfigurationSpec(
CatalystQueueConfigurationSpec catalystQueueConfigurationSpec) {
mCatalystQueueConfigurationSpec = catalystQueueConfigurationSpec;
public Builder setReactQueueConfigurationSpec(
ReactQueueConfigurationSpec ReactQueueConfigurationSpec) {
mReactQueueConfigurationSpec = ReactQueueConfigurationSpec;
return this;
}
@ -522,7 +522,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
public CatalystInstanceImpl build() {
return new CatalystInstanceImpl(
Assertions.assertNotNull(mCatalystQueueConfigurationSpec),
Assertions.assertNotNull(mReactQueueConfigurationSpec),
Assertions.assertNotNull(mJSExecutor),
Assertions.assertNotNull(mRegistry),
Assertions.assertNotNull(mJSModulesConfig),

View File

@ -21,7 +21,7 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.queue.CatalystQueueConfiguration;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.bridge.queue.MessageQueueThread;
/**
@ -60,7 +60,7 @@ public class ReactContext extends ContextWrapper {
mCatalystInstance = catalystInstance;
CatalystQueueConfiguration queueConfig = catalystInstance.getCatalystQueueConfiguration();
ReactQueueConfiguration queueConfig = catalystInstance.getReactQueueConfiguration();
mUiMessageQueueThread = queueConfig.getUIQueueThread();
mNativeModulesMessageQueueThread = queueConfig.getNativeModulesQueueThread();
mJSMessageQueueThread = queueConfig.getJSQueueThread();

View File

@ -18,7 +18,7 @@ package com.facebook.react.bridge.queue;
* Native Modules Queue Thread: The thread and Looper that native modules are invoked on.
* JS Queue Thread: The thread and Looper that JS is executed on.
*/
public interface CatalystQueueConfiguration {
public interface ReactQueueConfiguration {
MessageQueueThread getUIQueueThread();
MessageQueueThread getNativeModulesQueueThread();
MessageQueueThread getJSQueueThread();

View File

@ -15,13 +15,13 @@ import android.os.Looper;
import com.facebook.react.common.MapBuilder;
public class CatalystQueueConfigurationImpl implements CatalystQueueConfiguration {
public class ReactQueueConfigurationImpl implements ReactQueueConfiguration {
private final MessageQueueThreadImpl mUIQueueThread;
private final MessageQueueThreadImpl mNativeModulesQueueThread;
private final MessageQueueThreadImpl mJSQueueThread;
private CatalystQueueConfigurationImpl(
private ReactQueueConfigurationImpl(
MessageQueueThreadImpl uiQueueThread,
MessageQueueThreadImpl nativeModulesQueueThread,
MessageQueueThreadImpl jsQueueThread) {
@ -58,8 +58,8 @@ public class CatalystQueueConfigurationImpl implements CatalystQueueConfiguratio
}
}
public static CatalystQueueConfigurationImpl create(
CatalystQueueConfigurationSpec spec,
public static ReactQueueConfigurationImpl create(
ReactQueueConfigurationSpec spec,
QueueThreadExceptionHandler exceptionHandler) {
Map<MessageQueueThreadSpec, MessageQueueThreadImpl> specsToThreads = MapBuilder.newHashMap();
@ -80,6 +80,6 @@ public class CatalystQueueConfigurationImpl implements CatalystQueueConfiguratio
MessageQueueThreadImpl.create(spec.getNativeModulesQueueThreadSpec(), exceptionHandler);
}
return new CatalystQueueConfigurationImpl(uiThread, nativeModulesThread, jsThread);
return new ReactQueueConfigurationImpl(uiThread, nativeModulesThread, jsThread);
}
}

View File

@ -14,17 +14,17 @@ import javax.annotation.Nullable;
import com.facebook.infer.annotation.Assertions;
/**
* Spec for creating a CatalystQueueConfiguration. This exists so that CatalystInstance is able to
* Spec for creating a ReactQueueConfiguration. This exists so that CatalystInstance is able to
* set Exception handlers on the MessageQueueThreads it uses and it would not be super clean if the
* threads were configured, then passed to CatalystInstance where they are configured more. These
* specs allows the Threads to be created fully configured.
*/
public class CatalystQueueConfigurationSpec {
public class ReactQueueConfigurationSpec {
private final MessageQueueThreadSpec mNativeModulesQueueThreadSpec;
private final MessageQueueThreadSpec mJSQueueThreadSpec;
private CatalystQueueConfigurationSpec(
private ReactQueueConfigurationSpec(
MessageQueueThreadSpec nativeModulesQueueThreadSpec,
MessageQueueThreadSpec jsQueueThreadSpec) {
mNativeModulesQueueThreadSpec = nativeModulesQueueThreadSpec;
@ -43,7 +43,7 @@ public class CatalystQueueConfigurationSpec {
return new Builder();
}
public static CatalystQueueConfigurationSpec createDefault() {
public static ReactQueueConfigurationSpec createDefault() {
return builder()
.setJSQueueThreadSpec(MessageQueueThreadSpec.newBackgroundThreadSpec("js"))
.setNativeModulesQueueThreadSpec(
@ -70,8 +70,8 @@ public class CatalystQueueConfigurationSpec {
return this;
}
public CatalystQueueConfigurationSpec build() {
return new CatalystQueueConfigurationSpec(
public ReactQueueConfigurationSpec build() {
return new ReactQueueConfigurationSpec(
Assertions.assertNotNull(mNativeModulesQueueSpec),
Assertions.assertNotNull(mJSQueueSpec));
}

View File

@ -64,7 +64,7 @@ public class ReactPropertyProcessor extends AbstractProcessor {
private static final Set<TypeName> BOXED_PRIMITIVES;
private static final TypeName PROPS_TYPE =
ClassName.get("com.facebook.react.uimanager", "CatalystStylesDiffMap");
ClassName.get("com.facebook.react.uimanager", "ReactStylesDiffMap");
private static final TypeName STRING_TYPE = TypeName.get(String.class);
private static final TypeName READABLE_MAP_TYPE = TypeName.get(ReadableMap.class);
private static final TypeName READABLE_ARRAY_TYPE = TypeName.get(ReadableArray.class);

View File

@ -18,7 +18,7 @@ import android.view.ViewParent;
/**
* This class coordinates JSResponder commands for {@link UIManagerModule}. It should be set as
* OnInterceptTouchEventListener for all newly created native views that implements
* {@link CatalystInterceptingViewGroup} and thanks to the information whether JSResponder is set
* {@link ReactInterceptingViewGroup} and thanks to the information whether JSResponder is set
* and to which view it will correctly coordinate the return values of
* {@link OnInterceptTouchEventListener} such that touch events will be dispatched to the view
* selected by JS gesture recognizer.

View File

@ -16,7 +16,7 @@ package com.facebook.react.touch;
* which then is used to control touch event flow in cases in which they requested to be intercepted
* by some parent view based on a JS gesture detector.
*/
public interface CatalystInterceptingViewGroup {
public interface ReactInterceptingViewGroup {
/**
* A {@link ViewGroup} instance that implement this interface is responsible for storing the

View File

@ -106,7 +106,7 @@ public class NativeViewHierarchyManager {
mLayoutAnimationEnabled = enabled;
}
public void updateProperties(int tag, CatalystStylesDiffMap props) {
public void updateProperties(int tag, ReactStylesDiffMap props) {
UiThreadUtil.assertOnUiThread();
ViewManager viewManager = resolveViewManager(tag);
@ -190,7 +190,7 @@ public class NativeViewHierarchyManager {
ThemedReactContext themedContext,
int tag,
String className,
@Nullable CatalystStylesDiffMap initialProps) {
@Nullable ReactStylesDiffMap initialProps) {
UiThreadUtil.assertOnUiThread();
SystraceMessage.beginSection(
Systrace.TRACE_TAG_REACT_VIEW,

View File

@ -70,7 +70,7 @@ public class NativeViewHierarchyOptimizer {
public void handleCreateView(
ReactShadowNode node,
ThemedReactContext themedContext,
@Nullable CatalystStylesDiffMap initialProps) {
@Nullable ReactStylesDiffMap initialProps) {
if (!ENABLED) {
int tag = node.getReactTag();
mUIViewOperationQueue.enqueueCreateView(
@ -109,7 +109,7 @@ public class NativeViewHierarchyOptimizer {
public void handleUpdateView(
ReactShadowNode node,
String className,
CatalystStylesDiffMap props) {
ReactStylesDiffMap props) {
if (!ENABLED) {
mUIViewOperationQueue.enqueueUpdateProperties(node.getReactTag(), className, props);
return;
@ -377,7 +377,7 @@ public class NativeViewHierarchyOptimizer {
private void transitionLayoutOnlyViewToNativeView(
ReactShadowNode node,
@Nullable CatalystStylesDiffMap props) {
@Nullable ReactStylesDiffMap props) {
ReactShadowNode parent = node.getParent();
if (parent == null) {
node.setIsLayoutOnly(false);
@ -419,7 +419,7 @@ public class NativeViewHierarchyOptimizer {
mTagsWithLayoutVisited.clear();
}
private static boolean isLayoutOnlyAndCollapsable(@Nullable CatalystStylesDiffMap props) {
private static boolean isLayoutOnlyAndCollapsable(@Nullable ReactStylesDiffMap props) {
if (props == null) {
return true;
}

View File

@ -168,7 +168,7 @@ public class ReactShadowNode extends CSSNode {
public void onBeforeLayout() {
}
public final void updateProperties(CatalystStylesDiffMap props) {
public final void updateProperties(ReactStylesDiffMap props) {
ViewManagerPropertyUpdater.updateProps(this, props);
onAfterUpdateTransaction();
}

View File

@ -34,11 +34,11 @@ import com.facebook.react.bridge.ReadableMap;
* property shouldn't be updated (whereas in all other cases it should be updated to the new value
* or the property should be reset).
*/
public class CatalystStylesDiffMap {
public class ReactStylesDiffMap {
/* package */ final ReadableMap mBackingMap;
public CatalystStylesDiffMap(ReadableMap props) {
public ReactStylesDiffMap(ReadableMap props) {
mBackingMap = props;
}

View File

@ -141,9 +141,9 @@ public class UIImplementation {
mShadowNodeRegistry.addNode(cssNode);
CatalystStylesDiffMap styles = null;
ReactStylesDiffMap styles = null;
if (props != null) {
styles = new CatalystStylesDiffMap(props);
styles = new ReactStylesDiffMap(props);
cssNode.updateProperties(styles);
}
@ -153,7 +153,7 @@ public class UIImplementation {
protected void handleCreateView(
ReactShadowNode cssNode,
int rootViewTag,
@Nullable CatalystStylesDiffMap styles) {
@Nullable ReactStylesDiffMap styles) {
if (!cssNode.isVirtual()) {
mNativeViewHierarchyOptimizer.handleCreateView(cssNode, cssNode.getThemedContext(), styles);
}
@ -173,7 +173,7 @@ public class UIImplementation {
}
if (props != null) {
CatalystStylesDiffMap styles = new CatalystStylesDiffMap(props);
ReactStylesDiffMap styles = new ReactStylesDiffMap(props);
cssNode.updateProperties(styles);
handleUpdateView(cssNode, className, styles);
}
@ -182,7 +182,7 @@ public class UIImplementation {
protected void handleUpdateView(
ReactShadowNode cssNode,
String className,
CatalystStylesDiffMap styles) {
ReactStylesDiffMap styles) {
if (!cssNode.isVirtual()) {
mNativeViewHierarchyOptimizer.handleUpdateView(cssNode, className, styles);
}

View File

@ -78,9 +78,9 @@ public class UIViewOperationQueue {
private final class UpdatePropertiesOperation extends ViewOperation {
private final CatalystStylesDiffMap mProps;
private final ReactStylesDiffMap mProps;
private UpdatePropertiesOperation(int tag, CatalystStylesDiffMap props) {
private UpdatePropertiesOperation(int tag, ReactStylesDiffMap props) {
super(tag);
mProps = props;
}
@ -127,13 +127,13 @@ public class UIViewOperationQueue {
private final ThemedReactContext mThemedContext;
private final String mClassName;
private final @Nullable CatalystStylesDiffMap mInitialProps;
private final @Nullable ReactStylesDiffMap mInitialProps;
public CreateViewOperation(
ThemedReactContext themedContext,
int tag,
String className,
@Nullable CatalystStylesDiffMap initialProps) {
@Nullable ReactStylesDiffMap initialProps) {
super(tag);
mThemedContext = themedContext;
mClassName = className;
@ -567,7 +567,7 @@ public class UIViewOperationQueue {
ThemedReactContext themedContext,
int viewReactTag,
String viewClassName,
@Nullable CatalystStylesDiffMap initialProps) {
@Nullable ReactStylesDiffMap initialProps) {
mOperations.add(
new CreateViewOperation(
themedContext,
@ -576,7 +576,7 @@ public class UIViewOperationQueue {
initialProps));
}
public void enqueueUpdateProperties(int reactTag, String className, CatalystStylesDiffMap props) {
public void enqueueUpdateProperties(int reactTag, String className, ReactStylesDiffMap props) {
mOperations.add(new UpdatePropertiesOperation(reactTag, props));
}

View File

@ -16,7 +16,7 @@ import java.util.Map;
import android.view.View;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.touch.CatalystInterceptingViewGroup;
import com.facebook.react.touch.ReactInterceptingViewGroup;
import com.facebook.react.touch.JSResponderHandler;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.annotations.ReactPropGroup;
@ -30,7 +30,7 @@ import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
@ReactPropertyHolder
public abstract class ViewManager<T extends View, C extends ReactShadowNode> {
public final void updateProperties(T viewToUpdate, CatalystStylesDiffMap props) {
public final void updateProperties(T viewToUpdate, ReactStylesDiffMap props) {
ViewManagerPropertyUpdater.updateProps(this, viewToUpdate, props);
onAfterUpdateTransaction(viewToUpdate);
}
@ -43,8 +43,8 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode> {
JSResponderHandler jsResponderHandler) {
T view = createViewInstance(reactContext);
addEventEmitters(reactContext, view);
if (view instanceof CatalystInterceptingViewGroup) {
((CatalystInterceptingViewGroup) view).setOnInterceptTouchEventListener(jsResponderHandler);
if (view instanceof ReactInterceptingViewGroup) {
((ReactInterceptingViewGroup) view).setOnInterceptTouchEventListener(jsResponderHandler);
}
return view;
}

View File

@ -17,11 +17,11 @@ public class ViewManagerPropertyUpdater {
}
public interface ViewManagerSetter<T extends ViewManager, V extends View> extends Settable {
void setProperty(T manager, V view, String name, CatalystStylesDiffMap props);
void setProperty(T manager, V view, String name, ReactStylesDiffMap props);
}
public interface ShadowNodeSetter<T extends ReactShadowNode> extends Settable {
void setProperty(T node, String name, CatalystStylesDiffMap props);
void setProperty(T node, String name, ReactStylesDiffMap props);
}
private static final String TAG = "ViewManagerPropertyUpdater";
@ -33,7 +33,7 @@ public class ViewManagerPropertyUpdater {
public static <T extends ViewManager, V extends View> void updateProps(
T manager,
V v,
CatalystStylesDiffMap props) {
ReactStylesDiffMap props) {
ViewManagerSetter<T, V> setter = findManagerSetter(manager.getClass());
ReadableMap propMap = props.mBackingMap;
ReadableMapKeySetIterator iterator = propMap.keySetIterator();
@ -43,7 +43,7 @@ public class ViewManagerPropertyUpdater {
}
}
public static <T extends ReactShadowNode> void updateProps(T node, CatalystStylesDiffMap props) {
public static <T extends ReactShadowNode> void updateProps(T node, ReactStylesDiffMap props) {
ShadowNodeSetter<T> setter = findNodeSetter(node.getClass());
ReadableMap propMap = props.mBackingMap;
ReadableMapKeySetIterator iterator = propMap.keySetIterator();
@ -117,7 +117,7 @@ public class ViewManagerPropertyUpdater {
}
@Override
public void setProperty(T manager, V v, String name, CatalystStylesDiffMap props) {
public void setProperty(T manager, V v, String name, ReactStylesDiffMap props) {
ViewManagersPropertyCache.PropSetter setter = mPropSetters.get(name);
if (setter != null) {
setter.updateViewProp(manager, v, props);
@ -144,7 +144,7 @@ public class ViewManagerPropertyUpdater {
}
@Override
public void setProperty(ReactShadowNode node, String name, CatalystStylesDiffMap props) {
public void setProperty(ReactShadowNode node, String name, ReactStylesDiffMap props) {
ViewManagersPropertyCache.PropSetter setter = mPropSetters.get(name);
if (setter != null) {
setter.updateShadowNodeProp(node, props);

View File

@ -69,7 +69,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
public void updateViewProp(
ViewManager viewManager,
View viewToUpdate,
CatalystStylesDiffMap props) {
ReactStylesDiffMap props) {
try {
if (mIndex == null) {
VIEW_MGR_ARGS[0] = viewToUpdate;
@ -92,7 +92,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
public void updateShadowNodeProp(
ReactShadowNode nodeToUpdate,
CatalystStylesDiffMap props) {
ReactStylesDiffMap props) {
try {
if (mIndex == null) {
SHADOW_ARGS[0] = extractProperty(props);
@ -111,7 +111,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
}
protected abstract @Nullable Object extractProperty(CatalystStylesDiffMap props);
protected abstract @Nullable Object extractProperty(ReactStylesDiffMap props);
}
private static class IntPropSetter extends PropSetter {
@ -129,7 +129,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected Object extractProperty(CatalystStylesDiffMap props) {
protected Object extractProperty(ReactStylesDiffMap props) {
return props.getInt(mPropName, mDefaultValue);
}
}
@ -149,7 +149,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected Object extractProperty(CatalystStylesDiffMap props) {
protected Object extractProperty(ReactStylesDiffMap props) {
return props.getDouble(mPropName, mDefaultValue);
}
}
@ -164,7 +164,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected Object extractProperty(CatalystStylesDiffMap props) {
protected Object extractProperty(ReactStylesDiffMap props) {
return props.getBoolean(mPropName, mDefaultValue) ? Boolean.TRUE : Boolean.FALSE;
}
}
@ -184,7 +184,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected Object extractProperty(CatalystStylesDiffMap props) {
protected Object extractProperty(ReactStylesDiffMap props) {
return props.getFloat(mPropName, mDefaultValue);
}
}
@ -196,7 +196,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
return props.getArray(mPropName);
}
}
@ -208,7 +208,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
return props.getMap(mPropName);
}
}
@ -220,7 +220,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
return props.getString(mPropName);
}
}
@ -232,7 +232,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
if (!props.isNull(mPropName)) {
return props.getBoolean(mPropName, /* ignored */ false) ? Boolean.TRUE : Boolean.FALSE;
}
@ -251,7 +251,7 @@ import com.facebook.react.uimanager.annotations.ReactPropGroup;
}
@Override
protected @Nullable Object extractProperty(CatalystStylesDiffMap props) {
protected @Nullable Object extractProperty(ReactStylesDiffMap props) {
if (!props.isNull(mPropName)) {
return props.getInt(mPropName, /* ignored */ 0);
}

View File

@ -11,7 +11,7 @@ package com.facebook.react.views.art;
import android.view.View;
import com.facebook.react.uimanager.CatalystStylesDiffMap;
import com.facebook.react.uimanager.ReactStylesDiffMap;
import com.facebook.react.uimanager.ReactShadowNode;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewManager;

View File

@ -17,7 +17,7 @@ import android.graphics.Paint;
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.CatalystStylesDiffMap;
import com.facebook.react.uimanager.ReactStylesDiffMap;
import com.facebook.react.uimanager.DisplayMetricsHolder;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.ReactShadowNode;

View File

@ -12,7 +12,7 @@ package com.facebook.react.views.art;
import javax.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.CatalystStylesDiffMap;
import com.facebook.react.uimanager.ReactStylesDiffMap;
/**
* Contains static helper methods for accessing props.

View File

@ -10,7 +10,7 @@
package com.facebook.react.views.text;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.uimanager.CatalystStylesDiffMap;
import com.facebook.react.uimanager.ReactStylesDiffMap;
import com.facebook.react.uimanager.ThemedReactContext;
/**

View File

@ -12,7 +12,7 @@ package com.facebook.react.views.view;
import android.graphics.Rect;
import android.view.View;
import com.facebook.react.uimanager.CatalystStylesDiffMap;
import com.facebook.react.uimanager.ReactStylesDiffMap;
/**
* Interface that should be implemented by {@link View} subclasses that support
@ -52,7 +52,7 @@ public interface ReactClippingViewGroup {
*
* Helper method {@link ReactClippingViewGroupHelper#applyRemoveClippedSubviewsProperty} may be
* used by {@link ViewManager} subclass to apply this property based on property update map
* {@link CatalystStylesDiffMap}.
* {@link ReactStylesDiffMap}.
*/
void setRemoveClippedSubviews(boolean removeClippedSubviews);

View File

@ -15,7 +15,7 @@ import android.graphics.Rect;
import android.view.View;
import android.view.ViewParent;
import com.facebook.react.uimanager.CatalystStylesDiffMap;
import com.facebook.react.uimanager.ReactStylesDiffMap;
/**
* Provides implementation of common tasks for view and it's view manager supporting property

View File

@ -315,7 +315,7 @@ import com.facebook.csslayout.Spacing;
}
private int getBorderColor(int position) {
// Check CatalystStylesDiffMap#getColorInt() to see why this is needed
// Check ReactStylesDiffMap#getColorInt() to see why this is needed
return mBorderColor != null ? (int) (long) mBorderColor.get(position) : DEFAULT_BORDER_COLOR;
}
}

View File

@ -23,7 +23,7 @@ import android.view.ViewGroup;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.touch.CatalystInterceptingViewGroup;
import com.facebook.react.touch.ReactInterceptingViewGroup;
import com.facebook.react.touch.OnInterceptTouchEventListener;
import com.facebook.react.uimanager.MeasureSpecAssertions;
import com.facebook.react.uimanager.PointerEvents;
@ -34,7 +34,7 @@ import com.facebook.react.uimanager.ReactPointerEventsView;
* initializes most of the storage needed for them.
*/
public class ReactViewGroup extends ViewGroup implements
CatalystInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView {
ReactInterceptingViewGroup, ReactClippingViewGroup, ReactPointerEventsView {
private static final int ARRAY_CAPACITY_INCREMENT = 12;
private static final int DEFAULT_BACKGROUND_COLOR = Color.TRANSPARENT;

View File

@ -9,9 +9,9 @@
package com.facebook.react.bridge;
import com.facebook.react.bridge.queue.CatalystQueueConfiguration;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationImpl;
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.bridge.queue.ReactQueueConfigurationImpl;
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
import com.facebook.react.bridge.queue.MessageQueueThreadSpec;
import com.facebook.react.bridge.queue.QueueThreadExceptionHandler;
import com.facebook.react.uimanager.UIManagerModule;
@ -38,14 +38,14 @@ public class ReactTestHelper {
}
/**
* @return a CatalystInstance mock that has a default working CatalystQueueConfiguration.
* @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
*/
public static CatalystInstance createMockCatalystInstance() {
CatalystQueueConfigurationSpec spec = CatalystQueueConfigurationSpec.builder()
ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
.setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
.setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
.build();
CatalystQueueConfiguration catalystQueueConfiguration = CatalystQueueConfigurationImpl.create(
ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
spec,
new QueueThreadExceptionHandler() {
@Override
@ -55,7 +55,7 @@ public class ReactTestHelper {
});
CatalystInstance reactInstance = mock(CatalystInstance.class);
when(reactInstance.getCatalystQueueConfiguration()).thenReturn(catalystQueueConfiguration);
when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
when(reactInstance.getNativeModule(UIManagerModule.class))
.thenReturn(mock(UIManagerModule.class));

View File

@ -345,7 +345,7 @@ public class MyCustomViewManager extends SimpleViewManager<MyCustomView> {
}
@Override
public void updateView(MyCustomView view, CatalystStylesDiffMap props) {
public void updateView(MyCustomView view, ReactStylesDiffMap props) {
super.updateView(view, props);
if (props.hasKey(PROP_MY_CUSTOM_PROPERTY)) {