fix(#2591): findComponent doesn't not return exposed properties in vm#2715
fix(#2591): findComponent doesn't not return exposed properties in vm#2715adamberecz wants to merge 6 commits intovuejs:mainfrom
findComponent doesn't not return exposed properties in vm#2715Conversation
✅ Deploy Preview for vue-test-utils-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
cexbrayat
left a comment
There was a problem hiding this comment.
Thank you for looking into it. Would you mind adding a unit test that showcases that the issue no longer exists?
|
Hi @adamberecz Would you mind adding some unit tests to the PR so we can merge it? |
|
I've stumbled upon another issue related to using |
✅ Deploy Preview for vue-test-utils-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@cexbrayat – I've added some test and refactored the fix. It should be good to go. |
|
@adamberecz Thanks for updating the PR, can you take a look at the build failures? |
After investigating the issue down to
@vue/runtime-coreit appears thatexposeProxyis only set in a script-setup component if it uses at least one directive:https://github.com/vuejs/core/blob/main/packages/runtime-core/src/component.ts#L1187
https://github.com/vuejs/core/blob/main/packages/runtime-core/src/directives.ts#L143
Meaning a component can have an exposed API while
exposeProxyisnull. In this case we can create manually fromexposedwhich essentially has the same effect, because the one created by runtime-core is only different by also proxyingpublicPropertiesMapwhich aren't available anyway.