vuejs / rfcs

RFCs for substantial changes / feature additions to Vue core
4.88k stars 546 forks source link

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

Open backbone87 opened 4 years ago

backbone87 commented 4 years ago

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 commented 4 years ago

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.