Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @flow strict-local
*/

import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes';
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
import {type ViewProps as Props} from '../View/ViewPropTypes';
import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
import type {ViewProps} from '../View/ViewPropTypes';

const AndroidHorizontalScrollContentViewNativeComponent: HostComponent<Props> = NativeComponentRegistry.get<Props>(
'AndroidHorizontalScrollContentView',
() => ({
uiViewClassName: 'AndroidHorizontalScrollContentView',
bubblingEventTypes: {},
directEventTypes: {},
validAttributes: {},
}),
);
type NativeProps = $ReadOnly<{|
...ViewProps,
|}>;

export default AndroidHorizontalScrollContentViewNativeComponent;
type NativeType = HostComponent<NativeProps>;

export default (codegenNativeComponent<NativeProps>(
'AndroidHorizontalScrollContentView',
): NativeType);
1 change: 1 addition & 0 deletions Libraries/ReactNative/AppRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const AppRegistry = {
showArchitectureIndicator,
scopedPerformanceLogger,
appKey === 'LogBox',
appKey,
);
},
};
Expand Down
13 changes: 12 additions & 1 deletion Libraries/ReactNative/renderApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ function renderApplication<Props: Object>(
showArchitectureIndicator?: boolean,
scopedPerformanceLogger?: IPerformanceLogger,
isLogBox?: boolean,
debugName?: string,
) {
invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);

const performanceLogger = scopedPerformanceLogger ?? GlobalPerformanceLogger;

const renderable = (
let renderable = (
<PerformanceLoggerContext.Provider value={performanceLogger}>
<AppContainer
rootTag={rootTag}
Expand All @@ -47,6 +48,16 @@ function renderApplication<Props: Object>(
</PerformanceLoggerContext.Provider>
);

if (__DEV__ && debugName) {
const RootComponentWithMeaningfulName = ({children}) => children;
RootComponentWithMeaningfulName.displayName = `${debugName}(RootComponent)`;
renderable = (
<RootComponentWithMeaningfulName>
{renderable}
</RootComponentWithMeaningfulName>
);
}

performanceLogger.startTimespan('renderApplication_React_render');
performanceLogger.setExtra('usedReactFabric', fabric ? '1' : '0');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static inline int getIntBufferSizeForType(CppMountItem::Type mountItemType) {
} else if (mountItemType == CppMountItem::Type::UpdatePadding) {
return 5; // tag, top, left, bottom, right
} else if (mountItemType == CppMountItem::Type::UpdateLayout) {
return 7; // tag, x, y, w, h, layoutDirection, DisplayType
return 6; // tag, x, y, w, h, DisplayType
} else if (mountItemType == CppMountItem::Type::UpdateEventEmitter) {
return 1; // tag
} else {
Expand Down Expand Up @@ -958,8 +958,6 @@ void Binding::schedulerDidFinishTransaction(
int y = round(scale(frame.origin.y, pointScaleFactor));
int w = round(scale(frame.size.width, pointScaleFactor));
int h = round(scale(frame.size.height, pointScaleFactor));
int layoutDirection =
toInt(mountItem.newChildShadowView.layoutMetrics.layoutDirection);
int displayType =
toInt(mountItem.newChildShadowView.layoutMetrics.displayType);

Expand All @@ -968,10 +966,9 @@ void Binding::schedulerDidFinishTransaction(
temp[2] = y;
temp[3] = w;
temp[4] = h;
temp[5] = layoutDirection;
temp[6] = displayType;
env->SetIntArrayRegion(intBufferArray, intBufferPosition, 7, temp);
intBufferPosition += 7;
temp[5] = displayType;
env->SetIntArrayRegion(intBufferArray, intBufferPosition, 6, temp);
intBufferPosition += 6;
}
}
if (cppUpdateEventEmitterMountItems.size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ CoreComponentsRegistry::sharedProviderRegistry() {
concreteComponentDescriptorProvider<SliderComponentDescriptor>());
providerRegistry->add(
concreteComponentDescriptorProvider<ScrollViewComponentDescriptor>());
providerRegistry->add(
concreteComponentDescriptorProvider<
AndroidHorizontalScrollContentViewComponentDescriptor>());
providerRegistry->add(
concreteComponentDescriptorProvider<ParagraphComponentDescriptor>());
providerRegistry->add(concreteComponentDescriptorProvider<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ public void execute(@NonNull MountingManager mountingManager) {
int y = mIntBuffer[i++];
int width = mIntBuffer[i++];
int height = mIntBuffer[i++];
// The final buffer, layoutDirection, seems unused?
i++;
int displayType = mIntBuffer[i++];
surfaceMountingManager.updateLayout(reactTag, x, y, width, height, displayType);

Expand Down Expand Up @@ -232,8 +230,7 @@ public String toString() {
} else if (type == INSTRUCTION_UPDATE_LAYOUT) {
s.append(
String.format(
"UPDATE LAYOUT [%d]: x:%d y:%d w:%d h:%d layoutDirection:%d displayType:%d\n",
mIntBuffer[i++],
"UPDATE LAYOUT [%d]: x:%d y:%d w:%d h:%d displayType:%d\n",
mIntBuffer[i++],
mIntBuffer[i++],
mIntBuffer[i++],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static std::string componentNameByReactViewName(std::string viewName) {
}

// TODO T63839307: remove this condition after deleting TextInlineImage from
// Paper
// non-Fabric code
if (viewName == "TextInlineImage") {
return "Image";
}
Expand All @@ -94,9 +94,8 @@ static std::string componentNameByReactViewName(std::string viewName) {

// We need this temporarily for testing purposes until we have proper
// implementation of core components.
if (viewName == "ScrollContentView" ||
viewName == "AndroidHorizontalScrollContentView" // Android
) {
// iOS-only
if (viewName == "ScrollContentView") {
return "View";
}

Expand Down