Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dynamically update deep scopedSlot refs #899

Merged
merged 1 commit into from
Feb 7, 2022
Merged

Conversation

chearon
Copy link
Contributor

@chearon chearon commented Feb 3, 2022

#764 works perfectly when you're using normal slots, but not if you forward scoped slots to a child component.

Unfortunately, and I hope I'm mistaken about this, every component's entire VNode tree has to be iterated to find a component that needs refs updated.

Here's some perf testing of this PR in our application. In the Firefox profiler, afterRender shows up for:

  • 0.5ms in a 1,000-node component
  • 15ms in a 50,000-node component

Ideally this would use Vue's patch hooks like native Vue 2 refs do. Would it be out of the question to introduce a faster v-ref= instead of this PR? Or is this fast enough given that the readme already warns about performance issues?

@antfu antfu merged commit ef312a3 into vuejs:main Feb 7, 2022
@chearon chearon deleted the deep-refs branch February 15, 2022 15:14
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.

2 participants