Template compiler: de-duplication of identical hoisted content
What problem does this feature solve?
Looking through the compiled output code of my app I noticed a lot of identical hoisted static content, like in this reproduction:
const _hoisted_1 = { class: "text-end" }
const _hoisted_2 = { class: "text-end" }
const _hoisted_3 = { class: "text-end" }
const _hoisted_4 = { class: "text-end" }
const _hoisted_5 = { class: "text-end" }
const _hoisted_6 = { class: "text-end" }
What does the proposed API look like?
While it's not a huge deal, it seems like an easy problem to fix, the template compiler just needs to keep a cache of previously emitted hoisted content. Unless there is a reason to not reuse hoisted content.