I just tried simply writing the code as an object:
Pablo Grisafi

I didn’t use Function constructor due to CSP rules. In case of Function constructor, unsafe-eval must be allowed. In case of using Object URIs only blob: must be allowed, which seems like much more unlikely source of troubles.

As for the inability to reuse component: my fault! I’ve updated code in the article and in demo. I totally forgot to clone template’s content and <style> element. Without cloning the same elements would be used for every <hello-world>, effectively moving them between custom elements.