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

feat: Store functional render context on vnode in development #8586

Merged
merged 3 commits into from
Nov 30, 2018

Conversation

znck
Copy link
Member

@znck znck commented Aug 1, 2018

Used in vuejs/devtools#719 to display prop values in component inspector.

@znck znck requested a review from chrisvfritz August 1, 2018 12:57
@Akryum Akryum requested a review from eddyerburgh August 2, 2018 09:11
// #7817 clone node before setting fnContext, otherwise if the node is reused
// (e.g. it was from a cached normal slot) the fnContext causes named slots
// that should not be matched to match.
const clone = cloneVNode(vnode)
clone.fnContext = contextVm
clone.fnOptions = options
if (process.env.NODE_ENV !== 'production') {
clone.devtoolsMeta = renderContext
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make devtoolsMeta an object with a renderContext property instead? For example:

clone.devtoolsMeta = { renderContext }

I'm thinking it might be easier to add other information to devtoolsMeta later this way.

@chrisvfritz
Copy link
Contributor

Should we also add a test for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants