Instead of trying to get rid of the host element, turn it into one that is valid SVG but other wise unaffecting: Instead of your element selector
selector: "svg-rect"
and its corresponding element in the template:
template: `...<svg-rect>...</svg-rect>...`
switch to an attribute selector:
selector: "[svg-rect]"
and add that attribute to a group element tag:
template: `...<g svg-rect>...</g>...`
This will expand to:
<svg height="550" width="450" x="0" y="0">
<g id="svgGroup">
<g svg-rect>
<!--template bindings={}-->
<rect x="10" y="10" height="100" width="100" fill="red" stroke="#000" stroke-width="2"></rect>
<!--template bindings={}-->
</g>
<g svg-rect>
<!--template bindings={}-->
<rect x="10" y="10" height="100" width="100" fill="red" stroke="#000" stroke-width="2"></rect>
<!--template bindings={}-->
</g>
</g>
</svg>
which is valid SVG, which will render.
Plnkr
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…