-
Notifications
You must be signed in to change notification settings - Fork 254
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
Find by component #66
Conversation
woah, awesome job @dobromir-hristov ! I will play with this a bit tonight and see if I can find any bugs. Looks solid, very impressive that you managed to port the entire find api. having a separate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work @dobromir-hristov
- I don't fully understand how all of
find
works. That's fine - it seems like it works and the test appear to cover all the edge cases. Excellent work! - Can we do
find(Foo).$emit
with this implementation? - using the same
resolveComponent
algo from Vue core is very smart. - As commented I am not a fan of mutating
this
with__emitted
. Mutation and side effects are one of the reasons VTU beta was so buggy. Unless there is a strong eason for this refactor (eg, the original implementation doesn't cover an edge case) I'm not really in favor. If there is a reason, please explain - happy to change my mind with the right argument :) - you have some merge conflicts.
All in all I am very excited to merge this feature up and I think a lot of people will be excited for it.
|
I think I need to use a debugger a bit and play around. Will ask if I still can't understand it. If we can revert that one mixin (top level) happy to merge this up. Awesome we can do |
…ng nested instances.
0cd9202
to
07a203b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
Let's resolve this conflict and merge this up, I think a lot of people are waiting for this feature :D |
# Conflicts: # src/mount.ts
This PR allows finding a Vue Component and returning a new VueWrapper with it's instance.
Caveats:
Reasoning behind this
Many codebases use Components, Ref or Name to search for Vue instances, when doing tricky assertions, or mounting shallow.