Closed IamManchanda closed 6 years ago
cc @Rich-Harris @developit
This is interesting, but likely unnecessary since most components or templates are scoped to other containing elements. That is, <xhtml/>
might just be cruft.
On the other hand, maybe there's a standalone case where this makes sense?
That is,
<xhtml/>
might just be cruft.
Don't know ... maybe template
here makes more sense then <htmlx />
That being said on control flow stuff
@arxpoetica
I am giving my viewpoint as html
user ... a web framework user
I don't have enough knowledge (as of yet) whether this will work or not by compiling or not
But I think <x-each>
, <x-if>
, etc can be great for control flow without syntax highlighting
issues and good default emmet support when we talk as user point of view
We experimented with this idea when discussing the syntax for Svelte v2 and concluded that using elements for control flow is a bad idea. For one thing, it's much harder to discern the structure of a component at a glance when everything is angle brackets. For another, there's no way to express the concept of a sub-clause with tags:
{#if foo}
<p>foo is true</p>
{:else}
<p>foo is false</p>
{/if}
<!-- becomes... -->
<x-if condition='foo'>
<p>foo is true</p>
<x-else>
<p>foo is false</p>
</x-else>
</x-if>
That's confusing; it's also a lot more to type.
I'm not sure I see any benefit to wrapping everything in an <htmlx>
tag. It's just extra indentation for the sake of it. A <template>
element would at least be semantically correct. Either way, I would argue that's the concern of the framework, rather than HTMLx itself.
I think you are right... Closing this
{{ If JavaScript will be the one to handle browser based compilation/rendering at last to the browser the why not }}
These are 2 Proposals here:
Wrapping Tag
<htmlx></htmlx>
Reasoning: This denotes that though file extension is.html
but is a document that ishtml
with some better eXtensionsTag based control flow Reasoning: Better syntax highlighting and Emmet support for normal
.html
extension without any plugin (as seen in screenshots)