Open dy opened 3 years ago
On the other side, just consider .vue, .uce and other templates. It's complete madness, is it? They wire in CLI tools, compiling, own syntax, own imports and so on, ignoring what's there. Even something with minimal layer, hoping to become a standard thing one day is better. Then the question is what's that minimal layer to enable declarative components, aspiring to get erased in the future?
From practical point, we maybe not need as much to have separate components at first, we could just start with template instantiation. That's still useful to create new content in DOM via instancing, rather than innerHTML or externalities.
What's the format to declare/describe/deliver component - html, js?
There are reasonable discussions for HTML imports: this, this. There's also OOHTML include, HTML imports and others. Basically now there's no non-JS mechanism to import HTML.
The point is the following: since we can't have purely declarative custom elements (we still require JS or faking declarativity), so then modules mechanism also can be done via JS, which is there already. Then the question is: to fake or not to fake (HTML imports)?
JS (not to fake)
👍🏼 js allows both
import 'component.js'
and<script src="component.js">
👍🏼 js relegates shared dependency problem to npm 👎🏼 how do we bundle element-defs HTML to JS?If we stick to github elements convention https://github.com/github/auto-complete-element. 👎🏼 Then the point of element definition tag is reduced significantly.
HTML (to fake)
👎🏼 html requires
<include-fragment>
, then it's unclear what fragment must be included - whole<element-defs>
or element inside<element-defs>
?uce-template
doesn't have that problem. 👎🏼 if<element-defs>
is used per-package - how to resolve the sharedelement-defs
dependency in HTML? we cannot imply that is being available globally.Manual deps
👍🏼 From this thread: these components can be made snippets and inserted manually, as old-school jQuery plugins. 👎🏼 There's no apparent way to reuse components even within a project.