Re:JavaScript once had a JSX-like syntax called E4X
by Marazan on Saturday March 18, 2017 @12:26PM
(#13902000)
E4X was part of Actionscript 3. It was very nice.
[ Parent
| on HN ]
Re:JavaScript once had a JSX-like syntax called E4X
by jadbox on Saturday March 18, 2017 @02:49PM
(#13902831)
It was also widely used for Adobe Flex for making Flash interfaces.
"Everything old becomes new again."
Re:JavaScript once had a JSX-like syntax called E4X
by bbcbasic on Saturday March 18, 2017 @07:28PM
(#13904060)
I quite loved my small stint developing in Adobe flex. I have to admit it.
Re:JavaScript once had a JSX-like syntax called E4X
by lscharen on Saturday March 18, 2017 @10:13PM
(#13904773)
I share that sentiment. The complete decoupling of UI presentation and logic all the way up to and through asset deployment via Flex Skins was interesting and had a lot of potential.
Re:JavaScript once had a JSX-like syntax called E4X
by abalone on Saturday March 18, 2017 @05:55PM
(#13903711)
You're thinking of MXML. Different thing.
Re:JavaScript once had a JSX-like syntax called E4X
by synja on Saturday March 18, 2017 @06:01PM
(#13903739)
Nope. E4X was inline XML and it has been in AS3 for many many years.
Sad to see that all these great and convenient language features will take years (or never) to reach JS now that we voluntarily handcuffed ourselves to standards based tech just to satisfy the vendetta of a dead man.
But at least Flash is dead, right?
Re:JavaScript once had a JSX-like syntax called E4X
by MattRix on Saturday March 18, 2017 @06:44PM
(#13903877)
The post you're responding to was talking about the markup language used for Flex, which was MXML, not E4X.
Re:JavaScript once had a JSX-like syntax called E4X
by bshimmin on Saturday March 18, 2017 @01:47PM
(#13902507)
I always found it a little odd but quite pleasant - but I don't at all remember AS3's E4X having interpolation. Did I just never know about this feature (or have since forgotten - it's been, oh, half a decade at least since I've used ActionScript 3 in anger), or was it missing?
Re:JavaScript once had a JSX-like syntax called E4X
by jsjohnst on Saturday March 18, 2017 @02:25PM
(#13902719)
It existed in AS3 too. Wasn't widely known to my knowledge though.
Re:JavaScript once had a JSX-like syntax called E4X
by bshimmin on Saturday March 18, 2017 @03:45PM
(#13903139)
Thank you - confirmed. I just dug up a copy of Flash CS6 and tried this:
var val : String = "foo";
var foo : XML = <foo><bar prop={val} /></foo>;
...and it worked. I swear this wasn't documented anywhere. That said, I just googled a few Flex examples (I never used Flex) and it seems to be common there, so I guess that explains why at least someone knew it existed!
Re:JavaScript once had a JSX-like syntax called E4X
by krilnon on Saturday March 18, 2017 @05:22PM
(#13903582)
It's documented. I used to be very fluent in the AS3LR, and I found it in a minute or two here: http://help.adobe.com/en_US/FlashPlatform/reference/actionsc...
The formal language specification came fairly late in AS3's useful life, but it also describes the syntax: http://help.adobe.com/livedocs/specs/actionscript/3/as3_spec...
Re:JavaScript once had a JSX-like syntax called E4X
by bshimmin on Saturday March 18, 2017 @06:02PM
(#13903744)
Ah, thank you for these. I skimmed the documentation about AS3's XML support and didn't see it there, and I'm not sure "operators" would be a place I would've looked!
I don't know if this would've been a super useful feature for me a decade ago, but it's nice to know it was there anyway.
Re:JavaScript once had a JSX-like syntax called E4X
by jsjohnst on Saturday March 18, 2017 @05:05PM
(#13903520)
That's possibly why I knew about it then (for a brief period, I did Flex work ten years ago).
Re:JavaScript once had a JSX-like syntax called E4X
by robinduckett on Saturday March 18, 2017 @05:12PM
(#13903545)
I used to do Flex a long time ago, and I love how the frontend dev world is finally catching up to Flash from the late naughties.
Re:JavaScript once had a JSX-like syntax called E4X
by Marazan on Sunday March 19, 2017 @06:55AM
(#13906360)
Flash won. The world of Internet development is slowly being remade in Flex's image.
That Adobe abandoned he technology rather that retooling it to target HTML5 is a strategic blunder up there with... I can't actually work out an equivalent.