Skip to content
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

Using the decorator on a class with a static file #296

Closed
eddow opened this issue Dec 10, 2018 · 6 comments
Closed

Using the decorator on a class with a static file #296

eddow opened this issue Dec 10, 2018 · 6 comments

Comments

@eddow
Copy link
Contributor

eddow commented Dec 10, 2018

When declaring a static function in the class being decorated by Component a typescript error (might) occur.
The problem and the solution are here : microsoft/TypeScript#23704

Note: The problem occurs on some computers and not others, it must depend on some global stuff. Though, the static function is available even after going through the Component decorator as it is working on some installations.

@ktsn
Copy link
Member

ktsn commented Dec 10, 2018

Well, I'm afraid I'm still not sure what your point is.

What is actual code occurring your issue? Please provide a minimal and self-contained reproduction.
Why do you think it is a vue-class-component issue?

@eddow
Copy link
Contributor Author

eddow commented Dec 10, 2018

Well, it is tough for me to do so because that bug does not occur on my system :">
Though, to give you something minimal to reproduce :

@Component
class myControl extends Vue {
    static someMethod(blah) { ... }
}

The error occuring is exactly the one described in he link I gave;
If I apply the example given in the issue/solution link I gave, this would change the declaration of componentFactory like this :

export function componentFactory<T extends VueClass<Vue>> (
  Component: T,
  options: ComponentOptions<Vue> = {}
): T {

Of course, the signature of the Component decorator would change along

@ktsn
Copy link
Member

ktsn commented Dec 10, 2018

Hmm, we cannot do anything without proper reproduction...
Could you boil down the problem to clarify what the root cause is?

The error occuring

What the error message, by the way?

@eddow
Copy link
Contributor Author

eddow commented Dec 10, 2018

This is what has been given to me :
bug

I tried to make a reproduction in https://github.com/eddow/eddow-bug-expo in the branch vcc+static - unfortunately, as I told you, it compiles just fine for me. (I did add some more complexity like I have in my project just to make it more likely to reproduce)

@ktsn
Copy link
Member

ktsn commented Dec 10, 2018

This is probably the same problem with #294. Please upgrade Vue to v2.5.20.

@eddow
Copy link
Contributor Author

eddow commented Dec 11, 2018

Well, because of the unreproductible(?) nature of the problem, I think about nothing but to close the bug - I personally dodged the question by removing the static function from my library so it's indeed not really a problem even for me.

Just passin' by - sorry to have bothered.

@eddow eddow closed this as completed Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants