Repository navigation
Commit 160c57f
feat(compiler): emit the spread/ssrElement sources array for multi-source element spreads
Native elements with several spread sources compile to the runtimes' array
form instead of a mergeProps() call, in DOM and SSR output, in both the
Babel plugin and the native compiler:
<div id="x" {...a} {...b}>
→ spread(el, [{ id: "x" }, a, b], skipChildren) (dom)
→ ssrElement("div", [{ id: "x" }, a, b], children, id) (ssr)
The runtimes read the sources directly — later sources win per key, only
the winning source is read — so there is no merge proxy to build and walk
once. A reactive spread is a plain thunk called inside the tracking scope:
no memo, so no hydration id on either side. That also retires the
hydratable SSR `() => mergeProps(...)` wrapper, which existed only to order
the merge memo's id after the element's key; a lone dynamic spread left
behind once the server drops on*/prop:/children keys now passes through as
the props thunk itself. A lone spread still passes straight through
(#3105). Universal output is unchanged; its runtime spread has no array
form yet.
Requires @solidjs/web with the array forms (#3418, #3419). Fixtures
regenerated for both compilers; the recorded cross-mode Babel/Oxc
divergences changed only in context (mergeProps → array).
Co-authored-by: Cursor <[email protected]>1 parent 7f6332a commit 160c57f
42 files changed
Lines changed: 846 additions & 675 deletions
File tree
- .changeset
- packages
- babel-plugin
- src
- dom
- ssr
- test
- __dom_compatible_fixtures__/attributeExpressions
- __dom_fixtures__
- attributeExpressions
- insertChildren
- jsxAttributeValues
- __dom_hydratable_fixtures__
- attributeExpressions
- insertChildren
- jsxAttributeValues
- __dynamic_fixtures__
- attributeExpressions
- insertChildren
- __ssr_fixtures__
- attributeExpressions
- insertChildren
- jsxAttributeValues
- __ssr_hydratable_fixtures__
- attributeExpressions
- insertChildren
- jsxAttributeValues
- compiler
- __tests__
- fixtures
- dom-hydratable
- attributeExpressions
- insertChildren
- jsxAttributeValues
- dom
- attributeExpressions
- insertChildren
- jsxAttributeValues
- dynamic
- attributeExpressions
- insertChildren
- ssr-hydratable
- attributeExpressions
- insertChildren
- jsxAttributeValues
- ssr
- attributeExpressions
- insertChildren
- jsxAttributeValues
- parity/expected-cross
- ssr-hydratable
- ssr
- tsrx-ssr
- src
- dom
- ssr
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1691 | 1691 | | |
1692 | 1692 | | |
1693 | 1693 | | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
1699 | 1700 | | |
1700 | 1701 | | |
1701 | 1702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
994 | | - | |
995 | 994 | | |
996 | 995 | | |
997 | 996 | | |
| |||
1001 | 1000 | | |
1002 | 1001 | | |
1003 | 1002 | | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
1004 | 1009 | | |
1005 | 1010 | | |
1006 | 1011 | | |
1007 | | - | |
| 1012 | + | |
1008 | 1013 | | |
1009 | 1014 | | |
1010 | 1015 | | |
| |||
1043 | 1048 | | |
1044 | 1049 | | |
1045 | 1050 | | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
1061 | 1058 | | |
1062 | 1059 | | |
1063 | 1060 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
| 107 | + | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
113 | | - | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
137 | 136 | | |
138 | 137 | | |
139 | 138 | | |
140 | | - | |
| 139 | + | |
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
| |||
307 | 306 | | |
308 | 307 | | |
309 | 308 | | |
310 | | - | |
311 | | - | |
312 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
313 | 315 | | |
314 | 316 | | |
315 | 317 | | |
| |||
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
322 | | - | |
323 | | - | |
324 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
325 | 330 | | |
326 | 331 | | |
327 | 332 | | |
328 | 333 | | |
329 | 334 | | |
330 | 335 | | |
331 | | - | |
| 336 | + | |
332 | 337 | | |
333 | 338 | | |
334 | 339 | | |
335 | 340 | | |
336 | 341 | | |
337 | | - | |
| 342 | + | |
338 | 343 | | |
339 | 344 | | |
340 | 345 | | |
341 | 346 | | |
342 | 347 | | |
343 | 348 | | |
344 | | - | |
| 349 | + | |
345 | 350 | | |
346 | 351 | | |
347 | 352 | | |
| |||
350 | 355 | | |
351 | 356 | | |
352 | 357 | | |
353 | | - | |
| 358 | + | |
354 | 359 | | |
355 | 360 | | |
356 | 361 | | |
| |||
595 | 600 | | |
596 | 601 | | |
597 | 602 | | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
604 | 612 | | |
605 | 613 | | |
606 | 614 | | |
607 | 615 | | |
608 | 616 | | |
609 | 617 | | |
610 | | - | |
| 618 | + | |
611 | 619 | | |
612 | 620 | | |
613 | 621 | | |
| |||
617 | 625 | | |
618 | 626 | | |
619 | 627 | | |
620 | | - | |
| 628 | + | |
621 | 629 | | |
622 | 630 | | |
623 | 631 | | |
624 | 632 | | |
625 | 633 | | |
626 | 634 | | |
627 | | - | |
| 635 | + | |
628 | 636 | | |
629 | 637 | | |
630 | 638 | | |
| |||
638 | 646 | | |
639 | 647 | | |
640 | 648 | | |
641 | | - | |
| 649 | + | |
642 | 650 | | |
643 | 651 | | |
644 | 652 | | |
| |||
815 | 823 | | |
816 | 824 | | |
817 | 825 | | |
818 | | - | |
| 826 | + | |
819 | 827 | | |
820 | 828 | | |
821 | 829 | | |
| |||
824 | 832 | | |
825 | 833 | | |
826 | 834 | | |
827 | | - | |
| 835 | + | |
828 | 836 | | |
829 | 837 | | |
830 | 838 | | |
| |||
0 commit comments