Skip to content

feat: support deep freeze in lazy-render#10

Open
doyuli wants to merge 2 commits intoAlfred-Skyblue:mainfrom
doyuli:deep-lazy-update
Open

feat: support deep freeze in lazy-render#10
doyuli wants to merge 2 commits intoAlfred-Skyblue:mainfrom
doyuli:deep-lazy-update

Conversation

@doyuli
Copy link
Copy Markdown

@doyuli doyuli commented Jan 21, 2026

This PR extends the performance optimization capability of LazyRender to support deeper levels of update freezing.

  • Before: When moving out of the viewport, only the updates of direct child components could be frozen. Any nested sub-components or recursive structures continued to run in the background, consuming CPU resources.

  • After: Introduced a recursive detection mechanism. By walking through the component tree, even grandchildren or infinite recursive components can now be precisely "frozen" when leaving the viewport.

Its deep behavior can be controlled via props.deep

  • deep: false: Maintains original behavior, freezing only the immediate child.

  • deep: true: Enables full recursive freezing for the entire component subtree.

  • deep: number: Specifies a custom maximum depth for freezing.

Usage Example

<LazyRender :deep="true">
  <ComplexRecursiveComponent />
</LazyRender>

<LazyRender :deep="2">
  <DeepTreeComponent />
</LazyRender>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant