Skip to content

Commit 52a82cd

Browse files
committed
More details in example
1 parent a166698 commit 52a82cd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

rfcs/2024-05-21-ui-component-model.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,16 @@ A simple counter example:
108108
Under the hood, the system might be doing something like this:
109109

110110
```js
111-
// ...Somewhere in the runtime, invisible to the module...
111+
// ...Somewhere in the runtime, invisible to the module
112112

113-
// Preprocessor somehow gets exports from script block
114-
import * as env from 'module:script'
113+
// System somehow compiles the component definition
114+
const {env, template} = compile(component)
115115

116-
// Env contains the exported variables. E.g.
116+
// `template` contains the string contents of the template block.
117+
// `env` contains the exports from the script block, e.g.
117118
// const {setClicks, count} = env
118119

119-
// Template is populated and returns a UI tree with dynamic bindings
120+
// Template is turned into a UI tree with dynamic bindings
120121
// at specific locations in the tree
121122
const vdom = populate(template, env)
122123

0 commit comments

Comments
 (0)