Commit Graph

443 Commits

Author SHA1 Message Date
David Vacca b28ddede7b Transfer 'DisplayMode' value from Native -> JS
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
2021-04-12 00:05:43 -07:00
David Vacca bdb9a1e094 Add displayMode parameter into startSurface and setSurfaceProps methods
Summary:
This diff extends startSurface and setSurfaceProps methods with the new parameter called displayMode

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D27669847

fbshipit-source-id: c2ddb690ca897e46e00f07b491b91bb2bc8e847d
2021-04-12 00:05:43 -07:00
David Vacca 2793bba278 Move DisplayMode out of SurfaceHandler
Summary:
This diff moves DisplayMode out of SurfaceHandler, this is necessary in order to use it from react/uimanager package

changelog: [internal] internal

Reviewed By: ShikaSD

Differential Revision: D27669846

fbshipit-source-id: 274869d8f2907b1b159f51240440acece09a746f
2021-04-12 00:05:43 -07:00
David Vacca e7b52d7b0b Update initial props when DisplayMode changes in Fabric
Summary:
This diff updates initial props when DisplayMode changes in Fabric. This method will be called during pre-rendering.

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D27607586

fbshipit-source-id: 7625943d57a786d6dfe30dd893e27704f51826d2
2021-04-12 00:05:43 -07:00
David Vacca 680dd36fd1 Introduce new Fabric API setSurfaceProps
Summary:
This diff introduces a new fabric API called setSurfaceProps that will be used to call the new JS api "setSurfaceProps"

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D27607588

fbshipit-source-id: 36a19f728af244d7e72687d9305b1c568e2b8ec6
2021-04-12 00:05:43 -07:00
Joshua Gross c91e32b050 Differ: introduce breadcrumb logging
Summary:
Introduce a new debugging mechanism for the debugger. Outside of debug mode (you must defined `DEBUG_LOGS_BREADCRUMBS` manually to enable this feature) it will have no cost or binary size.

When the debug mode is enabled, it allows you to trace the call stack to trace what the differ is doing, making logs more useful.

Motivation: tracking down a tricky bug caught by D27585136 which originates in the differ.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27667885

fbshipit-source-id: ef75a9a1c8890f9bbe3e5b2e8a8ffcde92fb22c2
2021-04-09 10:30:15 -07:00
Ramanpreet Nara c4c34a1237 Delete RCTTurboModuleManagerDelegate getTurboModule:initParams
Summary:
D27316129 made it mandatory for all RCTTurboModules to have a getTurboModule: method. So, there's no need to keep the getTurboModule:initParams method in RCTTurboModuleManagerDelegate. So, to simplify the TurboModule infra, this diff gets rid of that TurboModuleManager delegate method.

Changelog: [iOS][Removed] - Delete RCTTurboModuleManagerDelegate getTurboModule:initParams

Reviewed By: fkgozali

Differential Revision: D27316873

fbshipit-source-id: c0b8449c6088bf08f17ba9a8d1c2cb644e5a242d
2021-04-08 21:15:53 -07:00
Ramanpreet Nara e0b8f5080f Make RCTTurboModule getTurboModule: required
Summary:
## Rationale
There are two ways to associate NativeModule ObjC objects with ObjCTurboModule jsi::HostObjects:
1. Via the NativeModule ObjC class's `getTurboModule:` method.
2. Via the TurboModule manager delegate's getTurboModule:initParams: method.

There's no good reason to support both options. So, this diff stack removes 2, and make 1 mandatory for all RCTTurboModules. Not only will this simplify the infra, but it should also help eliminate a class of runtime errors in the TurboModule standalone app migration: you forget to implement the getTurboModule: method.

Changelog: [iOS][Changed] - Make RCTTurboModule getTurboModule: required

Reviewed By: PeteTheHeat

Differential Revision: D27316129

fbshipit-source-id: baccd155b8c191d0f961b316db552bdfdbeb0a97
2021-04-08 21:15:53 -07:00
Ramanpreet Nara 3f38186b78 Codemod: Give legacy cxx and ObjC-only NativeModules a getTurboModule: method
Summary:
We're making the getTurboModule: method required for all classes that conform to RCTTurboModule.

Many of our ObjC-only and Cxx NativeModules don't implement this method. This diff implements a getTurboModule: method on all those modules that returns nullptr.

**Question:** Why is it fine to make ObjC-only NativeModules return nullptr from their getTurboModule: method?
- Because they're only accessed from ObjC, and should appear as null on the JavaScript side. Longer term, these NativeModules will also go away.

**Question:** Why is it fine to make Cxx NativeModules return nullptr from getTurboModule: method?
- Because after D27316872, the TurboModuleManager checks if the module is a CxxModule first. If it is, we do an early return, and never call the module's getTurboModule: method.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D27316871

fbshipit-source-id: bc693f2927ab3b0de24e6e9e7699390ec0f7d729
2021-04-08 21:15:52 -07:00
Ramanpreet Nara 6a5e98a84c Stop calling getTurboModule:initParams in RCTTurboModuleManager
Summary:
We're going to make RCTTurboModule getTurboModule: required in D27316129. So, RCTTurboModuleManagerDelegate getTurboModule:initParams is no longer necessary.

## Changes
1. Makes TurboModuleManager stop calling RCTTurboModuleManagerDelegate getTurboModule:initParams
2. Makes getTurboModule: have the lowest priority. So, Cxx NativeModules with a getTurboModule: method won't have their getTurboModule: method executed.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D27316872

fbshipit-source-id: a024e55b8e3692d7117420007dd3947ecfd5019c
2021-04-08 21:15:52 -07:00
Samuel Susla 0b8731d40d Add config flag for RuntimeScheduler
Summary:
Changelog: [internal]

Add config flags for RuntimeScheduler. Even with the flags, React will not be using it. Further changes on React side will be required.

Reviewed By: mdvacca

Differential Revision: D27616916

fbshipit-source-id: 296a040c2b6dd936dd9582e937e6db75e28f31a4
2021-04-08 10:29:07 -07:00
Joshua Gross 49b6c60bc0 EZ: fix up LayoutAnimation logs
Summary:
Make these logs more readable/useful and add debug print of ShadowView hashes in one place.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27585135

fbshipit-source-id: 5f526856d893c32015d8b480522580732fda0cc6
2021-04-08 10:06:48 -07:00
Joshua Gross 3824c565bf ShadowView hash: add surfaceId and LayoutMetrics
Summary:
Turns out that ShadowViews that have different LayoutMetrics will have the same hash. Fix that.

This helps for debugging LayoutAnimations.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27585133

fbshipit-source-id: f0ac50619115150339089276e34fee5ddd0270bc
2021-04-08 10:06:48 -07:00
Micha Reiser dde48fd554 Use mock clock
Summary:
Change the `TransactionTelemetryTest` to use a mock clock or change the tests to only test if at least x amount of time has passed.

Using a mock clock is the only way to make the test deterministic and be able to assert on the sub-results of the captured phases.

Changelog: [Internal] Change to the `TelemetryTest`. Neither changes the runtime behavior nor the API.

Reviewed By: sammy-SC

Differential Revision: D27618448

fbshipit-source-id: 0cbf51b050aabb75341112ea4a43bea0115082f9
2021-04-08 09:27:18 -07:00
Micha Reiser 46acfcb8fc Allow swapping the clock implementation for TransactionTelemetry
Summary:
The `TransactionalTelemetryTest`s are flaky because they use a real clock and assert on how much time has passed (with a threshold, but that's no good either).

Using the real clock in the test is the cause for the test to be flaky because it depends on the assumption that it's the sole process running, never risking to be put in the process-queue of the OS. However, that's not the case and is why the test sporadically fails if the OS decided to schedule other threads/process in the middle of the test.

This diff allows parametrising the `TransactionTelemetry` class with the clock implementation so that tests can use a Mock Clock if desired (separate diff).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D27618516

fbshipit-source-id: 5a08e115b388398ca2b05b9d5ae0fd281dfe3b04
2021-04-08 09:27:18 -07:00
Samuel Susla eb13baf2a6 Introducing RuntimeScheduler module
Summary:
Changelog: [internal[

Introducing RuntimeScheduler. A coordinator of work between native and React.

Reviewed By: mdvacca

Differential Revision: D27616818

fbshipit-source-id: e90d3d9ca8907be99e61f69e62e83cece8155050
2021-04-08 04:07:34 -07:00
Ramanpreet Nara f525ec0fe5 Remove assertions in ~Scheduler and ~SurfaceHandler
Summary:
~Scheduler and ~SurfaceHandler both contain react_native_asserts that trip whenever we reload React Native with Fabric enabled. These asserts trip because of a memory leak in Fabric. These asserts do not run in production. We should fix the memory leak before re-enabling these assertions.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D27481220

fbshipit-source-id: 15c3d46f7efab9ed67a70714efe44b74b0acd385
2021-04-07 19:37:59 -07:00
Micha Reiser 28ed660c2d Use EXPECT_NEAR to improve test failure messages
Summary:
The current test failures don't include the values passed to `EXPECT` which makes it difficult to understand if the test ended earlier or later then expected.

```
Failure: Value of: (commitDuration >= 1000 - threshold) && (commitDuration <= 1000 + threshold)
  Actual: false
Expected: true
```

This diff uses the gtest `EXPECT_NEAR` to get exception messages including the delta:

```
Failure: The difference between telemetryDurationToMilliseconds(telemetry.getTextMeasureTime()) and 600 is 153, which exceeds threshold, where
telemetryDurationToMilliseconds(telemetry.getTextMeasureTime()) evaluates to 753,
600 evaluates to 600, and
threshold evaluates to 70.
```

This doesn't change the test's flakiness because of how sleep is implemented.

Changelog: [Internal] Test only change

Reviewed By: sammy-SC

Differential Revision: D27595206

fbshipit-source-id: f31bdd92ecc7271c9491dda18639ea08820f5730
2021-04-07 01:31:47 -07:00
David Vacca 2182efaf7c Change values of DisplayMode enum
Summary:
Changing back the values of DisplayMode, visible is the default value, it should be 0

changelog: [internal] internal

Reviewed By: ShikaSD

Differential Revision: D27596595

fbshipit-source-id: e5a17e22dc04d380f584bbb816106ab7d3388875
2021-04-06 10:58:58 -07:00
David Vacca 75c4920a0e Use explicit values in SurfaceHandler enums
Summary:
quick refactor to use explicit values in SurfaceHandler enums

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D27571543

fbshipit-source-id: 070c527b6a482979efd7289313a3491d16b401f8
2021-04-06 03:47:06 -07:00
Samuel Susla e9765a7f21 Remove last uses of UnsharedShadowNode
Summary:
Changelog: [internal]

`ShadowNode::Unshared` is preferred over `UnsharedShadowNode`. This diff removes last uses of the alias.

Differential Revision: D27407197

fbshipit-source-id: aa1440f80dcab523d61c186f2d3ce052f314e52c
2021-04-05 11:48:56 -07:00
Samuel Susla 7ee2a998f0 Avoid copy of shared_ptr in ConcreteComponentDescriptor::adopt
Summary: Changelog: [internal]

Differential Revision: D27406634

fbshipit-source-id: f01422ebbcfd89337b98c4e6144aed7a2b9914b8
2021-04-05 11:48:56 -07:00
Joshua Gross cb37562f83 Remove abort in props parsing
Summary:
Goals are:

1. Catch errors in parsing during dev-mode in a way that is disruptive/grabs attention, but has enough information.
2. Use react_native_assert for hitting breakpoints (less useful for Android, more for iOS), and add LOGs for when this code is used in Android (more useful for Android, less useful for iOS).
3. Return sane defaults so that prod cases don't crash, and don't return totally garbage data.

I also found a couple cases where parsing was incorrect before; see WritingDirection and TextAlignment. This could impact some layouts and RTL/LTR potentially.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D27540903

fbshipit-source-id: 99e6949d97e8ef5520d008c1df3cbe408b5a43a4
2021-04-02 16:31:13 -07:00
Joshua Gross 3d1afbbda3 destroy callbacks even if they aren't called, when java object is destroyed
Summary:
JSI callbacks are only destroyed if the callback is called. If the callback is never called, we're potentially leaking a lot of callbacks.

To mitigate this, we add a wrapper object that is owned by the std::function. Whenever the std::function is destroyed, the wrapper is destroyed and it deallocates the callback as well.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D27436402

fbshipit-source-id: d153640d5d7988c7fadaf2cb332ec00dadd0689a
2021-04-01 16:28:26 -07:00
Samuel Susla 0901830977 Fix default values of snapToEnd and snapToStart in ScrollViewProps
Summary:
Changelog: [internal]

Default value for `snapToEnd` and `snapToStart` was incorrect in Fabric. This makes no practical difference as default value is never used (JavaScript always sets true or false).

Default value of `snapToEnd` is true.
https://reactnative.dev/docs/scrollview#snaptoend

Default value of `snapToStart` is true.
https://reactnative.dev/docs/scrollview#snaptostart

Reviewed By: PeteTheHeat

Differential Revision: D27505377

fbshipit-source-id: 73e88aa6ad13a851b8c401e9716fc9a650ec0098
2021-04-01 12:06:35 -07:00
Samuel Susla e42ffdd859 Add support for text copy to Paragraph component
Summary:
Changelog: [internal]

Add support for copying text. The implementation is copied over from old React Native renderer.

Reviewed By: JoshuaGross

Differential Revision: D27502474

fbshipit-source-id: 0d0df583f1adc584ca47e987f06bf78c32386fcc
2021-04-01 10:43:52 -07:00
Joshua Gross 184b372720 Comment out debug-only block causing build failures
Summary:
Temporarily disable due to build failures.

This is debug-only and I've never hit these asserts, so this should be safe; though it should be reenabled during active development of LA.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27505224

fbshipit-source-id: b3d6d2184d8f226d6f82d3fe0ae6303813c8356a
2021-04-01 09:44:29 -07:00
Samuel Susla be397882a2 Make ConcreteComponentDescriptor::createFamily non-virtual
Summary:
Changelog: [internal]

This method is not designed to be subclassed. Let's make it non-virtual.

Reviewed By: JoshuaGross

Differential Revision: D27464824

fbshipit-source-id: b3186d1c4cf03226005f9a3caa9c002011798faa
2021-04-01 06:59:42 -07:00
Samuel Susla 3a3b61ce71 Use nested namespaces in UIManager module
Summary:
Changelog: [internal]

Use nested namespaces in UIManager module.

Reviewed By: JoshuaGross

Differential Revision: D27462611

fbshipit-source-id: 626510bf72a18303de55e5db3e13db4f415d799e
2021-04-01 04:50:59 -07:00
Samuel Susla 9ef995a14a Enable C++ 17 in React Native
Summary:
Changelog: [Internal] enable support for C++ 17.

C++ 17 in React Native targets.

Short and comprehensive list of C++ features:
https://github.com/AnthonyCalandra/modern-cpp-features#c17-language-features

Reviewed By: JoshuaGross

Differential Revision: D27431145

fbshipit-source-id: e8da6fe9d70e9b7343a8caec21cdbeb043478575
2021-04-01 04:50:59 -07:00
Joshua Gross eb59cc2636 Queue DELETE instructions for virtual nodes
Summary:
To ensure that we're eventually deleting all ShadowViews from the StubViewTree and from the mounting layer, make sure that we always queue conflicts if they're DELETE instructions, including for virtual nodes.

I was able to hit this by running some extremely complex animations. It is extremely unlikely that even a single user is hitting this in prod. Therefore, while this is the right change to make, I don't expect (for example) OOMs to go down at all.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27492935

fbshipit-source-id: bce332feb15229af271cc6e14b8367ebcb36536b
2021-03-31 21:33:06 -07:00
Joshua Gross 8f52fb24ec Make mutation sorting more clear
Summary:
This is more insurance against future changes than fixing any existing bugs. In a very small number of cases it looks like this sorting isn't working, for reasons that are not easily reproducible (way less than 1 in 10000 times for me, if that) and not obvious, since we're sorting vectors in a canonical and straightforward way.

Again, this insures that logic won't change in the future.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27492936

fbshipit-source-id: 7f47e44ac1101915e1a0433c8f0a50a3c6a0c7b3
2021-03-31 21:33:06 -07:00
Joshua Gross e9ff6d8bca Print ShadowView hash when displaying instructions
Summary:
When displaying instructions in debug logs, also print ShadowView hash to make it easier to reconstruct a series of events.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27492938

fbshipit-source-id: 276a080a4afcfb4aa0aafc215e2ccd56ef849fcf
2021-03-31 21:33:06 -07:00
Joshua Gross 638e788e06 Improve StubViewTree logging when comparisons fail
Summary:
Currently we compare StubViewTrees only in contexts where equality is expected. With additional debug flags turned on, we print a verbose summary of differences between trees.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27492937

fbshipit-source-id: 6851c2a4056cdbc9ae790070a3d86bb3f2b462fe
2021-03-31 21:33:05 -07:00
Joshua Gross 64c93977bd Log ShadowView hash with verbose StubViewTree logs; and when StubView comparisons fail
Summary:
Improve debuggability of ShadowViewTree failures by logging ShadowView hashes. This allows us to track down exactly where a change to the tree was introduced.

If necessary, if specific repros are found, logging can also be added to LayoutAnimations or other places to find out where a specific ShadowView version (identified by hash) was introduced.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27488766

fbshipit-source-id: f4866f771fc6494435fb46f09953ea69fb280a5b
2021-03-31 21:33:05 -07:00
Joshua Gross f6168d2661 Bail out of createInterpolatedShadowView if generated props are null
Summary:
We have no evidence of this happening, but it matches other bail-out cases that already exist in this function. If we
fail something that would have been an assert in debug mode, bail out so we don't return garbage values in production.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27449775

fbshipit-source-id: 5b85016c9611484b615debec514d12a984e6b1ff
2021-03-31 21:33:05 -07:00
Joshua Gross 01f7d4f720 Refactor duplicated code into queueFinalMutationsForCompletedKeyFrame
Summary:
This chunk of code is repeated 3x in the codebase with minor variations. Consolidate as `queueFinalMutationsForCompletedKeyFrame`.

Should be no changes in behavior.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407766

fbshipit-source-id: 196f0d4c7868007f0d103b024feb4450640a3f62
2021-03-31 21:33:05 -07:00
Joshua Gross 17c3846838 Only run assert-only path in debug mode
Summary:
This probably won't compile outside of debug mode, because variables are unused outside of asserts. Don't do any of this outside of debug mode.

This path is also a pessimisation, we shouldn't need to run it unless we're running in ultra-conservative debug mode.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407767

fbshipit-source-id: 71a8d025463c85d65cd2bc193a19953b97669d84
2021-03-31 21:33:05 -07:00
Joshua Gross 61d59fff23 Add additional debug logging in LayoutAnimationDriver
Summary:
Log final when synthetic final mutations are generated at the end of an animation.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407768

fbshipit-source-id: 0e9aface54bcca73dfa5ea263a8474db7c47c078
2021-03-31 21:33:04 -07:00
Joshua Gross 92b8075120 Recursively clean up conflicting animations
Summary:
Call getAndEraseConflictingAnimations recursively, to clean up any conflicting animations.

With a specific sequence of mutation instructions, it is possible that an animation on a tree is set up, and the entire tree needs to be cleaned up if a parent is deleted, say.

This can happen especially if rapidly mutating trees in such a way that invokes view flattening and unflattening (which is not recommended, but is certainly possible).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407776

fbshipit-source-id: 5125250f051c58870692f8fdc43ed23da5058a7f
2021-03-31 21:33:04 -07:00
Joshua Gross ec51737814 Update StubViewTree logging for debugging on Android
Summary:
When playing around with issues in debug mode but without having a debugger attached, these logs are helpful.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407772

fbshipit-source-id: 2083901094d3bd2b0b6c6799baffcf5a60cf57ae
2021-03-31 21:33:04 -07:00
Joshua Gross ae264b995f Update 'viewPrev' as well as 'viewStart' when transitioning from one animation to another
Summary:
When reconstructing a second animation based on a conflict with a first, we want to ensure we set 'viewPrev' of the second animation properly.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407777

fbshipit-source-id: 8fcc72c4c5fadaab4287824a944ad21230f2f97d
2021-03-31 21:33:04 -07:00
Joshua Gross 9ea0020054 For certain types of conflicts we do *not* want to generate a final UPDATE mutation
Summary:
In general, when an animation is interrupted or completed, we want to forcibly "flush" an update that will make the StubViewTree/mounting layer consistent with the ShadowTree.

However, in cases where a conflict creates a second animation and stops the first, we simply updated the "viewPrev" of the second animation and smoothly transition to it.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407774

fbshipit-source-id: 928363867d8994c9d69c53154a07bda94f954afa
2021-03-31 21:33:04 -07:00
Joshua Gross 22c9b7d520 If a parent node is DELETEd or CREATEd, immediately end animation
Summary:
Detect conflicts not just when a node is updated, but when its parent is DELETEd or CREATEd.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407781

fbshipit-source-id: 719d9a8822bf691d9059073a30d8b5ccb50eece1
2021-03-31 21:33:04 -07:00
Joshua Gross 63c0be55d5 EZ: Make StubViewTree "Delete" logs consistent with other logs
Summary:
See title.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407771

fbshipit-source-id: 456cdeb65ab02d6e0ea61aa5e7cce288466e2cf5
2021-03-31 21:33:04 -07:00
Joshua Gross 4ae1a9bea8 Do not check consistency of updated Virtual views
Summary:
This impacts Android only. It's not high-impact to check the consistency of these views and they can become "inconsistent" easily in a way that is not interesting or useful to us,
since we handle "virtual" views differently on the platform.

The need for these hacks should go away in the future if/when we account for virtual views in the differ, and stop sending redundant instructions entirely.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407779

fbshipit-source-id: 01a7ea5106ed5d94b908de03a6a710cc6275018d
2021-03-31 21:33:04 -07:00
Joshua Gross f915ca99be EZ refactor
Summary:
pull out tag so it's easier to read

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407770

fbshipit-source-id: e7d2a3ce8e4ac55b6446cddc8c39e73a18fa7170
2021-03-31 21:33:04 -07:00
Joshua Gross 706a223dd2 Refactor LA: keyFrames have N "final items" to execute
Summary:
One of the struggles with the LA engine is to make sure that LA doesn't break the StubViewTree. In particular, we have strict requirements that the "oldShadowView" with every mutation matches exactly what is in the shadow tree, so it appears that there is a linear progression of ShadowNodes for every mutation instruction.

This is a struggle to do with the current setup, requires some wacky code, and doesn't work properly. Instead of spreading REMOVE/DELETE (especially) or INSERT/UPDATE instructions across multiple keyframes, we now allow keyframes to have multiple "final" instructions to execute,
which makes it much easier to keep state consistent.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27407769

fbshipit-source-id: 3a709503dc30be69efc345690cb1920eb9591e9a
2021-03-31 21:33:04 -07:00
Peter Argany 679f38f1c5 Pass RCTEventDispatcher to RCTComponentData [6/n]
Summary:
Problem: `RCTComponentData` accesses event dispatcher via `_bridge.eventDispatcher` which won't work in bridgeless mode

Solution: Pass  `_eventDispatcher` through init

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27447532

fbshipit-source-id: 7e39b4f6a57d789df493590538248abb204036a3
2021-03-31 16:39:02 -07:00
Peter Argany 4efdf264d1 Introducing RCTWeakViewHolder [4/n]
Summary:
Problem: In paper, there is a handy API called `[uiManager viewForReactTag:]`. Fabric does not have this mapping. The Fabric interop layer still relies on this Paper mapping.

Solution: As a workaround, re-create this mapping in the Fabric interop layer. Therefore, whenever Fabric interop layer asks a paper view manager to create a view, store a weak reference to the view in a `NSMapTable`. NSMapTable allows us to customize the strong/weak relationship. I've added a comment explaining that `RCTWeakViewHolder` only needs to be used for this special circumstance.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27438899

fbshipit-source-id: 94663ef06479a8c863ce58b0f36d42109fa1c4f3
2021-03-31 16:39:02 -07:00