Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Template component instance has broken property access #12

Open
medikoo opened this issue Oct 28, 2019 · 2 comments
Open

Template component instance has broken property access #12

medikoo opened this issue Oct 28, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@medikoo
Copy link

medikoo commented Oct 28, 2019

Access of any core property (as hasOwnProperty) or not existing property returns a method as generated by createCustomMethodHandler

Screenshot 2019-10-28 at 12 44 03

This may turn nasty, when we pass such object to any generic util, or if any developer decides to handle it in some outer module.

It's caused by optimistic Proxy setup:

return createCustomMethodHandler(obj, prop)

@medikoo medikoo added the bug Something isn't working label Oct 28, 2019
@eahefnawy
Copy link
Contributor

Interesting. @Pavel910 what you think of this?

@Pavel910
Copy link
Contributor

Pavel910 commented Oct 29, 2019

@eahefnawy yeah, it is problem unfortunately :( Without this crazy Proxy thing, when the CLI tries to fetch a custom method on a Template instance - it will fail.

I totally agree this Proxy thing is far from ideal. Since Template is so baked in at the CLI level, maybe it should have something like hasMethod(method) and executeMethod(method) which would be called by CLI? Then we could remove this Proxy voodoo. it would only require a small change to the CLI in case of a Template component, and a small addition to Template component only, and the Proxy thing would be gone.

Also, I suggest maybe we should remove this custom method feature until better times.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants