Skip to content

[Docs] Confusing wording/code around "cloning from <template> element" #118

@dmitriid

Description

@dmitriid

I think all components now have the following comment and code somewhere:

/*
Cloning contents from a <template> element is more performant 
than using innerHTML because it avoids additional HTML parse costs.
*/
const template = document.createElement('template');
template.innerHTML = `...`

template.content.cloneNode happens in constructor, the comment about cloning being faster than innerHtml, however, is right there beside an innerHTML.

UPD: It's even more confusing on anything that's less than 1400px in width (all comments jump above the blocks they reference)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions