While the library works without a compiler, there are many optimization opportunities that would help apps perform better in production.
Optimization opportunities:
Code inside html` `; template literals should be minified using HTML minification.
All dynamic property accesses using bracket notation should be converted to ReactiveArray::get() to avoid need for a Proxy. I.E. arr[0] should be converted to arr.get(0), for example.
All dynamic property assignments using bracket notation should be converted to ReactiveArray.splice() to avoid need for a Proxy. I.E. arr[3] = "foo" should be converted to arr.splice(3, 1, "foo");, for example.
All mutating ReactiveArray methods should be converted to ReactiveArray::splice(). All modifications to an array are expressible with splice(), and that's exactly what the class does internally. For most things, this would be a simple transformation, so inlining it would improve performance.
Slotless HTML templates could be converted to a variant that doesn't go through the trouble of parsing the HTML at all
It should be able to aggressively tree-shake the library to get rid of class methods and other features that are not used by the app being compiled. Also, removing unused attribute namespace logic would be nice too (ex. if no elements in the app use destiny:out, logic for that shouldn't be bundled in).
While the library works without a compiler, there are many optimization opportunities that would help apps perform better in production.
Optimization opportunities:
html` `;
template literals should be minified using HTML minification.ReactiveArray::get()
to avoid need for a Proxy. I.E.arr[0]
should be converted toarr.get(0)
, for example.ReactiveArray.splice()
to avoid need for a Proxy. I.E.arr[3] = "foo"
should be converted toarr.splice(3, 1, "foo");
, for example.ReactiveArray::splice()
. All modifications to an array are expressible withsplice()
, and that's exactly what the class does internally. For most things, this would be a simple transformation, so inlining it would improve performance.destiny:out
, logic for that shouldn't be bundled in).