You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Wow, that's impressive!

    I'm a bit new to this, but how does JSX normally work? Obviously if I paste this into a browser or Node.js, I get Unexpected token '<' - so does React rely on transpiling this code before upload? Or does it do some weird parsing/code rewriting thing normally?

    I'm a bit iffy about building stuff into the interpreter itself that isn't part of the default JS spec - for instance looking at the changes I believe that the line 1 < /a/.exec("Hallo").index works at the moment but would fail with the new changes.

    At the end of the day, Espruino really isn't anywhere near React, so I think if people start thinking the layout library behaves like it they will ultimately end up confused/disappointed.

    However if we could actually just turn this into a generic XML parser then that could be awesome, and we could build functionality a bit like you're suggesting right in:

    const layout= new Layout(`<Vertical>
        <Label font="20%">JSX</Label>
        <Button col="blue">Maybe</Label>
    </Vertical>`);
    
About

Avatar for Gordon @Gordon started