This repository has been archived by the owner. It is now read-only.

Design: better pattern for inlining constant blocks of HTML #64

Open
myitcv opened this Issue Apr 30, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@myitcv
Owner

myitcv commented Apr 30, 2017

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.