Proposal: native XML object support.

Andrea Giammarchi andrea.giammarchi at gmail.com
Mon May 20 12:52:26 UTC 2019


That'd give you info after declaration, which I believe was the major
concern in using strings instead of literals.

FWIW, I also wish E4X was still a thing, despite these handy and successful
template literals based libraries (hyperHTML, lighterhtml, or heresy for
the client, viperHTML for NodeJS).

However, since `() => <node />` is always new node while `() => html`<node
/>`` is a unique literal, I think E4X would be a performance nightmare on
the client, it could still smehow shine in NodeJS though.

Regards

On Mon, May 20, 2019 at 2:03 PM ViliusCreator <viliuskubilius416 at gmail.com>
wrote:

> > With strings and even E4X, you don't get the same experience that react
> supports. Things like property completion in XML mode, XML internal logic,
> etc.
>
>
>
> Pretty sure you can do this:
>
>
>
> ```js
> // ... xml function definition
>
> /**
>
> * @type {Element}
>
> * @prop {string} href
>
> */
> const xmlObj = xml`<a href=”...”>something</a>`
>
> ```
>
>
> This should make editor auto-complete xml object for you.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190520/65cf6fea/attachment.html>


More information about the es-discuss mailing list