Commit a3e1132
committed
fix(core): skip property-attribute emission for native elements + decode HTML entities on server walker read
Two related fixes to the property-binding SSR path.
1. Native-element guard. Property bindings on tags without a hyphen
(`<input .value=${v}>`) used to emit a `data-webjs-prop-value`
attribute, but nothing consumes it: the SSR walker only runs for
custom elements, and on the browser side, page-template re-execution
does not happen (page functions are server-only). The attribute was
dead weight. Skip emission for non-custom-element tags; the property
hole drops the same way it did before this branch.
2. HTML-entity decode in consumePropAttrs. parseAttrs returns the
literal characters between the quote marks; `escapeAttr` had
converted `"` to `"` on the way out, so the walker
was passing the still-escaped JSON to `parse()` and failing
silently. Added an `unescapeAttr` helper that reverses the
server-side escape (order matters: `<`, then `"`,
then `&`). The browser handles this automatically, so
client-side hydration was unaffected.
Updated the `drops properties on server` snapshot test to its new
behavior name and assertion: native-element property bindings stay
dropped.1 parent e8e4383 commit a3e1132
2 files changed
Lines changed: 40 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
210 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
211 | 221 | | |
212 | 222 | | |
213 | 223 | | |
| |||
686 | 696 | | |
687 | 697 | | |
688 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
689 | 715 | | |
690 | 716 | | |
691 | 717 | | |
| |||
702 | 728 | | |
703 | 729 | | |
704 | 730 | | |
705 | | - | |
| 731 | + | |
706 | 732 | | |
707 | 733 | | |
708 | 734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
0 commit comments