JSX in detail
11–20 of 73 posts
Re: JSX in detail
#12Has anyone else made the switch from JSX to hyperscript? JSX works well enough, but I love the consistency and composability of building views with plain old functions and data structures.
Re: JSX in detail
#13Earlier quoted context omitted.
In LISP based languages like ClojureScript, macros are part of the language. No need to build tools like JSX (that requires to run on webpack + IDE tooling etc...).
I could be wrong, but I don't think a LISP macro can transform the structure of the code in the same way that the JSX pragma turns an XML tree "inside-out". For example here's the source for the Babel JSX transformer: https://github.com/babel/babel/blob/master/packages/babel-pl...
Re: JSX in detail
#14Experimenting with JSX has introduced me to two language constructs: the Pragma, and the Macro. I know that these might seem a bit pedestrian to most folks, but they opened up my understanding of programming languages considerably. I am genuinely a bit surprised that the Javascript community hasn't played around more with the possibilities that both can offer.
In LISP based languages like ClojureScript, macros are part of the language. No need to build tools like JSX (that requires to run on webpack + IDE tooling etc...).
Doing it the Lispy way, though, you'd likely use sexprs directly, with maybe some normal macros, so you wouldn't have HTML-like syntax but would have something that worked nicely in your editor.
Re: JSX in detail
#15Has anyone else made the switch from JSX to hyperscript? JSX works well enough, but I love the consistency and composability of building views with plain old functions and data structures.
Re: JSX in detail
#16Earlier quoted context omitted.
In LISP based languages like ClojureScript, macros are part of the language. No need to build tools like JSX (that requires to run on webpack + IDE tooling etc...).
I could be wrong, but I don't think a LISP macro can transform the structure of the code in the same way that the JSX pragma turns an XML tree "inside-out". For example here's the source for the Babel JSX transformer: https://github.com/babel/babel/blob/master/packages/babel-pl...
However, you'd be very unlikely to make something as syntactically heavy as JSX in Lisp. Lisp ethos is to keep the syntax as simple as possible, so it stays out of the way.
Re: JSX in detail
#17Experimenting with JSX has introduced me to two language constructs: the Pragma, and the Macro. I know that these might seem a bit pedestrian to most folks, but they opened up my understanding of programming languages considerably. I am genuinely a bit surprised that the Javascript community hasn't played around more with the possibilities that both can offer.
Re: JSX in detail
#18Experimenting with JSX has introduced me to two language constructs: the Pragma, and the Macro. I know that these might seem a bit pedestrian to most folks, but they opened up my understanding of programming languages considerably. I am genuinely a bit surprised that the Javascript community hasn't played around more with the possibilities that both can offer.
Re: JSX in detail
#19https://github.com/mlmorg/react-hyperscript/blob/master/inde...
Re: JSX in detail
#20Earlier quoted context omitted.
JSX could be language-integrated (witness the now-deprecated E4X for XML literals in Javascript), it just is not. And most lisps don't have unfettered reader macros which would allow embedding macros using non-lisp syntax (aka JSX). A macroed JSX wouldn't make much sense in Lisps really, and AFAIK isn't used with most clojurescript vdoms using either hiccup structures or regular function calls.
who needs JSX when you have hiccup!
In fact I'd argue the value proposition of JSX is already relatively low when you factor in hyperscript in regular javascript (and yes there are component-compatible hyperscript helpers for React).