ViliusCreator (2019-05-20T12:01:10.000Z)
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190520/07600ef2/attachment.html>
viliuskubilius416 at gmail.com (2019-05-20T12:13:45.724Z)
> 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 Element object properties and other stuff for you. Assuming XML literal translates to HTML object in web, we need to use `Element` type. If it's for Node JS, you can make custom `XMLElement` definition and use it.

I understand that new feature in JS is good thing, but I don't think XML should be one of them. Stuff like Node JS and other non-browser V8 implementors may not even have usage for XML feature.
viliuskubilius416 at gmail.com (2019-05-20T12:11:29.261Z)
> 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 Element object properties and other stuff for you. Assuming XML literal translates to HTML object in web, we need to use `Element` type. If it's for Node JS, you can make custom `XMLElement` definition and use it.

I understand that new feature in JS is good thing, but I don't think XML should be one of them. There is already JSON, so we don't need XML. Having "Named objects"(Something like `{'Object name', a: 1, b: 2, c: 3}`) is probably better feature than adding XML.
viliuskubilius416 at gmail.com (2019-05-20T12:07:49.704Z)
> 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 Element object properties and other stuff for you. Assuming XML literal translates to HTML object in web, we need to use `Element` type. If it's for Node JS, you can make custom `XMLElement` definition and use it.