templating icon indicating copy to clipboard operation
templating copied to clipboard

vanilah web component templates

Open pragmaproducts opened this issue 7 years ago • 6 comments

We have several scenarios where we have custom elements using vanilla web components that do not have a template. The current work around is to just use a empty template so that during the loading process we don't get a error indicating that there must be a template.

Template loading for vanilla web components sound not enforce the presence of a template. We use this for d3 visualisations where we build up the UI manually.

This issue affects us greatly and we would appreciate any assistance to avoid having to use a empty template tag as that affects content elements.

pragmaproducts avatar May 24 '18 02:05 pragmaproducts

Does @noView() fit your case?

StrahilKazlachev avatar May 24 '18 08:05 StrahilKazlachev

since these are frameworkless components using Aurelia framework in it defeats the purpose. Where in the code base might I find the implementation of @noView perhaps I can find some clues in there

pragmaproducts avatar May 25 '18 07:05 pragmaproducts

You can do

export class Ce {
  static $view = null
}

Its a new feature and will take a bit time to get released

bigopon avatar May 25 '18 07:05 bigopon

@pragmaproducts you lost me, are you wrapping those vanilla components in Aurelia ones or?

StrahilKazlachev avatar May 25 '18 07:05 StrahilKazlachev

@pragmaproducts @noView https://github.com/aurelia/templating/blob/2f0738217e289e70dd2f9f60c56d413cffb3a93a/src/decorators.js#L230

doktordirk avatar May 25 '18 07:05 doktordirk

I guess its the combination of Aurelia life cycle and webcomponent, so the element needs to be registered with both aurelia and customElements registry

bigopon avatar May 25 '18 07:05 bigopon