Граф коммитов

23792 Коммитов

Автор SHA1 Сообщение Дата
Marcel Lasaj 9eb0881c8f fix(android): Updated TextInput prop types to accomodate for new autoComplete values (#32575)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
This fixes the "Failed prop type: Invalid prop `autoComplete` of value `[any-of-the-new-values]`" warning, as mentioned in https://github.com/facebook/react-native/issues/32557.

[This commit](d9e0ea77f0) introduced new HintConstants for autofill, but added those only to [`TextInput.js`](https://github.com/facebook/react-native/blob/main/Libraries/Components/TextInput/TextInput.js#L331) and forgot to add them (and the new docs' description) to either [`AndroidTextInputNativeComponent`](https://github.com/facebook/react-native/blob/main/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js#L99) or [`DeprecatedTextInputPropTypes.js`](https://github.com/facebook/react-native/blob/main/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js#L67). I know, the latter has clearly been deprecated, but until it is actually being removed, it shouldn't throw warnings like that.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Updated TextInput prop types to accomodate for new autoComplete values

Pull Request resolved: https://github.com/facebook/react-native/pull/32575

Test Plan: There is no warning after these changes.

Reviewed By: yungsters

Differential Revision: D32324108

Pulled By: lunaleaps

fbshipit-source-id: df27cbbd54788f26471029c9201c6a27ca8b7893
2021-11-11 15:41:44 -08:00
Nick Fujita 614e6025ab Fix RCTAlertController import when embed in existing iOS projects (#32457)
Summary:
Fixes a build error relating to RCTAlertController import when embedding react-native into existing iOS app. This PR resolves the issue detailed in https://github.com/facebook/react-native/issues/32356

## Changelog

Adjusts the import syntax which was added in:
f319ff321c (diff-56beca6ee071cdd162c269ce765ab12d5af8c8c0ca840bca1e9d1f59e9fab790)

Existing:
#import "RCTAlertController.h"

New:
#import <React/RCTAlertController.h>

[iOS] [Fix] - Fix RCTAlertController import build error when embedded in existing iOS projects

Pull Request resolved: https://github.com/facebook/react-native/pull/32457

Test Plan:
Build this branch in existing iOS project using swift, and should not have the build error described in the issue above.

Would also like to have this fix cherry-pick'd to release 0.63 after merging.

Reviewed By: RSNara

Differential Revision: D31861814

Pulled By: charlesbdudley

fbshipit-source-id: e60f80c8ea982e400cbf6d9375037d4197bbb8a3
2021-11-11 15:30:50 -08:00
Sota Ogo 751708d779 Use dummy file for FBReactNativeSpecs.podspec so that it doesn't include any files even there are old files.
Summary:
FBReactNativeSpecs.podspec is currently only acting as a config for codegen. It should not include any sources. This would fix unintended build error related to FBReactNativeSpecs-generated file.

Changelog: [internal]

Reviewed By: philIip

Differential Revision: D32267102

fbshipit-source-id: 27b510198666dc26a890cd7a6f873a04a9df66ca
2021-11-11 14:15:57 -08:00
Liron Yahdav f249d21da0 Native changes for TextInput.setSelection method
Summary:
Native changes in preparation for adding a `setSelection` imperative method to `TextInput`.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D31590771

fbshipit-source-id: eed40d1c2803fec713f2008ab8053a2812249715
2021-11-11 13:35:46 -08:00
Nicola Corti 2ae06df58f Let react_native_assert really abort the app
Summary:
Fixed a bug in `react_native_assert` that was not effectively letting the app
call `abort()`. The app was actually printing on log twice.
Ref: https://developer.android.com/ndk/reference/group/logging#__android_log_assert

Changelog:
[Android] [Changed] - Let react_native_assert really abort the app

Reviewed By: JoshuaGross

Differential Revision: D32204080

fbshipit-source-id: ca16c50aaf4e41a2318277c233be0e944b2ad8f1
2021-11-11 08:57:59 -08:00
Pieter Vanderwerff 181464903c Deploy 0.164.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: bradzacher

Differential Revision: D32321328

fbshipit-source-id: 48017e06bdda567fee9ff571247425d07a22c923
2021-11-11 08:39:15 -08:00
Nicola Corti e6fc9b6f29 Introduce EmptyReactNativeConfig inside Java
Summary:
I'm adding a `EmptyReactNativeConfig` for Java as we had a similar class in C++.
Ideally inside the Playbook we can allow users to use this class rather than having to
create an anonymous inner class.

Changelog:
[Internal] [Added] - Introduce EmptyReactNativeConfig inside Java

Reviewed By: ShikaSD

Differential Revision: D32277916

fbshipit-source-id: f6bbeb0477681d536dfd89930b732609add7c43a
2021-11-11 07:41:07 -08:00
Gijs Weterings 5050e7eaa1 Pass testID down in Modal
Summary:
Changelog:
[General][Fixed] - Modal accepts a testID but didn't forward it to RCTModalHostView, therefore not making it show up for e2e tests depending on viewhierarchy.

Reviewed By: motiz88

Differential Revision: D32354377

fbshipit-source-id: 51df3a1f81c4b77240e83101b367b033ce98b0c7
2021-11-11 07:07:11 -08:00
chenmo187 9d71b166a6 bugfix for multiple shadow threads rendered at the same time, small probability crash. (#32167)
Summary:
Summary
bugfix for multiple shadow threads rendered at the same time, small probability crash.

Changelog
Android
Fixed
ViewManagersPropertyCache.class

Background:

![image](https://user-images.githubusercontent.com/6276997/132460973-53e91b14-4e00-47d9-a42a-504eecd471dc.png)

![image](https://user-images.githubusercontent.com/6276997/132460999-d4f446e0-1a20-4634-a6b2-642bbf651345.png)

4 tab(RN Page) has 4 ReactInstanceManager.

4 ReactInstanceManager has 4 shadow threads and 4 JS threads.

4 RN Page if rendered at the same time. small probability crash

the key crash log(full log at the end):
java.lang.IllegalArgumentException: method com.facebook.react.uimanager.LayoutShadowNode.setWidth argument 1 has type com.facebook.react.bridge.Dynamic, got java.lang.String

need Dynamic and got String.

Reasons of crash: PropSetter class field : VIEW_MGR_ARGS, VIEW_MGR_GROUP_ARGS, SHADOW_ARGS, SHADOW_GROUP_ARGS is static.
one shadow thread put data in static array, it was changed by another shadow thread before method invoke.

No.1 shadow thread put "Dynamic" in static array.
No.2 shadow thread put "String" in the same static array(replace the "Dynamic").
No.1 shadow  thread invoke method with the static array as params. the crash..

The solution:
use ThreadLocal instead of static array.

Pull Request resolved: https://github.com/facebook/react-native/pull/32167

Test Plan:
I make 4 tab page rendered at the same time and test 100 times. it is not crash again.

about 15% chance of crash before fixed.

Crash stack:

2021-09-08 11:56:07.392 16776-17062/com.shopeepay.merchant.id.debug E/unknown:ViewManager: Error while updating prop width
java.lang.IllegalArgumentException: method com.facebook.react.uimanager.LayoutShadowNode.setWidth argument 1 has type com.facebook.react.bridge.Dynamic, got java.lang.String
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:111)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:161)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:65)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:320)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:251)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:469)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:236)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:923)
2021-09-08 11:56:07.488 16776-17062/com.shopeepay.merchant.id.debug E/unknown:ReactNative: CatalystInstanceImpl caught native exception
com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'width' in shadow node of type: RCTView
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:125)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:161)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:65)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:320)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:251)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:469)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:236)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.IllegalArgumentException: method com.facebook.react.uimanager.LayoutShadowNode.setWidth argument 1 has type com.facebook.react.bridge.Dynamic, got java.lang.String
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:111)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:161)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:65)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:320)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:251)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:469)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:236)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:923)
2021-09-08 11:56:07.488 16776-17062/com.shopeepay.merchant.id.debug E/com.shopeepay.merchant.id.debug: com.shopee.app.react.util.ReactJSException: Error while updating property 'width' in shadow node of type: RCTView
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:125)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:161)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:65)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:320)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:251)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:469)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:236)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
at java.lang.Thread.run(Thread.java:923)
2021-09-08 11:56:07.571 16776-16776/com.shopeepay.merchant.id.debug E/com.shopeepay.merchant.id.debug: com.shopee.app.react.util.ReactJSException: Trying to add unknown view tag: 1519
at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:487)
at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:209)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:917)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1028)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:48)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1088)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:809)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:07.615 16776-16776/com.shopeepay.merchant.id.debug E/unknown:ReactContextBaseJavaModule: Unhandled SoftException
java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by Timing
at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
at com.facebook.react.modules.core.TimingModule.access$000(TimingModule.java:22)
at com.facebook.react.modules.core.TimingModule$BridgeTimerManager.callTimers(TimingModule.java:28)
at com.facebook.react.modules.core.JavaTimerManager$TimerFrameCallback.doFrame(JavaTimerManager.java:84)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:809)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:07.626 16776-16776/com.shopeepay.merchant.id.debug E/unknown:DeviceInfo: Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: No active CatalystInstance, cannot emitUpdateDimensionsEvent
at com.facebook.react.modules.deviceinfo.DeviceInfoModule.emitUpdateDimensionsEvent(DeviceInfoModule.java:99)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.emitUpdateDimensionsEvent(ReactRootView.java:755)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.checkForDeviceDimensionsChanges(ReactRootView.java:713)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.onGlobalLayout(ReactRootView.java:664)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:1061)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3093)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8383)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1058)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:813)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:07.674 16776-16776/com.shopeepay.merchant.id.debug E/unknown:ReactContextBaseJavaModule: Unhandled SoftException
java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by Timing
at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
at com.facebook.react.modules.core.TimingModule.access$000(TimingModule.java:22)
at com.facebook.react.modules.core.TimingModule$BridgeTimerManager.callTimers(TimingModule.java:28)
at com.facebook.react.modules.core.JavaTimerManager$TimerFrameCallback.doFrame(JavaTimerManager.java:84)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:809)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:07.677 16776-16776/com.shopeepay.merchant.id.debug E/unknown:DeviceInfo: Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: No active CatalystInstance, cannot emitUpdateDimensionsEvent
at com.facebook.react.modules.deviceinfo.DeviceInfoModule.emitUpdateDimensionsEvent(DeviceInfoModule.java:99)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.emitUpdateDimensionsEvent(ReactRootView.java:755)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.checkForDeviceDimensionsChanges(ReactRootView.java:713)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.onGlobalLayout(ReactRootView.java:664)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:1061)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3093)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8383)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1058)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:813)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:07.686 16776-16776/com.shopeepay.merchant.id.debug E/unknown:DeviceInfo: Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: No active CatalystInstance, cannot emitUpdateDimensionsEvent
at com.facebook.react.modules.deviceinfo.DeviceInfoModule.emitUpdateDimensionsEvent(DeviceInfoModule.java:99)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.emitUpdateDimensionsEvent(ReactRootView.java:755)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.checkForDeviceDimensionsChanges(ReactRootView.java:713)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.onGlobalLayout(ReactRootView.java:664)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:1061)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3093)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8383)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1058)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:813)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:07.698 16776-16776/com.shopeepay.merchant.id.debug E/unknown:ReactContextBaseJavaModule: Unhandled SoftException
java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by Timing
at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
at com.facebook.react.modules.core.TimingModule.access$000(TimingModule.java:22)
at com.facebook.react.modules.core.TimingModule$BridgeTimerManager.callTimers(TimingModule.java:28)
at com.facebook.react.modules.core.JavaTimerManager$TimerFrameCallback.doFrame(JavaTimerManager.java:84)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:809)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:08.406 16776-16776/com.shopeepay.merchant.id.debug E/unknown:ReactContextBaseJavaModule: Unhandled SoftException
java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by Timing
at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
at com.facebook.react.modules.core.TimingModule.access$000(TimingModule.java:22)
at com.facebook.react.modules.core.TimingModule$BridgeTimerManager.callTimers(TimingModule.java:28)
at com.facebook.react.modules.core.JavaTimerManager$TimerFrameCallback.doFrame(JavaTimerManager.java:84)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:809)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:08.423 16776-16776/com.shopeepay.merchant.id.debug E/unknown:ReactContextBaseJavaModule: Unhandled SoftException
java.lang.RuntimeException: Catalyst Instance has already disappeared: requested by Timing
at com.facebook.react.bridge.ReactContextBaseJavaModule.getReactApplicationContextIfActiveOrWarn(ReactContextBaseJavaModule.java:67)
at com.facebook.react.modules.core.TimingModule.access$000(TimingModule.java:22)
at com.facebook.react.modules.core.TimingModule$BridgeTimerManager.callTimers(TimingModule.java:28)
at com.facebook.react.modules.core.JavaTimerManager$TimerFrameCallback.doFrame(JavaTimerManager.java:84)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:809)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
2021-09-08 11:56:09.594 16776-16776/com.shopeepay.merchant.id.debug E/unknown:DeviceInfo: Unhandled SoftException
com.facebook.react.bridge.ReactNoCrashSoftException: No active CatalystInstance, cannot emitUpdateDimensionsEvent
at com.facebook.react.modules.deviceinfo.DeviceInfoModule.emitUpdateDimensionsEvent(DeviceInfoModule.java:99)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.emitUpdateDimensionsEvent(ReactRootView.java:755)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.checkForDeviceDimensionsChanges(ReactRootView.java:713)
at com.facebook.react.ReactRootView$CustomGlobalLayoutListener.onGlobalLayout(ReactRootView.java:664)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:1061)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3093)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2054)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8383)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1058)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:813)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

Reviewed By: cortinico

Differential Revision: D31904828

Pulled By: ShikaSD

fbshipit-source-id: 1337a1e9f0320417b441efe84e9066f15ffcd12e
2021-11-11 05:49:36 -08:00
Niklas Mischkulnig 91728e2266 Remove unused and incorrect type declarations (#32570)
Summary:
See https://github.com/facebook/react-native/pull/32566

This file doesn't have a `flow` comment, and the types that I removed here are incorrect anyway (missing a generic type parameter) because Flow didn't check them.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Remove unused and incorrect type declarations in WebSocketInterceptor

Pull Request resolved: https://github.com/facebook/react-native/pull/32570

Test Plan: See https://github.com/facebook/react-native/pull/32566

Reviewed By: lunaleaps

Differential Revision: D32315077

Pulled By: GijsWeterings

fbshipit-source-id: d3b826a01a0bb8e38380de5b79cb6b5d13db2ef1
2021-11-11 04:44:00 -08:00
Moti Zilberman 6df04ae666 Optionally capture packager logs during RNTester Xcode build
Summary:
Changelog: [Internal]

* Sets a default custom reporter in `scripts/packager.sh` that redirects Metro's logs to a JSON file when the `RCT_PACKAGER_LOG_PATH` environment variable is set. Otherwise we use Metro's `TerminalReporter`, [like the CLI does by default](0993f62786/packages/cli-plugin-metro/src/commands/start/runServer.ts (L124)).
* Modifies `scripts/launchPackager.command` to write logs to `$RCT_PACKAGER_LOGS_DIR` (and in particular use the JSON reporter) if this environment var is set.
* Uses [`open -n`](https://ss64.com/osx/open.html#:~:text=Open%20a%20new%20instance%20of%20the%20application) to execute `launchPackager.command` from Xcode, so that environment variables are reliably passed to the script even if a Terminal process is already running.

Reviewed By: yungsters

Differential Revision: D32295290

fbshipit-source-id: 4d783e1f94d122d3a35c104b2b02dbfaf8e1a1a3
2021-11-11 00:01:40 -08:00
Sota Ogo 4ff16c62ae Add a phase to build third party component provider
Summary:
Adds a phase to generate-artifacts.js to generate the third party components provider for fabric. The output path needs to align with where the rest of generated files go (the work is wip).

Changelog:[internal]

Reviewed By: hramos

Differential Revision: D32128834

fbshipit-source-id: 8721b8a19bcf01bb388a293ce17162b4e578a72a
2021-11-10 19:36:46 -08:00
Evan Yeung 037e346197 Add LTI annotations to xplat/js
Summary:
This diff runs the codemod to add type annotations to function parameters in preparation for Flow's local type inference (LTI) project. I ran the codemod over xplat/js and reverted any files that had flow errors in them. See the list of commands run to see the regeneration of various files.

Changelog:
[Internal][Changed] - Added type annotations

Reviewed By: yungsters

Differential Revision: D32075270

fbshipit-source-id: 6a9cd85aab120b4d9e690bac142a415525dbf298
2021-11-10 15:40:15 -08:00
Evan Yeung 83a1791991 Manually fix types for LTI annotations in xplat/js
Summary:
This diff makes the manual changes necessary to fix many of the errors in the stacked diff codemod.

See https://fb.workplace.com/groups/flowlang/posts/917522612186736 for details on this effort.

Reviewed By: bradzacher

Differential Revision: D31615035

fbshipit-source-id: 179b2df516833d59873b9003350f81eb4a6b4e9d
2021-11-10 15:40:15 -08:00
Phillip Pan f10741a946 replace contentInsetsForView: with RCTContentInsets()
Summary:
as title

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31949240

fbshipit-source-id: 2660a4b44fd2aad5cda52ec61e741e7b4e9eb442
2021-11-10 13:56:52 -08:00
Niklas Mischkulnig 98abf1b02f Complete missing Flow declarations in URL (#32566)
Summary:
When transpiling flow with a Babel config like
```
{
	plugins:  [['babel/plugin-transform-flow-strip-types', {requireDirective: true}]]
}
```
all files containing Flow syntax need to have `flow` at the top of the file.
```
node_modules/react-native/Libraries/Blob/URL.js: A flow directive is required when using Flow annotations with the `requireDirective` option.
  55 |   _searchParams = [];
  56 |
> 57 |   constructor(params: any) {
     |                     ^^^^^
  58 |     if (typeof params === 'object') {
  59 |       Object.keys(params).forEach(key => this.append(key, params[key]));
  60 |     }
```

In URL, it was removed (mistakenly I think) by 63038500a2 (diff-552f9731d5c9bc329105a5f4224319966395e59b5bb23202b756c5d152e0f007). Only the `strict-local´ part should have been removed, not the whole line.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Complete missing Flow declarations in URL

Pull Request resolved: https://github.com/facebook/react-native/pull/32566

Test Plan: See above

Reviewed By: yungsters

Differential Revision: D32295816

Pulled By: lunaleaps

fbshipit-source-id: 1ad19a032e3399434f4e6a8eebbf37071a0f97be
2021-11-10 13:15:10 -08:00
Lorenzo Sciandra 02e50a748f add changelog for 0.66.3 (#32576)
Summary:
lunaleaps did [0.66.3](https://github.com/facebook/react-native/releases/tag/v0.66.3) yesterday - this PR adds the entries for it in the changelog.md file.

## Changelog

[Internal] [Changed] - add changelog entry for 0.66.3

Pull Request resolved: https://github.com/facebook/react-native/pull/32576

Test Plan: N/A

Reviewed By: lunaleaps

Differential Revision: D32321194

Pulled By: yungsters

fbshipit-source-id: dadffb21fd9ece245acf761947e8fef544a00b7d
2021-11-10 13:08:43 -08:00
Phillip Pan 83fab36b93 clean up unneeded imports in RCTView
Summary:
just cleaning up some unused stuff

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31949239

fbshipit-source-id: f6542a01a879cd9ee10903d99de32e6537aa573b
2021-11-10 12:01:07 -08:00
Sota Ogo d065b06da1 Generate ThirdpartyFabricComponentsProvider to extend RCTFabricComponentsPlugins
Summary:
Currently, we don't have a way to extend RCTFabricComponentsPlugins in OSS. This diff  adds a codegen to generate ThirdpartyFabricComponentsProviderwhich will be used to extend RCTFabricComponentsPlugins.

It works almost exactly the same as RCTFabricComponentsPlugins, and in the future we might want to consider merging them together.

Changelog: [internal]

Reviewed By: hramos

Differential Revision: D32128760

fbshipit-source-id: b4f3a082f94c3053251cc6a0323c488f649deaa9
2021-11-10 10:09:59 -08:00
Moti Zilberman b27a83b084 Echo shell commands while attempting to start Metro from Xcode
Summary: Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32296662

fbshipit-source-id: 7780f287471325c8aec1793cf8f2089ca14b562f
2021-11-10 03:28:13 -08:00
Tim Yung 36bbd8fa31 RN: Eliminate Jest Log Spew
Summary:
Eliminates all of the console logs that appear when successfully running Jest tests for React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D32304619

fbshipit-source-id: 8bc8ef9337ae6af588238cec7cfb874ac6067340
2021-11-09 23:42:28 -08:00
Tim Yung 148c98ec80 RN: Resolve Outstanding ESLint Warnings
Summary:
Resolves outstanding ESLint warnings in React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D32291912

fbshipit-source-id: 61337d5a5a0e6ed55f732675e029f4b76d850af9
2021-11-09 21:46:21 -08:00
Phillip Pan 9fc3fc83ac introduce RCTViewUtils
Summary:
Changelog: [Internal]

in this diff, i convert the following method to a C function.
https://www.internalfb.com/code/fbsource/[c58818169205f1e0fa816968efdb4c3fac8333e9]/xplat/js/react-native-github/React/Views/RCTView.h?lines=43

besides for testing demonstration purposes later in the stack, C functions are a superior choice to static class methods because they incur less binary size cost (see section 4.3 of https://swolchok.github.io/objcperf/ if you're curious, and https://fb.workplace.com/groups/aexpixfn/posts/1909150855887748 for the impact of a conversion)

Reviewed By: RSNara

Differential Revision: D31949241

fbshipit-source-id: dd40871d48f1de168d360168c4dd60015145d7e3
2021-11-09 20:42:13 -08:00
George Zahariev ecfb6376ba Enable Indexed Access Types in Xplat
Summary:
Enable Flow's Indexed Access Types (https://flow.org/en/docs/types/indexed-access/) in Xplat.

These are a replacement for `$ElementType` and `$PropertyType`.

Changelog: [Internal]

Remove `$FlowFixMe[indexed-access-off]`: `flow --json | jq -r ".errors[].message[0].path" | sort | uniq | xargs sed -i '/indexed-access-off/ d'`
Suppress new errors: `~/fbsource/xplat/js/scripts/flow/tool add-comments ~/fbsource/xplat/js/RKJSModules/public/XPlatReact/FXDemoShared/ --all --comment "Automatically suppressed"`
Re-sign: `hg st -n | grep '\.js$' | xargs --no-run-if-empty grep -lE 'generated|partially-generated'| xargs -n 1 -P 8 ~/fbsource/tools/signedsource sign`

Reviewed By: yungsters

Differential Revision: D32142892

fbshipit-source-id: 442092c497232750c729125383c9f4edcefbb6b1
2021-11-09 14:27:51 -08:00
George Zahariev 7f802202cc Update the version of flow-parser used by JSCodeshift
Summary:
Update the version of flow-parser used by JSCodeshift to the latest, so it can handle new syntax like indexed access types.
Fix up some jscodeshift scripts that had failing tests due to updated parser.

Reviewed By: yungsters

Differential Revision: D32226600

fbshipit-source-id: cdd045bad523df9bf14af35ddab9516fc75ce900
2021-11-09 14:27:51 -08:00
Tim Yung 10f9ab4d69 RN: Follow-up Format w/ Prettier v2.x
Summary:
When I upgraded React Native to Prettier v2.x, I removed `format` from a few files to reduce the number of changes.

This is a follow-up to bring back `format` and fix any remaining issues.

Changelog:
[Internal]

Reviewed By: zertosh

Differential Revision: D32287259

fbshipit-source-id: 37ea6d2c973b1db5d37c46d73675bdf436fb9a9d
2021-11-09 13:16:43 -08:00
Tim Yung cf763cdf81 RN: Upgrade ESLint Packages (#32560)
Summary:
Upgrades ESLint to v7.28.0. This is the latest version before v8.0.0, which would be a more involved upgrade.

Upgrades all ESLint-related dependencies to their latest version, except for [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype/). This is because eslint-plugin-flowtype@8.0.0 dropped support for ESLint v7.

Configures ESLint for Metro to extend `plugin:prettier/recommended`.

## Changelog

[General][Changed] - Upgraded packages to the latest versions for ESLint v7.

Pull Request resolved: https://github.com/facebook/react-native/pull/32560

Test Plan:
Run this on an open source checkout of `facebook/react-native`:

```
# See no new errors or warnings.
$ yarn run lint
```

Run this internally:

```
$ js1 test xplat/js/tools/__tests__/dependency-constraints-test.js
```

Verify linting works:

```
js1 lint xplat/js/RKJSModules/Libraries/Core/
```

Reviewed By: lunaleaps

Differential Revision: D32258399

Pulled By: yungsters

fbshipit-source-id: d11b3fc3e33770157a90f3dee352cf80b39c442c
2021-11-09 13:16:42 -08:00
Tim Yung 8880c09076 RN: Rename `Keyboard.remove{Event =>}Listener`
Summary:
Renames `Keyboard.removeEventListener` to `Keyboard.removeListener`.

When I implemented the compatibility layer in {D26589441 (035718ba97)}, I accidentally used the wrong name. Since `Keyboard.removeEventListener` was always deprecated, this removes it completely.

Changelog:
[General][Changed] - Rename deprecated `Keyboard.removeEventListener` to `Keyboard.removeListener`.

Reviewed By: lunaleaps

Differential Revision: D32282743

fbshipit-source-id: 309382af3269f85f781d38367d115a2ce3690efb
2021-11-09 12:57:40 -08:00
Xin Chen 9b33c31ee0 Add `onChildEndedNativeGesture` to JSTouchDispatcher and ReactRootView to handle child gesture finishes event
Summary:
Changelog:
[Android][Added] Adding new API `onChildEndedNativeGesture` to the RootView interface to let its implementations notify the JS side that a child gesture is ended.

Reviewed By: javache

Differential Revision: D32228745

fbshipit-source-id: ad1f26546dd60f9c5a569b0bc3ad5020a01b90cc
2021-11-09 12:53:14 -08:00
Lucas Bento e973b3afc2 Bump `core-workflow-apply-version-label` version (#32565)
Summary:
Fix the issue with the label not being applied correctly to issues.

## Changelog

N/A

Pull Request resolved: https://github.com/facebook/react-native/pull/32565

Reviewed By: cortinico

Differential Revision: D32283554

Pulled By: lunaleaps

fbshipit-source-id: 77de56ef3a3dd9b87d1addc3d6d5deb08817d2d0
2021-11-09 09:30:35 -08:00
Andrei Shikov 046d1934a8 Use built-in fbjni Java <-> std::string conversion for SurfaceHandler init
Summary:
The conversion between std::string and Java strings is failing when initializing the `SurfaceHandler`. Instead of manually converting strings, this change makes native init use built-in fbjni helper instead.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D32281900

fbshipit-source-id: 056fce56b40c036d454925c8734bbf2a16f327ff
2021-11-09 09:27:17 -08:00
Pieter De Baets 954fc04f58 Support RootView in UIManagerHelper.getSurfaceId
Summary:
The `Event.getSurfaceIdForView` method I added recently is actually a duplicate of `UIManagerHelper.getSurfaceId`, except that the latter doesn't support RootViews very well.

Changelog:
[Android][Changed] - Improved UIManagerHelper.getSurfaceId and removed Event.getSurfaceIdForView

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D32102175

fbshipit-source-id: 01741df6b646037a4575e9ca302ea248af9fd6f3
2021-11-09 08:51:53 -08:00
Rubén Norte 74b91c5073 Revert changes in RN preprocessor
Summary: Changelog: [General][Fixed] Revert changes in Jest preprocessor to fix tests in external projects

Reviewed By: yungsters

Differential Revision: D32250044

fbshipit-source-id: 0ed4c9f7bcfa82349b5c2ec7af2ccda970bbb0ef
2021-11-09 01:15:14 -08:00
Tim Yung 280e4ce4fe RN: Change `@{ => no}format` in React Files
Summary:
Instead of using `.prettierrc` to ignore the files sync'd from React, replace `format` with `noformat`.

This is necessary because currently, the version of Prettier used in React Native (v2.4.1) differs from the version used in React (v1.19.1). We can revert this when React is upgraded.

Changelog:
[Internal]

Reviewed By: ShikaSD

Differential Revision: D32129937

fbshipit-source-id: ca3b379edd732670a9a0b1b20b3f31bdad4b74aa
2021-11-09 00:33:12 -08:00
Tim Yung 32f36fe105 RN: Fix Prettier Formatting Errors (#32524)
Summary:
Ignores the `Libraries/Renderer/` directory of files which are synchronized from React (and should not be modified).

Also, formats some EventEmitter modules that for some reason were missed when I upgraded to Prettier v2.x.

## Changelog

[Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/32524

Test Plan:
```
yarn run format-check
```

Reviewed By: javache

Differential Revision: D32129837

Pulled By: yungsters

fbshipit-source-id: 1cb42cec210508db499850e13f77beefdb35eb25
2021-11-09 00:33:12 -08:00
Ramanpreet Nara f1f88b02e8 Stop unnecessarily spreading ReactNativeViewViewConfig
Summary:
There's no need to spread ReactNativeViewViewConfig props into ViewConfig partials ourselves. createViewConfig does this for us:

https://www.internalfb.com/code/fbsource/[b319a947b3e5]/xplat/js/react-native-github/Libraries/NativeComponent/ViewConfig.js?lines=20-50

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32187833

fbshipit-source-id: 6d7ea3fc808ccfc98e067f8f52334f7b3417d7a7
2021-11-09 00:29:13 -08:00
Ramanpreet Nara d29a6a116e Make sizesDiffer and matricesDiffer type-safe
Summary: Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D32159547

fbshipit-source-id: 5223814cbb85c58219b99686b0b527768410e3ac
2021-11-09 00:29:13 -08:00
Ramanpreet Nara 73b243acbc Refactor: Make StaticViewConfigValidator.validate() output objects
Summary:
## Changes
- StaticViewConfigValidator.validate() now outputs a ValidationOutput object, that contains a Array<Differences>, if invalid
- The Difference type now contains the nativeValue and the staticValue. This makes the validate() function more useful in reconciling ViewConfigs.
- Nothing should change in NativeComponentRegistry.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32139973

fbshipit-source-id: a9556fa370d2c14f9e5d0540b44824cd61773958
2021-11-09 00:29:13 -08:00
Ramanpreet Nara 36612a8060 Default {bubbling,direct}EventTypes to {} in Native VCs
Summary:
## Rationale
**Consistency with Static View Configs:** Static view config will default bubblingEventTypes or directEventTypesto to an empty object, if the any of them are undefined.

https://www.internalfb.com/code/fbsource/[a73d46ab4052838e46e0f3aab8508025795aec1f]/xplat/js/react-native-github/Libraries/NativeComponent/ViewConfig.js?lines=20-23%2C26-33%2C41%2C43-50

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32159393

fbshipit-source-id: fefb3509b9b7c7374d2c3d8962afa5402daf6f72
2021-11-09 00:29:13 -08:00
rayzr522 274c617f5b Fix build of glog & Flipper-Glog on Apple Silicon (Attempt 2) (#32486)
Summary:
NOTE: Second attempt at merging https://github.com/facebook/react-native/pull/32486 (D32080994 (25d4cb98b0)).

This is a fixed version of the https://github.com/facebook/react-native/issues/32380 PR. It solves a typo, prevents variable substitution in the patch file, and moves it to a better place in the script so that CURRENT_ARCH is actually detected before checking whether to patch.

The `config.sub` included in glog is too old and does not recognize `arm64-*` as a valid arch when building. This, combined with an out of date Flipper-Glog version, results in persistent build failures on Apple Silicon machines.

p.s. i assume all the podfile lock changes were caused by me running this on an Apple Silicon Mac, and thus all the pod checksums were run against the arm64 versions of those pods rather than the normal x86_64 versions. if this is an issue I can revert the changes to that file, but it would seem to be an inevitable issue in future PR diffs...

## Changelog

- [iOS] [Fixed] - Apple Silicon builds of glog & Flipper-Glog

Pull Request resolved: https://github.com/facebook/react-native/pull/32486

Test Plan: See `react-native-oss-ios` Sandcastle job succeed.

Reviewed By: fkgozali

Differential Revision: D32256761

Pulled By: yungsters

fbshipit-source-id: c7f32b72287018f070910b26aad02aa0adf4a61f
2021-11-08 21:26:22 -08:00
Mikey daf37a1fce fix: Updated releases/changelog links (#32551)
Summary:
[react-native-community/releases](https://github.com/react-native-community/releases) is on **DEPRECATION ALERT**, update to [reactwg/react-native-releases](https://github.com/reactwg/react-native-releases/discussions) ?

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Changed] - Updated the links for the discussions and changelog

Pull Request resolved: https://github.com/facebook/react-native/pull/32551

Reviewed By: yungsters

Differential Revision: D32244225

Pulled By: cortinico

fbshipit-source-id: d6c72540525484b445b507006a10f2f54baa18d5
2021-11-08 09:25:47 -08:00
Nicola Corti 83116e34bc Fix capitalization of ComponentFactory in RNTester
Summary:
This is a nit, but the capitalization of `ComponentFactory` is wrong
and should be lowercase. I'm fixing it.

Changelog:
[Internal] [Changed] - Fix capitalization of ComponentFactory in RNTester

Reviewed By: ShikaSD

Differential Revision: D32247341

fbshipit-source-id: e8a9f264139f20d85a8e00fad947b2c9465ef630
2021-11-08 09:19:55 -08:00
Nicola Corti 0f39a1076d Make the `reactNativeArchitectures` property more discoverable
Summary:
I've unified the function that is responsible of getting the `reactNativeArchitectures` property
to a single one (ideally we could move it inside the Gradle Plugin in the future).
I've also added a property in the `gradle.properties` file. This makes easier for users to customize the
architecture to build without having to specify a CLI flag or edit multiple gradle files.

Changelog:
[Android] [Added] - Make the `reactNativeArchitectures` property more discoverable

Reviewed By: ShikaSD

Differential Revision: D32244997

fbshipit-source-id: 33180544400f9abe63e9b539ff16fefa17a024ba
2021-11-08 07:21:08 -08:00
Nicola Corti d70555ff0e Fix Release build of RNTester
Summary:
Currently the release build of RNTester is broken
as it's loading the debug native libraries. I had to create
separate tasks for the two variants as we can't benefit
of automatic variant matching between project (as of now till
we use prefabs or find another approach).

Changelog:
[Internal] [Fixed] - Fix Release build of RNTester

Reviewed By: ShikaSD

Differential Revision: D32203637

fbshipit-source-id: 5c260a365626e9b3c66e76166086711236a38264
2021-11-08 04:33:33 -08:00
Luna Wei ec84a56da6 Don't fail this test when we can't post
Summary:
Changelog: [Internal] - Don't fail build_npm_package when there is no PR environment set to post the link to.

The script will fail with an error thanks to changes: 86491749ee

Reviewed By: fkgozali

Differential Revision: D32221758

fbshipit-source-id: ceb7fb654e4c13e195f20e28798e66e6854bcbcd
2021-11-05 17:30:34 -07:00
Luna Wei 68e6788daf Fix npm latest tag issue when releasing patches (#32543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32543

Changelog: [Internal] Fix npm `latest` tag issue that occurs when we release a patch on an older minor version

Context:
* There are two types of tags, git and npm, they are unrelated.

* When we publish a stable release, we set the git tag `latest`. This logic is faulty when we release a patch to an older version.

* When publishing a package to npm, if you don't provide an explicit tag, the `latest` tag will be applied -- at least that's how I've understood the [docs here](https://docs.npmjs.com/cli/v7/commands/npm-dist-tag#description). This again is faulty logic when we release a patch to an older version.

* npm and git's `latest` tag should always point to our most recent stable version

This change:
* Introduces a `--latest` flag for `bump-oss-script` that will indicate that the release we're running (either a stable or pre-release) should really be considered "latest"
* If the version is not a pre-release and the `--latest` flag is set, we will set the git `latest` tag
* Later, in the circleCI job that we use to publish the npm package, we will see if the current commit is git-tagged as `latest`. If it is, then we'll explicitly tell npm to use `latest` tag but most importantly, if it's not, we'll set a tag of the form `{major}.{minor}-stable`.
* This type of tag (ex. `0.66-stable`) is new and the intention is that it will always point to latest of that minor version.

Reviewed By: hramos

Differential Revision: D32196239

fbshipit-source-id: 4c881851eebcad8585732ff0c07322413ac46ce5
2021-11-05 15:09:11 -07:00
Luna Wei 029376c47d Clean up publish-npm.js and use parseVersion
Summary:
Changelog: [Internal] Remove unnecessary logic and new parseVersions function

Changes:
* Remove `tagsForVersions` which in the past got all the tags for the `currentCommit` to figure out which one we're releasing to. I believe this is redundant because the CircleCI envvar `CIRCLE_TAG` should already have the version that we're releasing -- this is set in `bump-oss-version`. Note: this will only be set for full-on releases, (re: not nightly or commitly)
* Re-arrange some logic to group where we set `releaseVersion` and separate where we call `bump-oss-version` script for dryRun (commitly) && nightly builds

Reviewed By: hramos

Differential Revision: D32196237

fbshipit-source-id: 10f21f71bad1ea0496c5eb9094271cc4454a2544
2021-11-05 15:09:11 -07:00
Luna Wei cc1e3abb6e Extract version parsing from release script
Summary: Changelog: [Internal] - extract logic for parsing version in bump-oss-version and add tests

Reviewed By: cortinico

Differential Revision: D32196238

fbshipit-source-id: 6ea7af3d282eea1d876118f056bca94a151e6182
2021-11-05 15:09:11 -07:00
Lorenzo Sciandra 636f614fa9 add changelog entries for 0.64.3, 0.65.2 and 0.66.2 (#32549)
Summary:
lunaleaps did a few patch releases over the last few days. This PR adds the entries for them in the changelog.md file.

## Changelog

[Internal] [Changed] - add changelog entries for 0.64.3, 0.65.2 and 0.66.2

Pull Request resolved: https://github.com/facebook/react-native/pull/32549

Test Plan: N/A

Reviewed By: lunaleaps

Differential Revision: D32205887

Pulled By: cortinico

fbshipit-source-id: c4b173730c6bdf1349c29df26d136aa9f6d4568d
2021-11-05 14:44:04 -07:00
Paige Sun 77ce91822d Minor Style: Make RCTNativeAnimatedNodesManager a non-null class
Summary:
For native animations,
* Add NS_ASSUME_NONNULL_BEGIN / END to RCTNativeAnimatedNodesManager since most of its params are nonnull.

* Explicitly mark nullable params.

Reviewed By: philIip

Differential Revision: D32209819

fbshipit-source-id: c881294d8ba8c2cdcaa931801c977cd5bbe764f4
2021-11-05 14:15:59 -07:00