-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Performance: compile default slots to functions #9756
Comments
I've got a working version of this locally but I'd like to test it further over the weekend, it's my first look here so have probably naturally oversimplified. I also auto-prettified |
After running the tests and seeing many failures, my suspicions were confirmed 😛 I corrected for a lot of them and I seem to have the general compilation of the function together but am struggling to handle cases like the following...
With my current changes, |
Hmm that could be a problem, maybe why it wasn't done originally. I'm not familiar with the vue compiler but my first thought is to just filter anything without |
@KaelWD I thought the same! It seems this isn't (always?) available but it has to be at some point so I'll keep digging, the behaviour might not even be in the same ground I've already covered 🔍 Maybe its impossible or leads to some tough patterns and we leave it :) Thought: Anyone know if there is a significantly rewritten compiler for 3.0? Update: No progress thus far. May end up in the wind. |
What problem does this feature solve?
The original v-slot implementation was not available in
this.$slots
, but that was added in 2.6.4. Scoped slots reduce unnecessary re-renders with nested slots, so this change would hopefully provide a performance improvement for component libraries.What does the proposed API look like?
<foo>default slot</foo>
should output
Equivalent to
<foo v-slot>default slot</foo>
Note #9580 could be a problem if lots of people rely on that behaviour.
The text was updated successfully, but these errors were encountered: