Open faselbaum opened 2 months ago
This issue and it's related implementation #1083 need to be revisited when / if #507 make it into the develop branch.
The SanitizationController
needs to be adapted to use the SignalHub
instead of lit's update
lifecycle hook.
Description / User story
As a developer, I want to have consistent initialisation and defaulting of property declarations so that we can get rid of inline nullish checking. This is currently very inconsistent across component implementations and bloats our code.
Eg.: Some components declare and initialize properties like this
VS
The latter one means that from a compiler perspective
sizeVariant
will always be defined and does not need to be validated upon usage, reducing nullish checking operations in many parts of the code. This leads to better readability. This is just a simple example though and doesn't account for the fact that our properties and state are potentially initialized from attribute values or might be changed to invalid values from javascript.We need to find a general strategy on how exactly we want to do this and then implement this strategy for all components.
Possible Solutions
A) Use custom accessors for defaulting and sanitizing - https://lit.dev/docs/components/properties/#accessors B) Use
willUpdate
lifecycle callback for defaulting and sanitizing - https://lit.dev/docs/components/lifecycle/#willupdateRequirements / Prerequisites
Acceptance Criteria
Additional information
Code of Conduct