Proposal: native XML object support.

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Proposal: native XML object support.

Ed Saleh
Hello,

I am proposing to support XML object native in JavaScript so the following code would be possible

    let foo = <input type="button" value = "Ok"\>

Which creates an object called foo with name = "input" and value = "Ok", children = null, and constructor = null

`constructor` property would include a constructor to be called when a new XML object is created.

While `childern` would include any inner XML items inside the XML element.

It's nature to support XML as object natively next as JSON format is already supported natively.

Supporting XML would open new possibilities notably in the UI side as we would be able to merge UI with Controller logic code.

This is similar to React framework.

Thank you,


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

Sanford Whiteman
> let foo = <input type="button" value = "Ok"\>

This is a retread of E4X (https://en.wikipedia.org/wiki/ECMAScript_for_XML)
so I can't imagine it would be resuscitated in a (for better or worse) JSON-centric
world.

—— Sandy

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

Ed Saleh
Thanks for reply. Didn't know that it existed before!
I don't think we can say that we live in a JSON centric world when things like React show up and revolutionize web development. I think JSON has its uses and XML has its uses. UI shouldn't been ever seperated from controller since one can't exist without the other.

From: es-discuss <[hidden email]> on behalf of Sanford Whiteman <[hidden email]>
Sent: Tuesday, May 14, 2019 1:37:46 AM
To: [hidden email]
Subject: Re: Proposal: native XML object support.
 
> let foo = <input type="button" value = "Ok"\>

This is a retread of E4X (https://en.wikipedia.org/wiki/ECMAScript_for_XML)
so I can't imagine it would be resuscitated in a (for better or worse) JSON-centric
world.

—— Sandy

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

Sanford Whiteman
> I don't think we can say that we live in a JSON centric world

But we do.

It's not that there aren't powerful XML-based applications still being
developed. And XML still buttresses some of the most important
back-end components of the modern (as well as ancient) web.

But surely you cannot have missed the fact that modern API development
has so standardized on JSON that one doesn't even need to mention the
response type anymore!

In any case, if E4X died back when we all used XML all the time, it
seems vanishingly unlikely that it would come back now… but I'm not on
TC39 so this is just my take.

—— S.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

Ed Saleh
I prefer JSON over XML any time but the only area where JSON can't compete with XML is UI.

From: es-discuss <[hidden email]> on behalf of Sanford Whiteman <[hidden email]>
Sent: Tuesday, May 14, 2019 1:56:46 AM
To: [hidden email]
Subject: Re: Proposal: native XML object support.
 
> I don't think we can say that we live in a JSON centric world

But we do.

It's not that there aren't powerful XML-based applications still being
developed. And XML still buttresses some of the most important
back-end components of the modern (as well as ancient) web.

But surely you cannot have missed the fact that modern API development
has so standardized on JSON that one doesn't even need to mention the
response type anymore!

In any case, if E4X died back when we all used XML all the time, it
seems vanishingly unlikely that it would come back now… but I'm not on
TC39 so this is just my take.

—— S.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

guest271314
In reply to this post by Ed Saleh

> I prefer JSON over XML any time but the only area where JSON can't compete with XML is UI.

XML is also currently specified as the language used by SSML. 

Why does a JavaScript plain object need to be created when the XML document itself can be used to read/write values?

```
const createXMLPlainObject = xml_string => Object.create(null, (() => {
  const xml = (new DOMParser()).parseFromString(`<?xml version="1.0"?>${xml_string}`, "application/xml");
  const element = xml.documentElement;
  return {name:{writable:false, value: element.nodeName}, children: {writable: false, value: element.children}}
})());
```

On Tue, May 14, 2019 at 5:15 AM Ed Saleh <[hidden email]> wrote:
Hello,

I am proposing to support XML object native in JavaScript so the following code would be possible

    let foo = <input type="button" value = "Ok"\>

Which creates an object called foo with name = "input" and value = "Ok", children = null, and constructor = null

`constructor` property would include a constructor to be called when a new XML object is created.

While `childern` would include any inner XML items inside the XML element.

It's nature to support XML as object natively next as JSON format is already supported natively.

Supporting XML would open new possibilities notably in the UI side as we would be able to merge UI with Controller logic code.

This is similar to React framework.

Thank you,

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

Isiah Meadows-2
In reply to this post by Ed Saleh
Fun fact: React elements are plain JS objects that are nearly JSON-compatible. The only reason why they aren't is because of the presence of a `$$typeof: Symbol.for("react.element")` property on React elements, to prevent people from using non-array object results of `JSON.parse(jsonString)` directly as a child. The rationale for this is explained in this blog post by React's creator: 

I would say that we live in a JSON-centric world for APIs, SGML/XML-centric for UIs. (I wish XHTML efforts actually stuck, to be honest. `<script src="..." />` is one reason XML would've been better than SGML IMHO.)

On Tue, May 14, 2019 at 01:47 Ed Saleh <[hidden email]> wrote:
Thanks for reply. Didn't know that it existed before!
I don't think we can say that we live in a JSON centric world when things like React show up and revolutionize web development. I think JSON has its uses and XML has its uses. UI shouldn't been ever seperated from controller since one can't exist without the other.

From: es-discuss <[hidden email]> on behalf of Sanford Whiteman <[hidden email]>
Sent: Tuesday, May 14, 2019 1:37:46 AM
To: [hidden email]
Subject: Re: Proposal: native XML object support.
 
> let foo = <input type="button" value = "Ok"\>

This is a retread of E4X (https://en.wikipedia.org/wiki/ECMAScript_for_XML)
so I can't imagine it would be resuscitated in a (for better or worse) JSON-centric
world.

—— Sandy

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
--

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

Jordan Harband
(that's not react's creator; that's redux's creator, who is now a member of the react core team)

On Wed, May 15, 2019 at 8:17 PM Isiah Meadows <[hidden email]> wrote:
Fun fact: React elements are plain JS objects that are nearly JSON-compatible. The only reason why they aren't is because of the presence of a `$$typeof: Symbol.for("react.element")` property on React elements, to prevent people from using non-array object results of `JSON.parse(jsonString)` directly as a child. The rationale for this is explained in this blog post by React's creator: 

I would say that we live in a JSON-centric world for APIs, SGML/XML-centric for UIs. (I wish XHTML efforts actually stuck, to be honest. `<script src="..." />` is one reason XML would've been better than SGML IMHO.)

On Tue, May 14, 2019 at 01:47 Ed Saleh <[hidden email]> wrote:
Thanks for reply. Didn't know that it existed before!
I don't think we can say that we live in a JSON centric world when things like React show up and revolutionize web development. I think JSON has its uses and XML has its uses. UI shouldn't been ever seperated from controller since one can't exist without the other.

From: es-discuss <[hidden email]> on behalf of Sanford Whiteman <[hidden email]>
Sent: Tuesday, May 14, 2019 1:37:46 AM
To: [hidden email]
Subject: Re: Proposal: native XML object support.
 
> let foo = <input type="button" value = "Ok"\>

This is a retread of E4X (https://en.wikipedia.org/wiki/ECMAScript_for_XML)
so I can't imagine it would be resuscitated in a (for better or worse) JSON-centric
world.

—— Sandy

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
--
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

ViliusCreator
In reply to this post by Ed Saleh

XML in JS without React could totally bring usage in Node js, not only JS. For example, you could pass XML object as parameter to website from server and server would change it to right way, so XML object would be turned to HTML element.
However, in non web-development environment, it would have no usage. Since sometimes Node js is used for general-purpose and not web-development, XML would be practically useless and JSON would be used. And things such as E4X already exist.
The benefit of XML is that you can do `<a b=”c”>d <e></e></a>`(which is equivalent to

```json
{
    ‘//name’: ‘a’,
    ‘//inner’: [‘d ’, {...}],
    b: ‘c’
}
```) and it’s more readable than JSON version of it.`


Virus-free. www.avast.com

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

Jacob Bloom
> And things such as E4X already exist.

Building on that, JSX is just a code transformation that can be used
without React. You can swap React out for another compatible library
with a pragma: https://babeljs.io/docs/en/next/babel-plugin-transform-react-jsx#pragma
-- JSX + a React-like library that creates vanilla DOM elements could
be used to achieve a lot of the requested functionality


On Sat, May 18, 2019 at 4:01 AM ViliusCreator
<[hidden email]> wrote:

>
> XML in JS without React could totally bring usage in Node js, not only JS. For example, you could pass XML object as parameter to website from server and server would change it to right way, so XML object would be turned to HTML element.
> However, in non web-development environment, it would have no usage. Since sometimes Node js is used for general-purpose and not web-development, XML would be practically useless and JSON would be used. And things such as E4X already exist.
> The benefit of XML is that you can do `<a b=”c”>d <e></e></a>`(which is equivalent to
>
> ```json
> {
>     ‘//name’: ‘a’,
>     ‘//inner’: [‘d ’, {...}],
>     b: ‘c’
> }
> ```) and it’s more readable than JSON version of it.`
>
>
> Virus-free. www.avast.com
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

liorean
You could already do something like this:

     let
      RawXML=xml`<some-element some-attribute="${some_variable}">some content</some-element>`
     ,XMLApplication=rss`<rss version="2.0">
      <channel>
        <title>RSS Title</title>
        <description>This is an example of an RSS feed</description> 
        <link>http://www.example.com/main.html</link>
        <lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
        <pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
        <ttl>1800</ttl>
        <item>
          <title>Example entry</title>
          <description>Here is some text containing an interesting description.</description>
          <link>http://www.example.com/blog/post/1</link>
          <guid isPermaLink="false">7bd204c6-1655-4c27-aeee-53f933c5395f</guid>
           <pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
        </item>
      </channel>
    </rss> ` // rss example courtesy wikipedia


And all you'd need is an XML parser for EcmaScript tagged templates, or for a specific XML application such as RSS, an application specific handler which would probably be layered on top of such an XML parser. And XML is actually not that hard to parse, in difference to HTML, thanks to its draconic error handling. It's actually the XML application handlers that might get more involved.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

Ed Saleh
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.

From: es-discuss <[hidden email]> on behalf of liorean <[hidden email]>
Sent: Monday, May 20, 2019 3:03:04 AM
To: Jacob Bloom
Cc: ViliusCreator; [hidden email]
Subject: Re: Re: Proposal: native XML object support.
 
You could already do something like this:

     let
      RawXML=xml`<some-element some-attribute="${some_variable}">some content</some-element>`
     ,XMLApplication=rss`<rss version="2.0">
      <channel>
        <title>RSS Title</title>
        <description>This is an example of an RSS feed</description> 
        <link>http://www.example.com/main.html</link>
        <lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
        <pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
        <ttl>1800</ttl>
        <item>
          <title>Example entry</title>
          <description>Here is some text containing an interesting description.</description>
          <link>http://www.example.com/blog/post/1</link>
          <guid isPermaLink="false">7bd204c6-1655-4c27-aeee-53f933c5395f</guid>
           <pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
        </item>
      </channel>
    </rss> ` // rss example courtesy wikipedia


And all you'd need is an XML parser for EcmaScript tagged templates, or for a specific XML application such as RSS, an application specific handler which would probably be layered on top of such an XML parser. And XML is actually not that hard to parse, in difference to HTML, thanks to its draconic error handling. It's actually the XML application handlers that might get more involved.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

ViliusCreator
In reply to this post by Ed Saleh

> 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
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

Andrea Giammarchi-2
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 <[hidden email]> 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
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

ViliusCreator
In reply to this post by Ed Saleh

> the client, it could still somehow shine in NodeJS though.

 

The only way it can shine is only passing HTML objects as arg to website. That’s it. And still, you can use string to do that for you. People already use JSON and I don’t think they would use XML in Node js. There are already tons of libs for XML stuff, yet they don’t have a lot of downloads, as far as I remember.

 

So basically, Node js doesn’t need XML. That would be useless.


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

Isiah Meadows-2
In reply to this post by Jordan Harband
My bad. I should've known that. :-)

(I've looked *way* too deeply into the React/Redux ecosystem to have
any sort of excuse on this one.)

-----

Isiah Meadows
[hidden email]
www.isiahmeadows.com

On Wed, May 15, 2019 at 11:39 PM Jordan Harband <[hidden email]> wrote:

>
> (that's not react's creator; that's redux's creator, who is now a member of the react core team)
>
> On Wed, May 15, 2019 at 8:17 PM Isiah Meadows <[hidden email]> wrote:
>>
>> Fun fact: React elements are plain JS objects that are nearly JSON-compatible. The only reason why they aren't is because of the presence of a `$$typeof: Symbol.for("react.element")` property on React elements, to prevent people from using non-array object results of `JSON.parse(jsonString)` directly as a child. The rationale for this is explained in this blog post by React's creator:
>> https://overreacted.io/why-do-react-elements-have-typeof-property/
>>
>> I would say that we live in a JSON-centric world for APIs, SGML/XML-centric for UIs. (I wish XHTML efforts actually stuck, to be honest. `<script src="..." />` is one reason XML would've been better than SGML IMHO.)
>>
>> On Tue, May 14, 2019 at 01:47 Ed Saleh <[hidden email]> wrote:
>>>
>>> Thanks for reply. Didn't know that it existed before!
>>> I don't think we can say that we live in a JSON centric world when things like React show up and revolutionize web development. I think JSON has its uses and XML has its uses. UI shouldn't been ever seperated from controller since one can't exist without the other.
>>> ________________________________
>>> From: es-discuss <[hidden email]> on behalf of Sanford Whiteman <[hidden email]>
>>> Sent: Tuesday, May 14, 2019 1:37:46 AM
>>> To: [hidden email]
>>> Subject: Re: Proposal: native XML object support.
>>>
>>> > let foo = <input type="button" value = "Ok"\>
>>>
>>> This is a retread of E4X (https://en.wikipedia.org/wiki/ECMAScript_for_XML)
>>> so I can't imagine it would be resuscitated in a (for better or worse) JSON-centric
>>> world.
>>>
>>> —— Sandy
>>>
>>> _______________________________________________
>>> es-discuss mailing list
>>> [hidden email]
>>> https://mail.mozilla.org/listinfo/es-discuss
>>> _______________________________________________
>>> es-discuss mailing list
>>> [hidden email]
>>> https://mail.mozilla.org/listinfo/es-discuss
>>
>> --
>> -----
>>
>> Isiah Meadows
>> [hidden email]
>> www.isiahmeadows.com
>> _______________________________________________
>> es-discuss mailing list
>> [hidden email]
>> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

Michał Wadas
I'm not sure why is that discussed. XML is natively supported in browsers and there are npm packages to bring exactly the same interface to Node.js and other server envs.

If you want Node.js to include some kind of XML parser in its core library, I suggest using their bug tracker (but it was rejected 4 years ago - https://github.com/nodejs/node/issues/2709 ).

On Mon, May 20, 2019 at 9:35 PM Isiah Meadows <[hidden email]> wrote:
My bad. I should've known that. :-)

(I've looked *way* too deeply into the React/Redux ecosystem to have
any sort of excuse on this one.)

-----

Isiah Meadows
[hidden email]
www.isiahmeadows.com

On Wed, May 15, 2019 at 11:39 PM Jordan Harband <[hidden email]> wrote:
>
> (that's not react's creator; that's redux's creator, who is now a member of the react core team)
>
> On Wed, May 15, 2019 at 8:17 PM Isiah Meadows <[hidden email]> wrote:
>>
>> Fun fact: React elements are plain JS objects that are nearly JSON-compatible. The only reason why they aren't is because of the presence of a `$$typeof: Symbol.for("react.element")` property on React elements, to prevent people from using non-array object results of `JSON.parse(jsonString)` directly as a child. The rationale for this is explained in this blog post by React's creator:
>> https://overreacted.io/why-do-react-elements-have-typeof-property/
>>
>> I would say that we live in a JSON-centric world for APIs, SGML/XML-centric for UIs. (I wish XHTML efforts actually stuck, to be honest. `<script src="..." />` is one reason XML would've been better than SGML IMHO.)
>>
>> On Tue, May 14, 2019 at 01:47 Ed Saleh <[hidden email]> wrote:
>>>
>>> Thanks for reply. Didn't know that it existed before!
>>> I don't think we can say that we live in a JSON centric world when things like React show up and revolutionize web development. I think JSON has its uses and XML has its uses. UI shouldn't been ever seperated from controller since one can't exist without the other.
>>> ________________________________
>>> From: es-discuss <[hidden email]> on behalf of Sanford Whiteman <[hidden email]>
>>> Sent: Tuesday, May 14, 2019 1:37:46 AM
>>> To: [hidden email]
>>> Subject: Re: Proposal: native XML object support.
>>>
>>> > let foo = <input type="button" value = "Ok"\>
>>>
>>> This is a retread of E4X (https://en.wikipedia.org/wiki/ECMAScript_for_XML)
>>> so I can't imagine it would be resuscitated in a (for better or worse) JSON-centric
>>> world.
>>>
>>> —— Sandy
>>>
>>> _______________________________________________
>>> es-discuss mailing list
>>> [hidden email]
>>> https://mail.mozilla.org/listinfo/es-discuss
>>> _______________________________________________
>>> es-discuss mailing list
>>> [hidden email]
>>> https://mail.mozilla.org/listinfo/es-discuss
>>
>> --
>> -----
>>
>> Isiah Meadows
>> [hidden email]
>> www.isiahmeadows.com
>> _______________________________________________
>> es-discuss mailing list
>> [hidden email]
>> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: native XML object support.

kai zhu
fyi, a notable xml-based web-api holdout is wechat-pay, with a billion active users [1],[2]. arch-rival alipay otoh uses json.

-kai

[1] official wechat-pay documentation

[2] swagger documentation for wechat-pay



On Tue, May 21, 2019, 05:08 Michał Wadas <[hidden email]> wrote:
I'm not sure why is that discussed. XML is natively supported in browsers and there are npm packages to bring exactly the same interface to Node.js and other server envs.

If you want Node.js to include some kind of XML parser in its core library, I suggest using their bug tracker (but it was rejected 4 years ago - https://github.com/nodejs/node/issues/2709 ).

On Mon, May 20, 2019 at 9:35 PM Isiah Meadows <[hidden email]> wrote:
My bad. I should've known that. :-)

(I've looked *way* too deeply into the React/Redux ecosystem to have
any sort of excuse on this one.)

-----

Isiah Meadows
[hidden email]
www.isiahmeadows.com

On Wed, May 15, 2019 at 11:39 PM Jordan Harband <[hidden email]> wrote:
>
> (that's not react's creator; that's redux's creator, who is now a member of the react core team)
>
> On Wed, May 15, 2019 at 8:17 PM Isiah Meadows <[hidden email]> wrote:
>>
>> Fun fact: React elements are plain JS objects that are nearly JSON-compatible. The only reason why they aren't is because of the presence of a `$$typeof: Symbol.for("react.element")` property on React elements, to prevent people from using non-array object results of `JSON.parse(jsonString)` directly as a child. The rationale for this is explained in this blog post by React's creator:
>> https://overreacted.io/why-do-react-elements-have-typeof-property/
>>
>> I would say that we live in a JSON-centric world for APIs, SGML/XML-centric for UIs. (I wish XHTML efforts actually stuck, to be honest. `<script src="..." />` is one reason XML would've been better than SGML IMHO.)
>>
>> On Tue, May 14, 2019 at 01:47 Ed Saleh <[hidden email]> wrote:
>>>
>>> Thanks for reply. Didn't know that it existed before!
>>> I don't think we can say that we live in a JSON centric world when things like React show up and revolutionize web development. I think JSON has its uses and XML has its uses. UI shouldn't been ever seperated from controller since one can't exist without the other.
>>> ________________________________
>>> From: es-discuss <[hidden email]> on behalf of Sanford Whiteman <[hidden email]>
>>> Sent: Tuesday, May 14, 2019 1:37:46 AM
>>> To: [hidden email]
>>> Subject: Re: Proposal: native XML object support.
>>>
>>> > let foo = <input type="button" value = "Ok"\>
>>>
>>> This is a retread of E4X (https://en.wikipedia.org/wiki/ECMAScript_for_XML)
>>> so I can't imagine it would be resuscitated in a (for better or worse) JSON-centric
>>> world.
>>>
>>> —— Sandy
>>>
>>> _______________________________________________
>>> es-discuss mailing list
>>> [hidden email]
>>> https://mail.mozilla.org/listinfo/es-discuss
>>> _______________________________________________
>>> es-discuss mailing list
>>> [hidden email]
>>> https://mail.mozilla.org/listinfo/es-discuss
>>
>> --
>> -----
>>
>> Isiah Meadows
>> [hidden email]
>> www.isiahmeadows.com
>> _______________________________________________
>> es-discuss mailing list
>> [hidden email]
>> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

Andrea Giammarchi-2
In reply to this post by ViliusCreator
People use JSX, which is basically E4X, so I'd argue the word useless is not really appropriate. You can use E4X to produce HTML, the fact we're talking XML is merely about the E4X background, but as you could produce strings out of E4X you could do the same and have better templating out of the box.

But like I've said, I already use template literal tags, but those strings don't get hints or highlights as if these were E4X, XML, or plain HTML, which is the only cool thing I'd personally find useful.

Maybe it's just a tooling issue though.

On Mon, May 20, 2019 at 3:06 PM ViliusCreator <[hidden email]> wrote:

> the client, it could still somehow shine in NodeJS though.

 

The only way it can shine is only passing HTML objects as arg to website. That’s it. And still, you can use string to do that for you. People already use JSON and I don’t think they would use XML in Node js. There are already tons of libs for XML stuff, yet they don’t have a lot of downloads, as far as I remember.

 

So basically, Node js doesn’t need XML. That would be useless.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal: native XML object support.

kai zhu
jsx is not terribly javascripty ... vs direct manipulation of the dom (using static-functions/handlers).

it requires two extra ux-workflow transformations -- 1) transpilation and 2) virtual-dom manipulation, for the sake of oft-quoted faster dom-performance, which some like me are skeptical is true in modern browsers.

-kai


On Tue, May 21, 2019, 16:35 Andrea Giammarchi <[hidden email]> wrote:
People use JSX, which is basically E4X, so I'd argue the word useless is not really appropriate. You can use E4X to produce HTML, the fact we're talking XML is merely about the E4X background, but as you could produce strings out of E4X you could do the same and have better templating out of the box.

But like I've said, I already use template literal tags, but those strings don't get hints or highlights as if these were E4X, XML, or plain HTML, which is the only cool thing I'd personally find useful.

Maybe it's just a tooling issue though.

On Mon, May 20, 2019 at 3:06 PM ViliusCreator <[hidden email]> wrote:

> the client, it could still somehow shine in NodeJS though.

 

The only way it can shine is only passing HTML objects as arg to website. That’s it. And still, you can use string to do that for you. People already use JSON and I don’t think they would use XML in Node js. There are already tons of libs for XML stuff, yet they don’t have a lot of downloads, as far as I remember.

 

So basically, Node js doesn’t need XML. That would be useless.

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
12