You are reading a single comment by @Serj and its replies. Click here to read the full conversation.
  • I like the Bangle.js Layout library, and I like React. Both are similar, in my opinion. One thing React has which Layout doesn't is JSX: Instead of having to write object literals or function calls, it can be something which looks like HTML or XML.
    For example:

    const layoutObj = <Vertical>
        <Label font="20%">JSX</Label>
        <Button col="blue">Maybe</Label>
    </Vertical>;
    

    instead of

    const layout = { type: "v", c:[
      { type: "txt", font: "20%", label: "JSX"},
      { type: "btn", color: "blue", label:"maybe"}
    ]}
    

    I think it would be cool if the Espruino interpreter supported some form of JSX, since it would make Bangle.js Layout code be easier to read.
    I've made a local branch which implements JSX in the interpreter.
    I think there can be a problem with JsHint not supporting it and stuff, but maybe it can remedied by updating CodeMirror to use ESLint?

  • Hi! Сorrect the typo, otherwise people won't understand why it's written that way :)
    instead

    <Button col="blue">Maybe</Label>
    
    <Button col="blue">Maybe</Button>
    
About

Avatar for Serj @Serj started