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

8 Коммитов

Автор SHA1 Сообщение Дата
Ramanpreet Nara a2ab3fccd0 Migrate RCTNativeAnimatedTurboModule to initialize
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D28595948

fbshipit-source-id: a12207f8e0c11e1e105225404450ff335242aba7
2021-05-21 14:49:51 -07:00
Ramanpreet Nara 1f883192ec Manual: Migrate from bridge.eventDispatcher to RCTModuleRegistry
Summary:
This is an extension of D25449795. I searched for all usages of .eventDispatcher within NativeModules, and migrated them all to the Venice-compatible RCTModuleRegistry API.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25473844

fbshipit-source-id: 2b8deec236e019f3adfb59fadd745c249ff822f4
2020-12-11 10:42:28 -08:00
Scott Kyle 23717e48af Call stopObserving on correct queue
Summary:
Since `dealloc` can be called from any thread, this would result `stopObserving` being called on a different thread/queue than the specified `methodQueue`. We specifically encountered this issue with a module needing the main queue having its `stopObserving` called on a background queue.

Changelog:
[iOS][Fixed] - Call [RCTEventEmitter stopObserving] on specified method queue

Reviewed By: RSNara

Differential Revision: D23821741

fbshipit-source-id: 693c3be6876f863da6dd214a829af2cc13a09c3f
2020-09-21 17:30:34 -07:00
Peter Argany 75197dbb16 Pass RCTSurfacePresenter into RCTNativeAnimatedNodesManager in bridgeless
Summary:
This diff ties the stack together. It completes the long chain of RCTSurfacePresenter ownership:

`FBReactModule` -> `RCTNativeAnimatedTurboModule` (this diff and D23272746)
`RCTNativeAnimatedTurboModule` -> `RCTNativeAnimatedNodesManager` (this diff)
`RCTNativeAnimatedNodesManager` -> `RCTPropsAnimatedNode` (D23272735)

It completes animations working without the bridge.

Changelog: [Internal]

Differential Revision: D23272755

fbshipit-source-id: 137f7ff89993a2cb644bd67869eb685afcec4068
2020-08-24 16:37:50 -07:00
Peter Argany 700960c9f1 Pass SurfacePresenter directly instead of relying on bridge
Summary:
`RCTPropsAnimatedNode` uses the bridge to access it's current surface presenter to perform animations.

In bridgeless mode, the surface presenter is not owned by the bridge. Instead, pass the surface presenter through the ownership chain:
`RCTNativeAnimated*Module` -> `RCTNativeAnimatedNodesManager` -> `RCTPropsAnimatedNode`

`RCTSurfacePresenter` should not be strongly held by any of these animation internals. If it gets destroyed at a higher level, animations should not be completed.

Changelog: [Internal]

Differential Revision: D23272735

fbshipit-source-id: ce08ee3b59ac2ba70e31cebb7ba8e9f3a644c848
2020-08-24 16:37:49 -07:00
Peter Argany e1d53ce697 Create init method for RCTNativeAnimatedModule and it's TM fork
Summary:
The animated native module relies on `setBridge` to perform generic setup which doesn't rely on the bridge at all. This diff refactors that setup code to an `init` function.

Changelog: [Internal]

Differential Revision: D23272427

fbshipit-source-id: 0c9c5522c9044283f4db25360010465ff42aba25
2020-08-24 16:37:49 -07:00
Joshua Gross 73242b45a9 NativeAnimatedModule: allow JS to control queueing of Animated operations
Summary:
In the past I tried a few heuristics to guess when a batch of Animated Operations were ready, and none of these were super reliable. But it turns out we can safely allow JS to manage that explicitly.

Non-Fabric still uses the old behavior which seems fine.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23010844

fbshipit-source-id: 4c688d3a61460118557a4971e549ec7457f3eb8f
2020-08-09 01:39:29 -07:00
Peter Argany d1c3c2d084 Fork RCTAnimatedModule to unblock brideless mode
Summary:
The Animated native module cannot be converted to a TM because it has perf regressions when used in conjunction with Paper renderer. Instead of fixing these complicated perf issues (which will disappear when Fabric ships this half), temporarily fork the native module. The new fork is converted to a TM, and only used to unblock bridgeless mode testing.

Changelog:[Internal]

Reviewed By: RSNara

Differential Revision: D22651010

fbshipit-source-id: 912123ef38ac8c66025b7bba34a65ec6d98f330d
2020-07-27 15:09:33 -07:00