Merge commit 'd291a7efdda5997180d1e9bd18d836c1bd2005c5' into 0.68-merge-latest

This commit is contained in:
Adam Gleitman 2022-05-17 16:05:32 -07:00
Родитель 9563cd9318 d291a7efdd
Коммит 0122ef6d92
12 изменённых файлов: 89 добавлений и 68 удалений

Просмотреть файл

@ -105,4 +105,7 @@ public class ReactFeatureFlags {
public static boolean useDispatchUniqueForCoalescableEvents = false;
public static boolean useUpdatedTouchPreprocessing = false;
/** TODO: T103427072 Delete ReactFeatureFlags.enableNestedTextOnPressEventFix */
public static boolean enableNestedTextOnPressEventFix = true;
}

Просмотреть файл

@ -11,8 +11,8 @@ rn_xplat_cxx_library(
],
prefix = "react/fabric",
),
compiler_flags_enable_exceptions = True,
compiler_flags_enable_rtti = True, # dynamic_cast used within Binding.cpp
compiler_flags_enable_exceptions = False,
compiler_flags_enable_rtti = False, # for YogaLayoutableShadowNode?
fbandroid_allow_jni_merging = True,
labels = ["supermodule:xplat/default/public.react_native.infra"],
platforms = ANDROID,

Просмотреть файл

@ -19,6 +19,7 @@ import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
@ -31,6 +32,7 @@ import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.uimanager.PixelUtil;
import com.facebook.react.uimanager.ReactCompoundView;
import com.facebook.react.uimanager.UIManagerModule;
@ -382,6 +384,16 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
return target;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
// The root view always assumes any view that was tapped wants the touch
// and sends the event to JS as such.
// We don't need to do bubbling in native (it's already happening in JS).
// For an explanation of bubbling and capturing, see
// http://javascript.info/tutorial/bubbling-and-capturing#capturing
return ReactFeatureFlags.enableNestedTextOnPressEventFix;
}
@Override
protected boolean verifyDrawable(Drawable drawable) {
if (mContainsImages && getText() instanceof Spanned) {

Просмотреть файл

@ -18,6 +18,8 @@ rn_xplat_cxx_library(
],
prefix = "react/config",
),
compiler_flags_enable_exceptions = True,
compiler_flags_enable_rtti = True, # for ReactNativeConfig
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
force_static = True,

Просмотреть файл

@ -35,6 +35,8 @@ rn_xplat_cxx_library(
],
prefix = "react/renderer/components/view",
),
compiler_flags_enable_exceptions = False,
compiler_flags_enable_rtti = False, # YogaLayoutableShadowNode
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
force_static = True,

Просмотреть файл

@ -32,8 +32,8 @@ rn_xplat_cxx_library(
],
prefix = "react/renderer/core",
),
compiler_flags_enable_exceptions = True,
compiler_flags_enable_rtti = True, # Needed for DebugStringConvertible - need to find a non-RTTI way to do this / enable RTTI for debug builds only
compiler_flags_enable_exceptions = False,
compiler_flags_enable_rtti = False, # Needed for DebugStringConvertible - need to find a non-RTTI way to do this / enable RTTI for debug builds only. Also EventBeat/AsyncEventBeat
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
force_static = True,

Просмотреть файл

@ -17,6 +17,19 @@
namespace facebook {
namespace react {
LayoutableShadowNode::LayoutableShadowNode(
ShadowNodeFragment const &fragment,
ShadowNodeFamily::Shared const &family,
ShadowNodeTraits traits)
: ShadowNode(fragment, family, traits), layoutMetrics_({}) {}
LayoutableShadowNode::LayoutableShadowNode(
ShadowNode const &sourceShadowNode,
ShadowNodeFragment const &fragment)
: ShadowNode(sourceShadowNode, fragment),
layoutMetrics_(static_cast<LayoutableShadowNode const &>(sourceShadowNode)
.layoutMetrics_) {}
LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics(
ShadowNodeFamily const &descendantNodeFamily,
LayoutableShadowNode const &ancestorNode,
@ -118,19 +131,6 @@ LayoutMetrics LayoutableShadowNode::computeRelativeLayoutMetrics(
return layoutMetrics;
}
LayoutableShadowNode::LayoutableShadowNode(
ShadowNodeFragment const &fragment,
ShadowNodeFamily::Shared const &family,
ShadowNodeTraits traits)
: ShadowNode(fragment, family, traits), layoutMetrics_({}) {}
LayoutableShadowNode::LayoutableShadowNode(
ShadowNode const &sourceShadowNode,
ShadowNodeFragment const &fragment)
: ShadowNode(sourceShadowNode, fragment),
layoutMetrics_(static_cast<LayoutableShadowNode const &>(sourceShadowNode)
.layoutMetrics_) {}
ShadowNodeTraits LayoutableShadowNode::BaseTraits() {
auto traits = ShadowNodeTraits{};
traits.set(ShadowNodeTraits::Trait::LayoutableKind);
@ -202,16 +202,6 @@ Float LayoutableShadowNode::lastBaseline(Size size) const {
return 0;
}
void LayoutableShadowNode::layoutTree(
LayoutContext layoutContext,
LayoutConstraints layoutConstraints) {
// Default implementation does nothing.
}
void LayoutableShadowNode::layout(LayoutContext layoutContext) {
// Default implementation does nothing.
}
ShadowNode::Shared LayoutableShadowNode::findNodeAtPoint(
ShadowNode::Shared node,
Point point) {

Просмотреть файл

@ -70,7 +70,7 @@ class LayoutableShadowNode : public ShadowNode {
*/
virtual void layoutTree(
LayoutContext layoutContext,
LayoutConstraints layoutConstraints);
LayoutConstraints layoutConstraints)=0;
/*
* Measures the node (and node content, probably recursively) with
@ -101,7 +101,7 @@ class LayoutableShadowNode : public ShadowNode {
* - Calculate and assign `LayoutMetrics` for the children;
* - Call itself recursively on every child if needed.
*/
virtual void layout(LayoutContext layoutContext);
virtual void layout(LayoutContext layoutContext)=0;
/*
* Returns layout metrics computed during previous layout pass.

Просмотреть файл

@ -31,6 +31,8 @@ rn_xplat_cxx_library(
],
prefix = "react/renderer/debug",
),
compiler_flags_enable_exceptions = True,
compiler_flags_enable_rtti = True, # DebugStringConvertible
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS,
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
force_static = True,

Просмотреть файл

@ -49,11 +49,7 @@ declare var global: {
+requestIdleCallback: typeof requestIdleCallback,
+cancelIdleCallback: typeof cancelIdleCallback,
+setTimeout: typeof setTimeout,
// TODO(T97509743): use `typeof` when the next Flow release is available.
+queueMicrotask: <TArguments: Array<mixed>>(
jobCallback: (...args: TArguments) => mixed,
) => void,
+queueMicrotask: typeof queueMicrotask,
+console: typeof console,
// JavaScript environments specific

Просмотреть файл

@ -550,8 +550,8 @@ SPEC CHECKSUMS:
boost-for-react-native: 8f7c9ecfe357664c072ffbe2432569667cbf1f1b
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: ed15e075aa758ac0e4c1f8b830bd4e4d40d669e8
FBLazyVector: 308a3ef706f08e6f213003c07542f59447984dcc
FBReactNativeSpec: 1476260526eb120de01c102a3136298b0a030c8b
FBLazyVector: 3a7b18a4cdfa125698fa9e7a18e6fba5080dee3d
FBReactNativeSpec: b2bfaf4311b65cf20daddb70367c226b626ec0c3
Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c
@ -566,35 +566,35 @@ SPEC CHECKSUMS:
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCT-Folly: 24c6da766832002a4a2aac5f79ee0ca50fbe8507
RCTRequired: fc7bcf0a5f5d400cfa0cde257e5dfd5fa9efd45e
RCTTypeSafety: d839ccabc7a2935a452e237025a8e5d7c1a6867a
React: cbf5d8c686b951b5fe35fb2f9da42a1a644ae848
React-callinvoker: 1c84ceb891ef1c3ef8f229066a11cf25dee45639
React-Core: 1042dd655750227de3961bb418dec2c83d676fbd
React-CoreModules: 16865f34e990b085a482bd7da0f4b7f143f143e4
React-cxxreact: 09cde1ad31c358bedc5293b4fc943b75e8f32451
React-jsi: d1aa9866c8de29b4177234a0abaeacf07de5100f
React-jsiexecutor: c18b0bce21bb058f9dd071db39e4514f24cd3f4a
React-jsinspector: 609d49a88fae2f6543fd376ddf3f0ec93d7a4f7c
React-logger: 1364dd3faf9ceeab404545369159c71698aafbc2
React-perflogger: 31dabb2eaa8d7b6b816bd9010d726a11e1cfc599
React-RCTActionSheet: db6384dffbd55737ba23ae97f439e7a5ebcb954a
React-RCTAnimation: 82e0272a73d64c99f8f3f6dbcba86ed399964a4c
React-RCTBlob: b3955be675f46dfc5cf976e56f506ada3d9d0bbd
React-RCTImage: 7d32e5014705fd14d2ee658ccdc3c843d7bf5eb4
React-RCTLinking: 18e5545e72e2b65f9227465fbca767a77d67eb60
React-RCTNetwork: ecabfbaf6bbcc27d1edd0e68d85d482557b1fd8c
React-RCTPushNotification: ddfe110b9fac0fd4f194510930988407d6b46cb0
React-RCTSettings: 869d555a694f6bb28f4a04f91ec0b2fcb7c9f240
React-RCTTest: 630373136f2efc6c40e4faf5e310e2647e85f2eb
React-RCTText: ba771aee10ce905888314660f5947164e3537331
React-RCTVibration: 8a07a277019efad645a5edd22c362b9328e20df5
React-runtimeexecutor: 1f3effc67f57ffda88c60fed112abb228b81d432
RCTRequired: f49712b6724fd8dd6e845e5b0f677c82c3e056ed
RCTTypeSafety: ef2379236567b99015baf61fb30ec58936bc340f
React: cfd459afb0a530b6477833208e2eb810e3ea11a1
React-callinvoker: 7872a85f8a0b5d536140cefcacf4f37b86d96740
React-Core: cf367e931e9c4af4a0601e9be9309079e7b366d5
React-CoreModules: 0d2c95abb8ffbb8625302e0e7ee716a6f1c18084
React-cxxreact: 03a9eb6961302569b6c5b3fbe971a61a48b248eb
React-jsi: fb2baa61689fc0460f95c3cd0087decf034fa512
React-jsiexecutor: 4d10ec97f745bc450daaa45e2c706c00f2db2c2e
React-jsinspector: 92b22cbad0900a0aff8ef52783fabb1ae558cfe6
React-logger: 37c1963c2a213c2712b9621be8cce042c60f4fc4
React-perflogger: 54e27170e6d2510a686c7849f03f32cf470ec503
React-RCTActionSheet: f13cba3fec64e81e19ee1d563a5e84c8df37b42d
React-RCTAnimation: 9f2e3910d8e5fa17dce09879f74bb8e1f0b21fbe
React-RCTBlob: 247cfa5c3eb3847b54f52a63bc825ef7f800cca2
React-RCTImage: b839591e6b9c87511f3ff7f95570603c211e6bd8
React-RCTLinking: bb21516408cff2ff2330f97bb1dd209b26a981c9
React-RCTNetwork: 25be64c75a11ca128d126b3120a13c8b52932912
React-RCTPushNotification: 182f055ed20e8706d6860f74d3747127baa61afa
React-RCTSettings: 908201b3ee422663c4b76cd3ad9314dee68dcfbd
React-RCTTest: eb8811c8d2bb782f38b8a4c1059c1e51b041daac
React-RCTText: 3a9fbc0af67cae1aacd68de644a27f30abd07951
React-RCTVibration: 9f14e9513aeb6fa352ce0516cc9cec2576d5139f
React-runtimeexecutor: f349fa7b90480e6107e21896facb991f72f2dd39
React-TurboModuleCxx-RNW: f2e32cbfced49190a61d66c993a8975de79a158a
React-TurboModuleCxx-WinRTPort: 5e65c3c20da349719f5de3dd84a2e2df13436297
ReactCommon: 7efac92d9872906220a01637905eb583e3f1c1ba
React-TurboModuleCxx-WinRTPort: 137800a9345b5c64f086a751aa9abfc2cf893539
ReactCommon: e71bb4e43f2b014df062a97b2dc2f91f19f342e9
ScreenshotManager: aaab73e8039aef3fad444d4e86cbd7842fd17fac
Yoga: 1c5d2d4001ad1b8fd2bd6e191fbb50ea97d68d3a
Yoga: 71fc48d7a51bff46af53213ce378e5e9a3aa6a78
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: 0929ccef18881ae5e16b549e730d8736eb221250

Просмотреть файл

@ -80,7 +80,7 @@ def get_react_native_preprocessor_flags():
return []
# Building is not supported in OSS right now
def rn_xplat_cxx_library(name, compiler_flags_enable_exceptions = True, compiler_flags_enable_rtti = True, **kwargs):
def rn_xplat_cxx_library(name, compiler_flags_enable_exceptions = False, compiler_flags_enable_rtti = False, **kwargs):
visibility = kwargs.get("visibility", [])
kwargs = {
k: v
@ -97,17 +97,31 @@ def rn_xplat_cxx_library(name, compiler_flags_enable_exceptions = True, compiler
# or being overridden in compiler_flags, it's very likely that the flag is set
# app-wide or that we're otherwise in some special mode.
kwargs["compiler_flags"] = kwargs.get("compiler_flags", [])
kwargs["fbobjc_compiler_flags"] = kwargs.get("fbobjc_compiler_flags", [])
kwargs["fbandroid_compiler_flags"] = kwargs.get("fbandroid_compiler_flags", [])
kwargs["windows_compiler_flags"] = kwargs.get("windows_compiler_flags", [])
kwargs["compiler_flags"] = ["-std=c++17"] + kwargs["compiler_flags"]
kwargs["compiler_flags"] = ["-Wall"] + kwargs["compiler_flags"]
kwargs["compiler_flags"] = ["-Werror"] + kwargs["compiler_flags"]
# RTTI and exceptions allowed for ObjC/iOS, macos, Windows unconditionally for now
kwargs["fbobjc_compiler_flags"] = ["-fexceptions"] + kwargs["fbobjc_compiler_flags"]
kwargs["windows_compiler_flags"] = ["-fno-exceptions"] + kwargs["windows_compiler_flags"]
kwargs["fbobjc_compiler_flags"] = ["-frtti"] + kwargs["fbobjc_compiler_flags"]
kwargs["windows_compiler_flags"] = ["-frtti"] + kwargs["windows_compiler_flags"]
# For now, we allow turning off RTTI and exceptions for android builds only
if compiler_flags_enable_exceptions:
kwargs["compiler_flags"] = ["-fexceptions"] + kwargs["compiler_flags"]
kwargs["fbandroid_compiler_flags"] = ["-fexceptions"] + kwargs["fbandroid_compiler_flags"]
else:
kwargs["compiler_flags"] = ["-fno-exceptions"] + kwargs["compiler_flags"]
# TODO: fbjni currently DOES NOT WORK with -fno-exceptions, which breaks MOST RN Android modules
kwargs["fbandroid_compiler_flags"] = ["-fexceptions"] + kwargs["fbandroid_compiler_flags"]
#kwargs["fbandroid_compiler_flags"] = ["-fno-exceptions"] + kwargs["fbandroid_compiler_flags"]
if compiler_flags_enable_rtti:
kwargs["compiler_flags"] = ["-frtti"] + kwargs["compiler_flags"]
kwargs["fbandroid_compiler_flags"] = ["-frtti"] + kwargs["fbandroid_compiler_flags"]
else:
kwargs["compiler_flags"] = ["-fno-rtti"] + kwargs["compiler_flags"]
kwargs["fbandroid_compiler_flags"] = ["-fno-rtti"] + kwargs["fbandroid_compiler_flags"]
native.cxx_library(
name = name,