Summary:
23d9bf1a24 looks like it accidently removed `localeIdentifier` from I18nManager.
## 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] - Re-added localeIdentifier to I18nManager constants
Pull Request resolved: https://github.com/facebook/react-native/pull/31589
Reviewed By: GijsWeterings
Differential Revision: D28690202
Pulled By: fkgozali
fbshipit-source-id: 543a491f89789bca5629e1251c94fd055ec4a801
Summary:
Some components are using `LogBoxData` directly, forcing logs to be shown on the screen even when LogBox is uninstalled. This changes all accesses to `LogBoxData` to go through `LogBox` so `uninstall` is used correctly.
It also changes when LogBox is installed, moving it from `AppContainer` to `InitializeCore` (which happens earlier) so we can capture more logs in LogBox.
Changelog: [General][Changed] Initialized LogBox earlier and centralized access in LogBox module
Reviewed By: rickhanlonii
Differential Revision: D27999361
fbshipit-source-id: 1115ef6b71e08cc33743d205da0064fbe9a74a0e
Summary:
This diff reports warning when a method of the LazyUIManager is called when using fabric and StaticViewConfigs enabled
changelog: [Android][changed] Deprecate UIManager methods when using the new architecture enabled
Reviewed By: fkgozali
Differential Revision: D28108804
fbshipit-source-id: 4b430bdefa67914883a595dff97ea6c9ffd93361
Summary:
In development, we can specify a debug name to force the whole React tree to have a meaningful name. This is useful for debugging: React DevTools, component stack traces, etc. More context in D26637787 (eeb36f4709).
This worked fine until now because `renderApplication` is never called more than once per React Native root. With pre-rendering, this won't be true as we'll be able to re-render the whole React tree with new props (after navigating to the screen).
The problem with the current implementation is that we generate a new component every time `renderApplication` is called, which makes the React reconciliation consider them different components and discards the whole sub-tree.
This fixes it by caching those components so we always return a component with the same identity (exactly the same function) when we call `renderApplication` repeatedly.
This won't have any effect in production where these components aren't created at all.
Changelog: [Internal]
Reviewed By: ShikaSD
Differential Revision: D28061384
fbshipit-source-id: 95833a5b74bb622896cb47426f74324d8740e5d7
Summary:
Changelog:
[General][Changed] Make the RootTag an opaque type
Reviewed By: yungsters
Differential Revision: D27992320
fbshipit-source-id: 2901f0e59f573106295b986fe04db227134235da
Summary:
This diff adds a new variable called "DisplayMode" into SurfaceHandler.cpp and FacebookAppRouteHandler.js. The purpose of DisplayMode is for the native pre-render system to notify React that the a surface is either being "pre-rendered" or "rendered"
When the surface is being "pre-rendered" (displayMode == "SUSPENDED"), react will create and commit React Trees, but it will not execute use-effect callbacks
When the surface is being "rendered" (displayMode == "VISIBLE"), react will create and commit React Trees and it will not execute all use-effect callbacks that weren't executed during "pre-rendering"
By default surfaces are going to be rendered with displayMode == "VISIBLE".
This diff should not create any change of behavior for now, this is the infra required to integrate the new offScreen API the react team is working on for pre-rendering system
changelog: [internal] internal
Reviewed By: yungsters
Differential Revision: D27614664
fbshipit-source-id: f1f42fdf174c2ffa74174feb1873f1d5d46e7a95
Summary:
This diff introduces the new function "setSurfaceProps" in SurfaceRegistry and AppRegistry
This new method will be used to update initialProps of a surface at the root level. In the near future this will be useful to integrate the OffScreen API component in pre-rendering
changelog: [internal] internal
Reviewed By: JoshuaGross
Differential Revision: D27607587
fbshipit-source-id: 3cc58c51924feb68f6a24bf762986c57f9a245ae
Summary:
This NativeModule will now be type-safe, and TurboModule-compatible.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D26956332
fbshipit-source-id: 6651a003c70819934869dd6a8c664ef984d0efcb
Summary:
Changelog:
[General][Added] - Added `debugName` parameter to `renderApplication` to use as the display name for the React root tree
Reviewed By: rickhanlonii
Differential Revision: D26637787
fbshipit-source-id: 3ddc037573f4434101a9d3dcb5592a127193481c
Summary:
Removing log in PaperUIManager since this is logging warn messages for "Text" components
changelog: [internal] internal
Differential Revision: D26315745
fbshipit-source-id: 8871148b0fc1791e1723962f1f2477cd5e0c562d
Summary:
FabricUIManager does not support it, the declaration is not correct.
Changelog: [Internal] Fabric-specific internal change.
Created from Diffusion's 'Open in Editor' feature.
Differential Revision: D26241483
fbshipit-source-id: 8a894dc847bce9c196d8ac2e1601853e4fe03e1d
Summary:
When NativeUIManager.getConstantsForViewManager throws an exception from native, we just swallow that exception and set null as the view config. Instead, we should log that an error occurred. This way, we can tell if the NativeModule sync method call returned undefined, or if the NativeModule sync method call thew an exception.
I'll take a look and see if we can add this logging higher up in the native stack, so that we can actually capture the stack information from this NativeModule sync method call failure.
Created from Diffusion's 'Open in Editor' feature.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D26227379
fbshipit-source-id: 02b516d247f82f873f059005e6a2cc6f2a64fdb5
Summary:
ES Modules implicitly enable strict mode. Adding the "use strict" directive is, therefore, not required.
This diff removes all "use strict" directives from ES modules.
Changelog:
[Internal]
Reviewed By: motiz88
Differential Revision: D26172715
fbshipit-source-id: 57957bcbb672c4c3e62b1db633cf425c1c9d6430
Summary:
`sendAccessibilityEvent_unstable` is a cross-platform, Fabric/non-Fabric replacement for previous APIs (which went through UIManager directly on Android, and a native module on iOS).
Changelog: [Added] sendAccessibilityEvent_unstable API in AccessibilityInfo and sendAccessibilityEvent in React renderer
Reviewed By: kacieb
Differential Revision: D25821052
fbshipit-source-id: 03f7a9878c95e8395f9102b3e596bfc9f03730e0
Summary:
This diff removes the call to UIManager.getViewManagerConfig into the deprecatedPropType method when static view configs are enabled
This was necessary to avoid innecessary calls to UIManager.getViewManagerConfig and to avoid loading UIManagerModule classes when static view configs are enabled
changelog: [internal] internal
Reviewed By: fkgozali, yungsters
Differential Revision: D26040855
fbshipit-source-id: 82cad9f4abe9898e781fd989ebaa03497dad926b
Summary:
This diff refactors the StaticViewConfigsPaperUIManager to avoid loading NativeUIManager.
This is part of a experiment to prevent loading UIManagerModule class in native.
changelog: [internal]
Reviewed By: JoshuaGross
Differential Revision: D25630215
fbshipit-source-id: 40d6f3b36ad4c3377820b1dcf0bd949db063d899
Summary:
As part of the initialization of Native View configs, the PaperUIManager.getViewManagerConfig() method calls the native side to lazy initialize iOS Native components. This is necessaary to make ensure that native classes are loaded and initialized before a view is created.
Note that this requirement is only necessary when Fabric is disabled.
As part of JS ViewConfigs, we removed the native call to lazy initialize iOS native components. This causes a crash during the creation of NativeViews when JS ViewConfigs are enabled and Fabric is disabled. The rootcase of the exception is that native classes are not properly initialized when the createView method is executed in iOS.
This diff forces the lazy initialization of iOS Native components when JS View configs are enabled and Fabric is disabled. This new mechanism is executed as part of the creation of views and it's ONLY going to be executed when the user navigates to a NON-FABRIC screen, JS ViewConfigs are enabled and the component is not initialized yet.
The extra cost should be minimal or zero.
changelog: [internal] internal
Reviewed By: fkgozali
Differential Revision: D25387014
fbshipit-source-id: fe3bc42f803a805192b419bfb4b7a6b5b1b71b60
Summary:
As titled - attempt to mitigate a JS error on iOS while we work on getting JS view configs. It seems like this happens when the bridge is invalid.
Changelog: [Fixed][iOS] Don't throw an error if the UIManager returns null when fetching a view config
Reviewed By: kacieb
Differential Revision: D25247203
fbshipit-source-id: e2003f99b818f9657c60ff95b266be74fe18a94b
Summary:
Updates `ReactScrollViewManager` and the `ViewConfig` for `ScrollView` so that they are equivalent.
- `inverted` was missing.
- `contentOffset` was missing differ on Android. (However, there does not seem to be any perceivable behavior difference besides the native `ViewConfig` being different.)
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D25084470
fbshipit-source-id: 8bea3b7a692c1038819a4147b174583a4faa71e9
Summary:
Changelog:
[General] [Changed] - Added (DEV-only) `displayName` to some RN contexts to make them more easy to differentiate when debugging.
Reviewed By: lunaleaps
Differential Revision: D24993068
fbshipit-source-id: 4904259eda50444c2f74700a3540ff4fd02ac322
Summary:
Adds an annotation in the performance logger that indicates if the component was rendered using Fabric or not.
Changelog: [internal]
Reviewed By: JoshuaGross, ShikaSD
Differential Revision: D24596131
fbshipit-source-id: 489f3a03f09c5425c870678ed593ee8f16a2d98b
Summary:
In theory, view configs can be hierarchical (one can depend on another), at least it was semi-supported on iOS once. And AFAIK there is only one component that seems to use this feature - `RCTComponentHostingView`, all other components essentially inherit RCTView or nothing. At the same time, RCTComponentHostingView does not really need it because RCTComponentHostingView itself does not expose any props.
Changelog: [Internal] Removed outdated warning
Reviewed By: kacieb
Differential Revision: D24095348
fbshipit-source-id: 5629c7433f151b72aae8201c58dd42062990b77e
Summary: Changelog: [Changed] Used scoped performance logger to mark the beginning and end of the call to the renderer, instead of using `GlobalPerformanceLogger`.
Reviewed By: lunaleaps
Differential Revision: D23240784
fbshipit-source-id: 7099f1a4b5da3f29596fcee289a715d295ae0a65
Summary:
Replaces `fbjs/warning` call sites in React Native with `console.warn`. A few warnings will now log as warnings without the "Warning:" prefix.
Changelog:
[General][Changed] - Some warnings changed to use `console.warn` without the "Warning:" prefix.
Reviewed By: TheSavior, cpojer
Differential Revision: D22445946
fbshipit-source-id: 96b01e1bdee52b89ff3b808bc9d6cd494f6787f5
Summary:
Changes dependents of `EmitterSubscription` to instead import the `EventSubscription` type from `EventEmitter.js`.
Changelog:
[Internal]
(Note: this ignores all push blocking failures!)
Reviewed By: cpojer
Differential Revision: D22182309
fbshipit-source-id: 575f4c59248ef50182ddb33911f1e6f3ba88ec07
Summary:
Upgrades dependents of `EventEmitter`, `EventSubscription`, `EventSubscriptionVendor`, and `EmitterSubscription` to use `import` instead of `require`.
Changelog:
[Internal]
(Note: this ignores all push blocking failures!)
Reviewed By: cpojer
Differential Revision: D22182312
fbshipit-source-id: e9444aa2728d89d52f577725f688871f7dbfba8a
Summary:
This diff deletes the deprecated PlayTouchSound method from UIManagerModules.
I verified there are no callsites of this method in Facebook sourcecode
changelog: [BREAKING][Android] Deletes the method PlayTouchSound method from UIManagerModule, this method was moved to the SoundManagerModule class.
Motivation: I'm cleaning up my fabric backlog before lockdown
Reviewed By: JoshuaGross, TheSavior
Differential Revision: D21487612
fbshipit-source-id: f630e2b7f927e0b607a30b9f4904feb63a561ab9
Summary:
Pass a default empty object to `AppContainer` if no `initialProps` were passed to `renderApplication`.
This prevents issues on Android, where we do not pass a default empty `initialProps` from native, as we do on iOS.
Changelog: [General] [Fixed] - Handle nullish `initialProps` correctly in `renderApplication`
Reviewed By: motiz88
Differential Revision: D21448692
fbshipit-source-id: 9630bdc2414532999abf3bf9da25047f0482fcab
Summary:
`renderApplication` receives the root component that we need to render and an optional wrapper component. There are cases where we want to use the initial props passed to the root component in the wrapper component as well (e.g.: to provide a specific context to the root component), so this adds modifies `AppContainer` to accept the initial props and inject them into the wrapper component.
Changelog: [General] [Added] - Modified `renderApplication` to forward `initialProps` to `WrapperComponent`
Reviewed By: fkgozali
Differential Revision: D21347486
fbshipit-source-id: 1c4f702a3875077630de1a44d3ac9ef2c80bc10c
Summary:
Creates a `RootTag` type and refactors the `RootTagContext` module a bit.
This creates space for eventually changing `RootTag` into an opaque type that is only created once by `AppContainer`, and only consumed by native abstractions.
Changelog:
[Internal]
(Note: this ignores all push blocking failures!)
Reviewed By: cpojer
Differential Revision: D21127173
fbshipit-source-id: 60177a6e5e02d6308e87f76d12a271114f8f8fe0
Summary:
## Overview
This diff refactors the Inspector, moving logic to look up view data for a touched view inside the renderer as `getInspectorDataForViewAtPoint`. We then implement that same function for Fabric in order to support the inspector in that renderer.
Requires https://github.com/facebook/react/pull/18388
## Motivation
Reason one for this refactor is that, previously, the inspector held all of the logic to look up view data for a given x,y touch coordinate. To do this, it would take the React tag and coordinates, look up the native view tag, measure it, and then ask React internals for the Fiber information of that tag. All of this is deeply coupled to React internals, yet the logic is outside of React core in the Inspector.
Reason two is that, for Fabric, the logic for getting the view data is different than Paper. In Fabric, we pass the x,y coordinates to native directly, which returns an instance handle. That handle can be used to measure the ShadowNode, or retrieve the Fiber information.
By moving the logic into the renderer in React core, we decouple the implementation details of looking up view data for a tapped point and allow ourselves the ability to add and change renderer-specific code for the actual lookup without impacting outsiders like the Inspector.
Changelog: [Internal]
Reviewed By: TheSavior
Differential Revision: D20291710
fbshipit-source-id: a125223f2e44a6483120c41dc6146ad75a0e3e68
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html
Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.
Reviewed By: zertosh
Differential Revision: D20636268
fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
Summary:
We recently updated React Native's docs site to have its own domain reactnative.dev and needed to update the URLs in the source code
CHANGELOG:
[INTERNAL]
Reviewed By: hramos
Differential Revision: D20072842
fbshipit-source-id: 1970d9214c872a6e7abf697d99f8f5360b3b308e
Summary:
This diff replaces YellowBox with LogBox so that it can be deprecated and removed.
After this diff, it will no longer be possible to go back to YellowBox and all paths referencing it will be gone.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D19949695
fbshipit-source-id: 28a55866e514020bdcc6854aae565cffbbe8af58