Skip to content

Formatting for view-flattening#2899

Merged
sammy-SC merged 1 commit intofabric-architecturefrom
view-flattening
Dec 23, 2021
Merged

Formatting for view-flattening#2899
sammy-SC merged 1 commit intofabric-architecturefrom
view-flattening

Conversation

@lunaleaps
Copy link
Contributor

Formatting for view-flattening

CleanShot 2021-12-22 at 13 51 24@2x

Copy link
Contributor

@sammy-SC sammy-SC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just left one small comment. Thank you!

#### View Flattening is an optimization by the React Native renderer to avoid deep layout trees.

The React API is designed to be declarative and reusable through composition; this is great for product developers because they can focus on what they want to render instead of how to render on the screen. However, in practice, these qualities of the API lead to the creation of deep React Element Trees, where a large majority of their Nodes only affect the layout of a View and don’t render anything on the screen, we call these types of nodes “Layout-Only” Nodes.
The React API is designed to be declarative and reusable through composition. This provides a great model for intuitive development. However, in implementation, these qualities of the API lead to the creation of deep [React Element Trees](glossary#react-element-tree-and-react-element), where a large majority of React Element Nodes only affect the layout of a View and don’t render anything on the screen. We call these types of nodes **“Layout-Only”** Nodes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "in implementation"? I'm not familiar with this. Does it mean the same as "in practice"?
I tried to google the term but didn't find anything relevant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how you split this into multiple sentences.

@sammy-SC sammy-SC merged commit 4ad880c into fabric-architecture Dec 23, 2021
sammy-SC added a commit that referenced this pull request Dec 23, 2021
#2892)

* Initial draft of new Architecture Section including docs on how React Native's renderer works

* linting language

* changing the IA for architecture section

* update arc overview

* Iterating on Fabric Architecture docs (#2895)

* Add some intro to 'Render,Commit, and Mount'

* Update Fabric Render -> Fabric Renderer

* Split out rendering-implementation into three different docs

* Create a sentence callout for each

* Fix broken links

* Formatting for view-flattening (#2899)

* Updates to xplat-implementation, re: glossary links and fabric terms (#2898)

* Refactor how we layout the scenarios (#2897)

* Format render-pipeline.md (#2900)

* Format fabric-renderer.md (#2901)

* Format fabric-renderer.md

* Anchor fabric-renderer in time

* Add images to Fabric Deep Dive (#2902)

* Resize images in threading model section (#2903)

* Fabric-rendering word tweaks

* Cut a 0.66 version of the architecture and update header

* Word tweaks

Co-authored-by: Luna <luwe@fb.com>
Co-authored-by: Samuel Susla <samuel.susla@gmail.com>
@lunaleaps lunaleaps deleted the view-flattening branch December 23, 2021 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants