-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
change FunctionalComponentOptions to a generic interface #4086
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
Conversation
Thanks! My concern is typing update is a breaking change for TS users. (I've been bitten by this before). Should vue's semver also take this into consideration? Ping @ktsn @yyx990803 |
hm, as the typings is shipped with core, it should also follow the semver? |
To avoid breaking change, how about rename the generic interface and create a specific interface that compatible current type? like: export interface RenderContextG<P, S> {
props: P;
children: VNode[];
slots: S;
data: VNodeData;
parent: Vue;
}
export interface RenderContext extends RenderContextG<any, any> {} |
children: VNode[]; | ||
slots: any; | ||
slots(): S; |
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.
Why is this changed to method? In my understand, it should a property of an object.
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.
According to a document, it is a function that returns a dictionary.
http://vuejs.org/guide/render-function.html#Functional-Components
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.
Oh, indeed! I was confused with this.$slots
😆
It was a huge breaking change the changes of |
I think |
Then, how about changing only |
It's ok to me. |
so as to specify
props
andslots()