Coarse Grained (Inferred) Observability for JSX #87
Labels
0.7.0
documentation
Improvements or additions to documentation
expirement
feature
New feature or request
JSX
Type of Change
Summary
Related to #84 , it would be cool if for something like this
Details
So the compiled output would look something like this
In this case we can automatically infer generate the
observedAttributes
based on what is getting used in therender
function, and then from there compute the anattributeChangedCallback
function. 🤩Details
To be fair, the reason this is considered coarse-grained is because
attributeChangedCallback
just reruns therender
function completely, so all the (inner
) HTML is blown out, so not very efficient, but certainly helpful nonetheless IMO!But... as the name also implies, this means that there could / should be room for fine-grained observability as well, such that we can the compiled knowledge about the template and component and instead run an
update
function that knows hows to more tactically calltextContent
orsetAttribute
to the specific DOM node, rather than just re-computinginnerHTML
. One thing at a time though. 😅The text was updated successfully, but these errors were encountered: