This repository was archived by the owner on Aug 27, 2018. It is now read-only.
This repository was archived by the owner on Aug 27, 2018. It is now read-only.
Design: better pattern for inlining constant blocks of HTML #64
Open
Description
A better pattern for inlining constant blocks of HTML within components. This ultimately needs to take the form of some changes within the compiler (a la JSX in TypeScript). Assuming we're not going to make/rely on any language changes, we need to do this via something like react.JSX(s string)
where the compiler ensures the string
argument is a compile time constant (in this first instance, keep things simple), and then rewrites the AST to be the equivalent component constructor calls. In the short term, we could actually implement this at run time using https://godoc.org/golang.org/x/net/html and a reverse mapping from js
tags to field names (and panic if there are problems)