Commit Graph

6 Commits

Author SHA1 Message Date
Valentin Shergin e56950dc65 Fabric: componentregistry module was decoupled from uimanager
Summary:
We need to break up the `uimanager` module in order to solve circular dependencies problem (which future diff would have otherwise).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D20885163

fbshipit-source-id: 08eb1ba1d408fc0948e8d0da62380786a40973af
2020-04-18 15:00:21 -07:00
Valentin Shergin b39c75f20e Fabric: Element<> now returns (and accepts) mutable (non const) shared pointers
Summary:
It makes perfect sense because `Builder` builds totally new shadow trees, so those are not sealed or used by anyone yet.
Assigning it to const shared pointer will do logical sealing (and it does not requires const-cast).
Fewer const-casts in the code, fewer bugs.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19596284

fbshipit-source-id: 75d1c706034958ba7e4bc80a68af75a57c46eb6f
2020-01-30 19:45:39 -08:00
Valentin Shergin d64bf2c4f8 Fabric: Element<X>::children() now accepts children of any Element<> type
Summary:
Before this change `Element<X>` cannot have children of `Element<Y>` which was wrong because we don't have such limitation in Fabric.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19596283

fbshipit-source-id: 9002f5dd42b3d05e7cf492499499399c97b58152
2020-01-30 19:45:39 -08:00
Valentin Shergin 42be1aad82 Fabric: Making ComponentBuilder copyable and movable
Summary:
It's useful property to have.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19596280

fbshipit-source-id: 5b60cc4f7c65c3458ff35ffa2dfaafce79dc985a
2020-01-30 19:45:38 -08:00
Valentin Shergin 5b2ea6ec6a Fabric: Remove const qualifier from all fields of ViewProps and Props
Summary:
This is a part of migration staterted in D19390813.
There is no need to have those as `const`. The whole `*Props` object is usually `const` (and when it's not, props should not be too).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D19583582

fbshipit-source-id: 9c680268f944cdf08669fce7e997b05f23a02667
2020-01-27 13:19:35 -08:00
Valentin Shergin 6a1438c044 Fabric: Element<>, a declarative way to describe a component hierarchy
Summary:
`Element` is an abstraction layer that allows describing component hierarchy in a declarative way. Creating `Element`s themself does not create a component tree (aka `ShadowNode` tree) but describes some hierarchical structure that might be used to build an actual component tree (similar to XML Elements).

`Element<>` provides some basic type-safety guarantees: all modifications of element objects require using objects (such as Props or State) of compatible type.

For now, the only useful application of that is building tests.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19512392

fbshipit-source-id: eb0711c2a537865fa5454dbede53412a135058cf
2020-01-22 11:05:42 -08:00