cgrand / enlivez

8 stars 0 forks source link

Day #6 #15

Closed cgrand closed 5 years ago

cgrand commented 5 years ago

Ok, so I have figured the 3 basic types of templates (I can think of at least one more but less essential):

with

It's for looping, it has one query, one child, an optional sort.

foreign

Foreign nodes are leaves of the template tree: that's where EZ stops, usually foreign nodes will render to attributes or text nodes, but they may return full blown DOM nodes (eg to include a React component).

Foreign nodes have no child, but vars they depend on and a function to render and update. Foreign components have state.

fragments

Fragments are fill-in-the-blanks html. They have no query, they don't use vars on their own, they do have children (one for each blank).

Summary

type with foreign fragment
query yes no no
vars no yes no
children 1 0 N