Skip to content

Commit

Permalink
fix: remove deprecated event listener method from appearance.js
Browse files Browse the repository at this point in the history
  • Loading branch information
matinzd committed Mar 31, 2022
1 parent 28064ee commit 1ba6ba2
Show file tree
Hide file tree
Showing 182 changed files with 2,608 additions and 842 deletions.
58 changes: 50 additions & 8 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ fb_native.genrule(
) + [
react_native_root_target("packages/rn-tester:nativecomponent-srcs"),
],
labels = ["uses_hg"],
cmd = "$(exe {}) $OUT $SRCS".format(react_native_root_target("packages/react-native-codegen:write_to_json")),
out = "schema-rncore.json",
)
Expand Down Expand Up @@ -97,6 +98,7 @@ rn_xplat_cxx_library2(
# it's linked in your app, transparently use it".
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + [
Expand Down Expand Up @@ -153,7 +155,10 @@ rn_xplat_cxx_library2(
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
],
labels = ["supermodule:xplat/default/public.react_native.infra"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + ["-DWITH_FBSYSTRACE=1"],
visibility = ["PUBLIC"],
deps = [
Expand Down Expand Up @@ -190,7 +195,10 @@ rn_xplat_cxx_library2(
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
],
labels = ["supermodule:xplat/default/public.react_native.infra"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
Expand All @@ -215,7 +223,10 @@ rn_xplat_cxx_library2(
),
contacts = ["oncall+react_native@xmail.facebook.com"],
fbobjc_enable_exceptions = True,
labels = ["supermodule:xplat/default/public.react_native.infra"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
Expand Down Expand Up @@ -418,6 +429,7 @@ rn_xplat_cxx_library2(
labels = [
"depslint_never_add",
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
platform_preprocessor_flags = [(
Expand Down Expand Up @@ -508,6 +520,7 @@ rn_xplat_cxx_library2(
header_path_prefix = "React",
labels = [
"disable_plugins_only_validation",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins = [
Expand Down Expand Up @@ -590,7 +603,10 @@ rn_apple_library(
"$PLATFORM_DIR/Developer/Library/Frameworks/Foundation.framework",
],
inherited_buck_flags = get_static_library_ios_flags(),
labels = ["supermodule:xplat/default/public.react_native.infra"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
reexport_all_header_dependencies = True,
deps = [
Expand Down Expand Up @@ -660,6 +676,7 @@ rn_apple_library(
contacts = ["oncall+react_native@xmail.facebook.com"],
labels = [
"disable_plugins_only_validation",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins = [react_fabric_component_plugin_provider("Image", "RCTImageCls")],
Expand Down Expand Up @@ -690,7 +707,10 @@ rn_xplat_cxx_library2(
},
compiler_flags = ["-Wall"],
contacts = ["oncall+react_native@xmail.facebook.com"],
labels = ["supermodule:xplat/default/public.react_native.infra"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:RCTImage",
Expand Down Expand Up @@ -719,7 +739,10 @@ rn_library(
"Libraries/Components/Switch/SwitchSchema.js",
],
),
labels = ["supermodule:xplat/default/public.react_native.core"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.core",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js:node_modules__abort_19controller",
Expand Down Expand Up @@ -756,7 +779,10 @@ rn_codegen(
android_package_name = "com.facebook.fbreact.specs",
codegen_modules = True,
ios_assume_nonnull = False,
library_labels = ["supermodule:xplat/default/public.react_native.infra"],
library_labels = [
"supermodule:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
],
native_module_spec_name = "FBReactNativeSpec",
src_prefix = "Libraries/",
)
Expand All @@ -766,7 +792,10 @@ rn_codegen(
name = "FBReactNativeComponentSpec",
codegen_components = True,
ios_assume_nonnull = False,
library_labels = ["supermodule:xplat/default/public.react_native.infra"],
library_labels = [
"supermodule:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
],
src_prefix = "Libraries/",
)

Expand Down Expand Up @@ -800,6 +829,7 @@ rn_apple_library(
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins =
Expand Down Expand Up @@ -849,6 +879,7 @@ rn_apple_library(
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins =
Expand Down Expand Up @@ -907,6 +938,7 @@ rn_apple_library(
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins =
Expand Down Expand Up @@ -954,6 +986,7 @@ rn_apple_library(
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins =
Expand Down Expand Up @@ -1005,6 +1038,7 @@ rn_apple_library(
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins =
Expand Down Expand Up @@ -1085,6 +1119,7 @@ rn_apple_library(
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins =
Expand Down Expand Up @@ -1218,6 +1253,7 @@ rn_xplat_cxx_library2(
],
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
Expand Down Expand Up @@ -1250,6 +1286,7 @@ rn_apple_library(
labels = [
"depslint_never_remove",
"disable_plugins_only_validation",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
plugins = react_module_plugin_providers(
Expand Down Expand Up @@ -1290,6 +1327,7 @@ rn_xplat_cxx_library2(
],
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
Expand Down Expand Up @@ -1322,6 +1360,7 @@ rn_xplat_cxx_library2(
],
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
Expand Down Expand Up @@ -1356,6 +1395,7 @@ rn_xplat_cxx_library2(
],
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
Expand Down Expand Up @@ -1391,6 +1431,7 @@ rn_xplat_cxx_library2(
],
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
Expand All @@ -1412,6 +1453,7 @@ rn_xplat_cxx_library2(
"React/RCTConvert+CoreLocation.h": RCTVIEWS_PATH + "RCTConvert+CoreLocation.h",
},
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
visibility = [
Expand Down
5 changes: 4 additions & 1 deletion IntegrationTests/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ rn_library(
"websocket_integration_test_server.js",
],
),
labels = ["supermodule:xplat/default/public.react_native.tests"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.tests",
],
skip_processors = True,
visibility = ["PUBLIC"],
deps = [
Expand Down
15 changes: 15 additions & 0 deletions Libraries/Components/View/ViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ type TouchEventProps = $ReadOnly<{|
onTouchStartCapture?: ?(e: PressEvent) => void,
|}>;

type PointerEventCallbackProps = $ReadOnly<{|
onPointerCancel?: ?(e: PointerEvent) => void,
onPointerCancelCapture?: ?(e: PointerEvent) => void,
onPointerDown?: ?(e: PointerEvent) => void,
onPointerDownCapture?: ?(e: PointerEvent) => void,
onPointerEnter2?: ?(e: PointerEvent) => void,
onPointerLeave2?: ?(e: PointerEvent) => void,
onPointerEnter2Capture?: ?(e: PointerEvent) => void,
onPointerLeave2Capture?: ?(e: PointerEvent) => void,
onPointerMove2Capture?: ?(e: PointerEvent) => void,
onPointerUp?: ?(e: PointerEvent) => void,
onPointerUpCapture?: ?(e: PointerEvent) => void,
|}>;

/**
* For most touch interactions, you'll simply want to wrap your component in
* `TouchableHighlight` or `TouchableOpacity`. Check out `Touchable.js`,
Expand Down Expand Up @@ -382,6 +396,7 @@ export type ViewProps = $ReadOnly<{|
...GestureResponderEventProps,
...MouseEventProps,
...TouchEventProps,
...PointerEventCallbackProps,
...AndroidViewProps,
...IOSViewProps,

Expand Down
5 changes: 4 additions & 1 deletion Libraries/FBLazyVector/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ fb_apple_library(
enable_exceptions = False,
extension_api_only = True,
frameworks = [],
labels = ["supermodule:xplat/default/public.react_native.infra"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
link_whole = False,
visibility = ["PUBLIC"],
)
38 changes: 38 additions & 0 deletions Libraries/NativeComponent/PlatformBaseViewConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,44 @@ const PlatformBaseViewConfig: PartialViewConfigWithoutName =
bubbled: 'onTouchMove',
},
},
topPointerCancel: {
phasedRegistrationNames: {
captured: 'onPointerCancelCapture',
bubbled: 'onPointerCancel',
},
},
topPointerDown: {
phasedRegistrationNames: {
captured: 'onPointerDownCapture',
bubbled: 'onPointerDown',
},
},
topPointerEnter2: {
phasedRegistrationNames: {
captured: 'onPointerEnter2Capture',
bubbled: 'onPointerEnter2',
skipBubbling: true,
},
},
topPointerLeave2: {
phasedRegistrationNames: {
captured: 'onPointerLeave2Capture',
bubbled: 'onPointerLeave2',
skipBubbling: true,
},
},
topPointerMove2: {
phasedRegistrationNames: {
captured: 'onPointerMove2Capture',
bubbled: 'onPointerMove2',
},
},
topPointerUp: {
phasedRegistrationNames: {
captured: 'onPointerUpCapture',
bubbled: 'onPointerUp',
},
},
},
validAttributes: {
// @ReactProps from BaseViewManager
Expand Down
5 changes: 4 additions & 1 deletion Libraries/RCTRequired/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ fb_apple_library(
contacts = ["oncall+react_native@xmail.facebook.com"],
extension_api_only = True,
frameworks = ["Foundation"],
labels = ["supermodule:xplat/default/public.react_native.infra"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
)
12 changes: 12 additions & 0 deletions Libraries/Types/CoreEventTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ export type TextLayoutEvent = SyntheticEvent<
|}>,
>;

export type PointerEvent = ResponderSyntheticEvent<
$ReadOnly<{|
pointerId: number,
pressure: number,
pointerType: string,
clientX: number,
clientY: number,
target: ?number,
timestamp: number,
|}>,
>;

export type PressEvent = ResponderSyntheticEvent<
$ReadOnly<{|
changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
Expand Down
8 changes: 0 additions & 8 deletions Libraries/Utilities/Appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,4 @@ module.exports = {
addChangeListener(listener: AppearanceListener): EventSubscription {
return eventEmitter.addListener('change', listener);
},

/**
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
*/
removeChangeListener(listener: AppearanceListener): void {
// NOTE: This will report a deprecation notice via `console.error`.
eventEmitter.removeListener('change', listener);
},
};
1 change: 1 addition & 0 deletions React/CoreModules/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rn_apple_library(
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
link_whole = True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ rn_android_library(
name = "network",
srcs = glob(["**/*.java"]),
autoglob = False,
labels = ["supermodule:xplat/default/public.react_native.infra"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholde",
"supermodule:xplat/default/public.react_native.infra",
],
visibility = [
"PUBLIC",
],
Expand Down
Loading

0 comments on commit 1ba6ba2

Please sign in to comment.