Skip to content

Conversation

kaorun343
Copy link
Contributor

so as to specify props and slots()

@HerringtonDarkholme
Copy link
Member

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

@ktsn
Copy link
Member

ktsn commented Nov 2, 2016

hm, as the typings is shipped with core, it should also follow the semver?

@ktsn
Copy link
Member

ktsn commented Nov 2, 2016

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;
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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 😆

@kaorun343
Copy link
Contributor Author

It was a huge breaking change the changes of ComponentOptions that I did. However, compared to ComponentOptions, it will be a smaller impact to change FunctionalComponentOptions and RenderContext, I think...

@ktsn
Copy link
Member

ktsn commented Nov 2, 2016

I think ComponentOptions update was reasonable breaking change because it was not announced officially about typings and needed revisions for brush up as the stage of pre-release.
However, it is now already released and announced, and it seems many users depends on it.
It may be different problem between code and typings but I think we should be careful about this topic.

@kaorun343
Copy link
Contributor Author

Then, how about changing only slot: any -> slot(): any?
I'm gonna make pull request again when preparing 2.1...

@ktsn
Copy link
Member

ktsn commented Nov 3, 2016

It's ok to me.

This was referenced Nov 3, 2016
@kaorun343 kaorun343 closed this Nov 3, 2016
@kaorun343 kaorun343 deleted the update-types branch November 3, 2016 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants