Open rajsite opened 2 years ago
Some additional discussion points:
id
and class
but are there additional ones that are used we should make sure to capture.class
instead of Class
to prevent a breaking change in applications? Is that worth the inconsistency with other property names?
From discussion: https://github.com/ni/nimble/pull/1141#discussion_r1154697846
😯 Problem to Solve
The blazor component wrappers leverage the
CaptureUnmatchedValues
feature to allow users to set arbitrary html attributes that are forwarded to the nimble component. For example:However, this is untyped, lets users set arbitrary attributes, and lets users accidentally use untyped attributes instead of typed equivalents, ie:
instead of:
Having loose typing makes it easier to accidentally break applications when refactoring / upgrading nimble.
In addition Microsoft warns about performance issues using CaptureUnmatchedValues.
A trade-off that may need to be documented is that users will not be able to leverage arbitrary
data-*
attributes in the strict template approach. See original discussion https://github.com/ni/nimble/pull/738#discussion_r971347578💁 Proposed Solution
CaptureUnmatchedValues
from our blazor componentsClass
,Id
,Slot
,Name
, etc📋 Tasks