Re: Proposal: native XML object support.
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 https://pay.weixin.qq.com/wiki/doc/api/download/wxpay_document.zip [2] swagger documentation for wechat-pay https://kaizhu256.github.io/node-swgg-wechat-pay/build..beta..travis-ci.org/app/ On Tue, May 21, 2019, 05:08 Michał Wadas 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 > 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 >> cont...@isiahmeadows.com >> www.isiahmeadows.com >> >> On Wed, May 15, 2019 at 11:39 PM Jordan Harband 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 >> 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. `` is one reason XML would've been better than >> SGML IMHO.) >> >> >> >> On Tue, May 14, 2019 at 01:47 Ed Saleh 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 on behalf of >> Sanford Whiteman >> >>> Sent: Tuesday, May 14, 2019 1:37:46 AM >> >>> To: es-discuss@mozilla.org >> >>> Subject: Re: Proposal: native XML object support. >> >>> >> >>> > let foo = >> >>> >> >>> 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 >> >>> es-discuss@mozilla.org >> >>> https://mail.mozilla.org/listinfo/es-discuss >> >>> ___ >> >>> es-discuss mailing list >> >>> es-discuss@mozilla.org >> >>> https://mail.mozilla.org/listinfo/es-discuss >> >> >> >> -- >> >> - >> >> >> >> Isiah Meadows >> >> cont...@isiahmeadows.com >> >> www.isiahmeadows.com >> >> ___ >> >> es-discuss mailing list >> >> es-discuss@mozilla.org >> >> https://mail.mozilla.org/listinfo/es-discuss >> ___ >> es-discuss mailing list >> es-discuss@mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Proposal: native XML object support.
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 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 > cont...@isiahmeadows.com > www.isiahmeadows.com > > On Wed, May 15, 2019 at 11:39 PM Jordan Harband 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 > 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. `` is one reason XML would've been better than > SGML IMHO.) > >> > >> On Tue, May 14, 2019 at 01:47 Ed Saleh 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 on behalf of > Sanford Whiteman > >>> Sent: Tuesday, May 14, 2019 1:37:46 AM > >>> To: es-discuss@mozilla.org > >>> Subject: Re: Proposal: native XML object support. > >>> > >>> > let foo = > >>> > >>> 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 > >>> es-discuss@mozilla.org > >>> https://mail.mozilla.org/listinfo/es-discuss > >>> ___ > >>> es-discuss mailing list > >>> es-discuss@mozilla.org > >>> https://mail.mozilla.org/listinfo/es-discuss > >> > >> -- > >> - > >> > >> Isiah Meadows > >> cont...@isiahmeadows.com > >> www.isiahmeadows.com > >> ___ > >> es-discuss mailing list > >> es-discuss@mozilla.org > >> https://mail.mozilla.org/listinfo/es-discuss > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Proposal: native XML object support.
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 cont...@isiahmeadows.com www.isiahmeadows.com On Wed, May 15, 2019 at 11:39 PM Jordan Harband 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 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.
Re: Re: Proposal: native XML object support.
> 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 es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Re: Proposal: native XML object support.
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 `() => ` is always new node while `() => html``` 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 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`something` > > ``` > > > This should make editor auto-complete xml object for you. > ___ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Re: Proposal: native XML object support.
> 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`something` ``` This should make editor auto-complete xml object for you. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
javascripty-ness or python-like idioms for javascript
coming from a python background, it would be nice if javascript had some core design-philosophy to guide its evolution rather than haphazardly following fads and cues from other languages. currently, my strawman idea of what constitutes javascripty-ness is: "achieving your ux-workflow objective, such that passing end-to-end data between [client/server/storage] nodes and components requires the fewest and least-complicated transformation-steps possible." for example, i wouldn't consider the temporal-proposal very javascripty, since it uses excessive [class] transformations to baton-pass datetime between nodes, compared to say ... using static-functions that input/output mostly canonical-isostrings. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Re: Proposal: native XML object support.
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 on behalf of liorean Sent: Monday, May 20, 2019 3:03:04 AM To: Jacob Bloom Cc: ViliusCreator; es-discuss@mozilla.org Subject: Re: Re: Proposal: native XML object support. You could already do something like this: let RawXML=xml`some content` ,XMLApplication=rss` RSS Title This is an example of an RSS feed http://www.example.com/main.html Mon, 06 Sep 2010 00:01:00 + Sun, 06 Sep 2009 16:20:00 + 1800 Example entry Here is some text containing an interesting description. http://www.example.com/blog/post/1 7bd204c6-1655-4c27-aeee-53f933c5395f Sun, 06 Sep 2009 16:20:00 + ` // 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 es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Re: Proposal: native XML object support.
You could already do something like this: let RawXML=xml`some content` ,XMLApplication=rss` RSS Title This is an example of an RSS feed http://www.example.com/main.html Mon, 06 Sep 2010 00:01:00 + Sun, 06 Sep 2009 16:20:00 + 1800 Example entry Here is some text containing an interesting description. http://www.example.com/blog/post/1 7bd204c6-1655-4c27-aeee-53f933c5395f Sun, 06 Sep 2009 16:20:00 + ` // 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 es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss