Do you think future, new languages, should have a JSX-like syntax built-in? Why or why not? Alternatives?
-
Show this thread
-
Replying to @_jayphelps
strong yes. very simply, tree data structures are super useful, *especially* for UIs, and plain functions aren't super satisfying for describing them (sorry lispers). syntax goes a long way for making these accessible to write and read.
5 replies 0 retweets 21 likes -
Replying to @threepointone @_jayphelps
What do you think an agonostic syntax would look like? `React.createElement` isn't a generic target, defining with
@jsx annotations is also gross.2 replies 0 retweets 6 likes -
Replying to @sebmck @threepointone and
Reason translates JSX to normal function calls, which I think is a great and flexible solution not tied to a specific framework:https://reasonml.github.io/docs/en/jsx
1 reply 0 retweets 5 likes -
Replying to @mariusschulz @threepointone and
Not sure that would work with the current React model. Functional components aren't instances of anything.
1 reply 0 retweets 1 like -
Replying to @sebmck @mariusschulz and
<Element /> calling `(Element.createElement || Element)(props)` would make sense to both modules exposing specific DSLs and functions. I dig Pastel for Reason: easy string coloring in a tree format. Easier to grasp than chalk, feels like <font color>
1 reply 0 retweets 0 likes
But you don't want to call functional components. Their execution should be handled by React since it may want to defer them and keep bookkepping of the current component being rendered. There's a ton of complications with making it generic.
-
-
Replying to @sebmck @mariusschulz and
Yeah forgot about that. Sorry. I guess this is why
@andreypopp mentioned that it feels like React components should be more than just functions (`useRender`), because they’re not 1:1 with functions and this abstraction makes tight coupling with React internals0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 