Commit Graph

6 Commits

Author SHA1 Message Date
Joshua Gross 4804e68238 Expose "unreserved" trait constants that can be mapped per-component
Summary:
Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits.

It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components.

Changelog: [Internal]

Reviewed By: cortinico, RSNara

Differential Revision: D30401743

fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066
2021-08-18 13:23:17 -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 270060e1d9 Pass weak pointers to background executor lambda
Summary:
Changelog: [internal]

### Why does the crash happen?

The crash can happen if runtime is destroyed before background executor lambda is run. Destroying a shadow node after runtime leads to a crash through the chain of ownerships.

Chain of ownership:
`ShadowNode -> ShadowNodeFamily -> EventEmitter -> EventTarget -> Pointer`

Pointer tries to call `invalidate` method on raw pointer to the runtime which is gone.

https://www.internalfb.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/ReactCommon/jsi/jsi/jsi.h?commit=2ee3ae0c6a64&lines=335-339

To work around this, weak pointers are passed to lambda. This way the lambda is less likely to be the last owner of shadow nodes. Possibility of race still exists but it less likely to happen.

## Other solution
Alternatively, we could make sure native Runnable queue in Java is emptied as part of tear down process. We can even implement both solutions as they are semantically correct.

Reviewed By: shergin

Differential Revision: D26582554

fbshipit-source-id: b1b8a92237902bc4c40376176f575caa24a41a05
2021-02-22 17:02:19 -08:00
Samuel Susla fc1f0df465 Introducing: Props forwarding whe cloning shadow node
Summary:
Changelog: [internal]

If ShadowNode has not been mounted, forward rawProps from `sourceShadowNode` to newly cloned shadow node.
This is Android specific change, on iOS the logic should remain unchanged.

Reviewed By: JoshuaGross

Differential Revision: D26049264

fbshipit-source-id: 7c201bc2d4e99eec024065714d2172c5c817153c
2021-01-28 11:21:21 -08:00
Valentin Shergin 900c3878e1 Fabric: Removing ShadowNode state revision
Summary:
We don't use it anymore.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D23605897

fbshipit-source-id: 3502726d2b249f75f6c3992b7685869cf7dd154f
2020-09-09 15:08:23 -07:00
David Vacca 1ae76bf0dd Remove inner folders of react/renderer/core
Summary:
This diff removes the inner folder of react/renderer/core, moving all its files into react/renderer/core

This is necessary to simplify the compilation of Fabric in OSS

More details: https://fb.quip.com/amaRA631DX3K

changelog: [internal] Internal

Reviewed By: fkgozali, JoshuaGross

Differential Revision: D22875854

fbshipit-source-id: e2d969c3ec67eab1bbdc9288e5a4285c740fa944
2020-08-01 13:31:03 -07:00