Re: Re: Proposal: native XML object support.
As a data point -- I was writing JavaScript applications with GPSEE, a server-side Spidermonkey embedding, for several years until recently. The design pattern was, for all intents and purposes, CGI. GPSEE has E4X capability. I used it a few times to generate xhtml documents. I never found a compelling application. Being able to use XML object literals honestly caused more problems than it solved. If I really needed XML interchange today, I would try really hard to represent it internally with javascript objects and render/parse it at the network boundary. The only two things I ever found useful in E4X was template strings (which we have in ES6 backticks now) and for each. Wes On Tue, 21 May 2019 at 19:58, Jacob Pratt wrote: > JSX doesn't necessarily need a vDOM. > > On Tue, May 21, 2019, 10:31 kai zhu wrote: > >> 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 < >> andrea.giammar...@gmail.com> 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 < >>> viliuskubilius...@gmail.com> 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 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 > -- Wesley W. Garland Director, Product Development PageMail, Inc. +1 613 542 2787 x 102 ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Re: Proposal: native XML object support.
JSX doesn't necessarily need a vDOM. On Tue, May 21, 2019, 10:31 kai zhu wrote: > 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 > 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 < >> viliuskubilius...@gmail.com> 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 >>> 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: Re: Proposal: native XML object support.
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 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 > 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 >> 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: Re: Proposal: native XML object support.
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 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 > 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.
> 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
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
Re: Re: Proposal: native XML object support.
> 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 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 `d `(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 > 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.
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 `d `(which is equivalent to ```json { ‘//name’: ‘a’, ‘//inner’: [‘d ’, {...}], b: ‘c’ } ```) and it’s more readable than JSON version of it.` --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss