Remove OpenRegion/CloseRegion remark (#12546)
parent
18a078237a
commit
6ab3bda01e
|
@ -5,7 +5,7 @@ description: Learn how to create and use Razor components, including how to bind
|
|||
monikerRange: '>= aspnetcore-3.0'
|
||||
ms.author: riande
|
||||
ms.custom: mvc
|
||||
ms.date: 05/21/2019
|
||||
ms.date: 05/26/2019
|
||||
uid: blazor/components
|
||||
---
|
||||
# Create and use Razor components
|
||||
|
@ -1010,6 +1010,6 @@ This is a trivial example. In more realistic cases with complex and deeply neste
|
|||
|
||||
* App performance suffers if sequence numbers are generated dynamically.
|
||||
* The framework can't create its own sequence numbers automatically at runtime because the necessary information doesn't exist unless it's captured at compile time.
|
||||
* Don't write long blocks of manually-implemented `RenderTreeBuilder` logic. Prefer `.razor` files and allow the compiler to deal with the sequence numbers. If you're unable to avoid manual `RenderTreeBuilder` logic, split long blocks of code into smaller pieces wrapped in `OpenRegion`/`CloseRegion` calls. Each region has its own separate space of sequence numbers, so you can restart from zero (or any other arbitrary number) inside each region.
|
||||
* Don't write long blocks of manually-implemented `RenderTreeBuilder` logic. Prefer `.razor` files and allow the compiler to deal with the sequence numbers.
|
||||
* If sequence numbers are hardcoded, the diff algorithm only requires that sequence numbers increase in value. The initial value and gaps are irrelevant. One legitimate option is to use the code line number as the sequence number, or start from zero and increase by ones or hundreds (or any preferred interval).
|
||||
* Blazor uses sequence numbers, while other tree-diffing UI frameworks don't use them. Diffing is far faster when sequence numbers are used, and Blazor has the advantage of a compile step that deals with sequence numbers automatically for developers authoring `.razor` files.
|
||||
|
|
Loading…
Reference in New Issue