web-component-base icon indicating copy to clipboard operation
web-component-base copied to clipboard

feat!: remove possibility of prop override

Open ayoayco opened this issue 1 year ago • 1 comments

We initially assigned to this[prop] and this[camelCase] during attribute value changes -- which is a possible way to override existing properties of the class and, therefore, of HTMLElement if devs, say, use onclick or style as a property 🫣🤣

By design, we now recommend using static props and the Proxy WebComponent.props as a safe way to define and initialize the component properties.

Remaining actions:

  • [ ] enforce usage of data- on HTML attribute counterparts, to avoid overriding standard attrs

BREAKING CHANGE: remove static properties BREAKING CHANGE: remove assigning to this[prop] & this[camelCase]

ayoayco avatar Dec 12 '23 20:12 ayoayco

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web-component-base ✅ Ready (Inspect) Visit Preview Dec 12, 2023 8:14pm

vercel[bot] avatar Dec 12 '23 20:12 vercel[bot]