Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[0008-render-function-api-change] Flat vnode data forward DOM-compat #138

Open
backbone87 opened this issue Feb 29, 2020 · 1 comment
Open

Comments

@backbone87
Copy link

From https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md#flat-vnode-props-format

If the key exists as a property on the DOM node, it is set as a DOM property;
Otherwise it is set as an attribute.

What happens, if a browser adds a new property to a DOM node (experimental or by HTML/DOM spec)? Does an entry in the vnode data with the same name suddenly switch from attrs to prop on the DOM node object? especially with https://github.com/vuejs/rfcs/blob/master/active-rfcs/0010-optional-props-declaration.md in play, i feel like this could cause some headache, when suddenly you have to rename stuff in existing components, because a new property was introduced by the HTML spec.

@yyx990803
Copy link
Member

yyx990803 commented Feb 29, 2020

What happens, if a browser adds a new property to a DOM node (experimental or by HTML/DOM spec)?

This can only cause issues if the new property has the exact same name with a valid attribute that previously didn't have a corresponding property, which is extremely unlikely.

I don't see how this is related to optional props declaration - that RFC is only about components.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants