-
-
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
2.6.3 broke this.$slots vs. new syntax (docs need updated?) #9458
Comments
Try to use |
@tcastelly - it isn't a scoped slot though. I'm of course OK with this being the new API due to the changes in 2.6 and onward, but the docs aren't updated to say this is the expected behavior, and this is breaking vs all previous v2 versions (IIRC). My primary issue being it's very weird to have all slots using the new |
I'm happy to put together a PR for the API docs if we decide how we want to talk about this situation. One almost needs a matrix since there's now: [2.0-2.5.xx, 2.6.0-2.6.2, 2.6.3-onward?] in terms of what can be expected on |
Mr You said specifically that this new format will not break existing code (till version 3) which clearly (by the numbers of issues) does |
I'm pretty sure the new syntax does not break the legacy.
|
This comment has been minimized.
This comment has been minimized.
Stay bellow 2.6.x create an issue. The idea is to keep compatibility until V3, it will be fixed. |
@tcastelly - the major change in 2.6.3 is that now nothing using As I stated above, my concern is now that there are 3 separate expectations inside of v2.x as to what could be on
|
Correct, I'm totally agree with you. I would just to know if there is a regression of |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Note the premise is that 2.6 does not break existing code. The new syntax is NOT existing code. Its behavior is not guaranteed to be exactly the same with the old syntax as suggested in the release post: all slots using the new syntax are compiled into scoped slots so that they gain the performance characteristics of scoped slots. This is also how all slots are going to work in v3. In v3 there will no longer be the distinction between normal vs scoped slots and all slots are implicitly scoped. The idea is that starting from 2.6, all render function usage should stop using For 2.x, this means components using render functions will need to be updated to support the new We considered reverse exposing all One possible solution is that we only reverse-expose new syntax slots that do not have a scope variable. @Garito if you have a regression about the old syntax you should open a separate issue with a valid reproduction. I'm marking your comments as off-topic. |
Thanks for clarifying! I think the transition plan described here makes sense.
I personally don't feel this is necessary, and could potentially cause confusion once v3 hits. |
In 0e8560d I've made it so that only slots using the new This should alleviate the need for render function users to update their code to support 2.6 syntax, but eventually they will need to do it for v3. |
Version 2.6.4 solves my issues with slots |
Version
2.6.3
Reproduction link
https://github.com/pearofducks/vue-slot-bug-repro
Steps to reproduce
What is expected?
$slots.foo
should be available -- or at least the API docs should be updatedWhat is actually happening?
$slots.foo
is undefinedThe text was updated successfully, but these errors were encountered: