Crazy Idea: Deprecate JSXText?
Currently we allow arbitrary text content to flow amongst tags. However, we have noticed that while building UIs, you actually don't utilize this very much. @syranide can speak more to this. You usually want to wrap your text content in some other container. E.g. instead of writing it like this: ``` js <div> Foo <Button /> </div> ``` You should write something like this: ``` js <div> <Label text="Foo" /> <Button /> </div> ``` At the very least you want to wrap it for internationalization purposes: ``` js <div> <Intl message="Foo" desc="A label" /> <Button /> </div> ``` What if we only treated it as a sequence of expressions and got rid of the curlies? We don't really need curlies around attributes since they can disambiguated with parenthesis if necessary. That way the JSX example would become: ``` js var box = <Box> shouldShowAnswer(user) ? <Answer value=false>"no"</Answer> : <Box.Comment> "Text Content" </Box.Comment> </Box>; ``` No curlies! Multiple JSXChildren have to be delimitated by `,`. A JSX elements doesn't need to be followed by a comma. ``` js var box = <Box> "Leading text", functionCall(), <Answer value={'this is': 'an object'}>"yes"</Answer> <Box.Comment><Child /></Box.Comment> anotherFunctionCall(), <OptionalTrailingComma />, (expr + ession) </Box>; ``` This moves the design further away from HTML generation and towards UI composition.
Posted by sebmarkbage on May 17, 2015, 5:35 AM
Tags
Related issues
- To be fair, Inform7 can't succeed, generally, because there is no market for the kind of games that you create with Inform7.
- > The notion that somehow LR reliability is misunderstood by Consumer Reports, JD Power, Car & Driver, Automobile etc.
- Custom trigger IDs are not displayed in the new 2026.10 trigger selector
- I hate that too, but I think it’s more the ux than the concept of a default.
- > The biggest problem with UX developers is they know better than you AND force you into their paradigm.
- "Focus follows mouse" is what I use to keep the file manager from popping up when click-dragging files.
Raise real-world problems, find people facing the same issue, and discuss solutions.6,500 issues0 comments
ux (Other)
To be fair, Inform7 can't succeed, generally, because there is no market for the kind of games that you create with Inform7.
> The notion that somehow LR reliability is misunderstood by Consumer Reports, JD Power, Car & Driver, Automobile etc.
Custom trigger IDs are not displayed in the new 2026.10 trigger selector
I hate that too, but I think it’s more the ux than the concept of a default.
> The biggest problem with UX developers is they know better than you AND force you into their paradigm.
"Focus follows mouse" is what I use to keep the file manager from popping up when click-dragging files.
The biggest problem with this is if the target URL doesn't load but also doesn't quickly error out, like e.g.
Google wants to build up a private web here.
Crazy Idea: Deprecate JSXText?
Currently we allow arbitrary text content to flow amongst tags. However, we have noticed that while building UIs, you actually don't utilize this very much. @syranide can speak more to this. You usually want to wrap your text content in some other container. E.g. instead of writing it like this: ``` js <div> Foo <Button /> </div> ``` You should write something like this: ``` js <div> <Label text="Foo" /> <Button /> </div> ``` At the very least you want to wrap it for internationalization purposes: ``` js <div> <Intl message="Foo" desc="A label" /> <Button /> </div> ``` What if we only treated it as a sequence of expressions and got rid of the curlies? We don't really need curlies around attributes since they can disambiguated with parenthesis if necessary. That way the JSX example would become: ``` js var box = <Box> shouldShowAnswer(user) ? <Answer value=false>"no"</Answer> : <Box.Comment> "Text Content" </Box.Comment> </Box>; ``` No curlies! Multiple JSXChildren have to be delimitated by `,`. A JSX elements doesn't need to be followed by a comma. ``` js var box = <Box> "Leading text", functionCall(), <Answer value={'this is': 'an object'}>"yes"</Answer> <Box.Comment><Child /></Box.Comment> anotherFunctionCall(), <OptionalTrailingComma />, (expr + ession) </Box>; ``` This moves the design further away from HTML generation and towards UI composition.
Comments (0)
No comments yet. Start the discussion.