Open DrSensor opened 2 years ago
I just realize this can be used for resumable SSR! 😲
Rather than serializing the states into script tag (like Qwik does), you can just define your tag with attribute value, define the accessor without default value, and now the framework will infer the accessor value from the attribute value which generated by the server.
However, there's a catch. The accessor value must be undefined. To make it suitable for SSR, we need to introduce namespaced attr:<attribute name>
attribute which override the accessor value from that attribute value.
Infer from html
Infer the value only when:
property is specified but undefinedaccessor is defined without initial value, orinfer:<name>
attribute, or@infer
decorator, or@infer(Class)
with{ force: true }
attribute value from literal value
Parse bind attribute value as literal value if surrounded by backtick then set real attribute value from that literal value when module ready.
Infer on set