Repository navigation
Commit 035d3fa
docs: publish each page's own values through the scope channel on the three remaining teaching surfaces (#9376)
* docs: publish the page's own values through the scope channel, and name the three props the renderer never reads
The three remaining teaching surfaces from the objectui#8021 sweep — the root
README, the expression guide and the architecture guide — each wrote the page's
values onto the `SchemaRenderer` element and read them back under a bare head
name. `SchemaRendererProps` declares exactly one prop, `schema`; `data`,
`dataSource` and `debug` are forwarded to the component the schema names, so
nothing throws, nothing warns, and the expression reaches the screen as the
characters the author typed.
Both coordinates move together on every site, per objectui#8021 leg D:
* the six forwarded look-alikes become the provider that actually carries the
value — `PredicateScopeProvider` for the expression scope,
`SchemaRendererProvider` for the adapter and for `debug`;
* the head names are judged one at a time against the scope the tree builds.
Thirty-two stay bare, because after the objectui#9308 ruling the root set is
open: every key the host publishes is a root. Five move to `record.*` — the
two form-row sites and the three predicates written against a `form` root that
nothing in ObjectUI publishes.
`content/docs/guide/architecture.md` also carried the one `data.*` gate on these
pages. The census could not see it — its classifier held `data` in the ACCEPTED
root set — and it is exactly the spelling the ruling retires, so it moves to
`record.age` and the guide states the verdict flip: a missing root and a
present-but-undefined root are not the same, so a `data.*` gate that used to hide
its node on every row now shows it.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
* docs(expressions): state what an unresolvable expression actually does, measured
The Expression Errors block claimed `${user.invalidProperty}` yields
`Cannot read property 'invalidProperty' of undefined`. objectui#9297's addendum
flagged that as looking wrong and explicitly left it NOT MEASURED. Measured now,
on the built evaluator, and it is wrong in both directions:
{ user: { name: 'Alice' } } ${user.invalidProperty} => undefined
{} (no user root) ${user.invalidProperty} => "${user.invalidProperty}"
control, same instrument: ${user.name} => "Alice"
Nothing is thrown on either path. A missing MEMBER of a published root renders
as nothing; a missing ROOT renders as the characters the author typed, with one
console line.
Repaired here rather than filed because the same commit series now states, two
sections up, that an unresolvable template is returned as its own source text —
leaving the old sentence would have made the page contradict itself.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UzHd6hDYatoDn17BuwKxnZ
* docs: the missing-root path prints one console line, so say so
Two sentences this branch added taught silence on a path that is not
silent. Measured just now on the built evaluator
(`packages/core/dist`, console captured, one instance per leg):
{} (no user root) ${user.name} => "${user.name}" 1 console.warn
{ user: { name: 'Alice' } } ${user.invalidProperty} => undefined 0 lines
{ user: { name: 'Alice' } } ${user.name} => "Alice" 0 lines
harness control console.warn(sentinel) => fires 1 line
The line is `Failed to evaluate expression: ...` from `reportEvaluationFault`
in `packages/core/src/evaluator/ExpressionEvaluator.ts`, which falls back to
`console.warn` whenever the caller supplies no `onFault`. There is no
dev-only gate on it, and the six `evaluator.evaluate(...)` call sites in
`packages/react/src/SchemaRenderer.tsx` that resolve `content`, `properties.*`
and `props.*` all pass no options, so the doc-relevant path is exactly the
built-in warn. The one-per-authored-source ceiling in that same function is
why the count is one line and not one per render.
This branch already stated the true half two sections down in the expression
guide's Expression Errors table — "the template's own source text, and one
line on the console" — so the page contradicted itself inside one diff.
Both sentences now carry that same phrasing rather than new wording.
`content/docs/guide/schema-rendering.md` carries the same claim at the same
head; it is outside this pull request's file set and is left byte-identical.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5xpA5q533BgTTNADibEFt
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6748587 commit 035d3fa
3 files changed
Lines changed: 159 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
99 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
105 | 117 | | |
106 | 118 | | |
107 | 119 | | |
| |||
171 | 183 | | |
172 | 184 | | |
173 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
174 | 190 | | |
175 | 191 | | |
176 | 192 | | |
| |||
258 | 274 | | |
259 | 275 | | |
260 | 276 | | |
261 | | - | |
| 277 | + | |
262 | 278 | | |
263 | | - | |
| 279 | + | |
264 | 280 | | |
265 | 281 | | |
266 | 282 | | |
| |||
271 | 287 | | |
272 | 288 | | |
273 | 289 | | |
274 | | - | |
275 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
276 | 295 | | |
277 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
278 | 302 | | |
279 | 303 | | |
280 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
142 | | - | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
156 | | - | |
| 161 | + | |
157 | 162 | | |
158 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
159 | 168 | | |
160 | 169 | | |
161 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
162 | 180 | | |
163 | 181 | | |
164 | 182 | | |
| |||
244 | 262 | | |
245 | 263 | | |
246 | 264 | | |
247 | | - | |
248 | | - | |
| 265 | + | |
| 266 | + | |
249 | 267 | | |
250 | 268 | | |
251 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
252 | 276 | | |
253 | 277 | | |
254 | 278 | | |
| |||
0 commit comments