Commit d4360af
chore: rewrite set_class() to handle directives (#15352)
* set_class with class: directives
* update expected result (remove leading space)
* fix
* optimize literals
* add test
* add test for mutations on hydration
* clean observer
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
unused
Co-authored-by: Rich Harris <[email protected]>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
unused for now
Co-authored-by: Rich Harris <[email protected]>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js
unused for now
Co-authored-by: Rich Harris <[email protected]>
* Update packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js
nit
Co-authored-by: Rich Harris <[email protected]>
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
nit
Co-authored-by: Rich Harris <[email protected]>
* Update packages/svelte/src/internal/shared/attributes.js
rename clazz to value :D
Co-authored-by: Rich Harris <[email protected]>
* remove unused + fix JSDoc
* drive-by fix
* minor style tweaks
* tweak test
* this is faster
* tweak
* tweak
* this is faster
* typo
* tweak
* changeset
---------
Co-authored-by: Rich Harris <[email protected]>
Co-authored-by: Rich Harris <[email protected]>1 parent 5a946e7 commit d4360af
File tree
19 files changed
+688
-329
lines changed- .changeset
- packages/svelte
- src
- compiler/phases
- 2-analyze
- 3-transform
- client/visitors
- internal
- client
- dom
- elements
- server
- tests
- css/samples/undefined-with-scope
- runtime-legacy/samples
- attribute-null-classname-with-style
- attribute-null-func-classname-with-style
- runtime-runes/samples
- class-directive-mutations
- class-directive
19 files changed
+688
-329
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
767 | 767 | | |
768 | 768 | | |
769 | 769 | | |
| 770 | + | |
770 | 771 | | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
785 | 776 | | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
790 | 780 | | |
791 | | - | |
792 | | - | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
793 | 790 | | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
827 | 801 | | |
828 | | - | |
829 | | - | |
| 802 | + | |
| 803 | + | |
830 | 804 | | |
831 | 805 | | |
832 | 806 | | |
| |||
Lines changed: 61 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
231 | | - | |
232 | | - | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
276 | | - | |
| 277 | + | |
| 278 | + | |
277 | 279 | | |
278 | | - | |
279 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
280 | 289 | | |
281 | 290 | | |
282 | 291 | | |
| |||
290 | 299 | | |
291 | 300 | | |
292 | 301 | | |
293 | | - | |
294 | | - | |
295 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
296 | 313 | | |
297 | 314 | | |
298 | 315 | | |
299 | 316 | | |
300 | | - | |
301 | | - | |
| 317 | + | |
302 | 318 | | |
303 | 319 | | |
304 | 320 | | |
| |||
491 | 507 | | |
492 | 508 | | |
493 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
494 | 531 | | |
495 | 532 | | |
496 | 533 | | |
| |||
517 | 554 | | |
518 | 555 | | |
519 | 556 | | |
| 557 | + | |
520 | 558 | | |
521 | 559 | | |
522 | 560 | | |
| |||
525 | 563 | | |
526 | 564 | | |
527 | 565 | | |
| 566 | + | |
528 | 567 | | |
529 | 568 | | |
530 | 569 | | |
| |||
563 | 602 | | |
564 | 603 | | |
565 | 604 | | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
579 | 614 | | |
580 | 615 | | |
581 | 616 | | |
| |||
639 | 674 | | |
640 | 675 | | |
641 | 676 | | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | 677 | | |
651 | 678 | | |
652 | 679 | | |
| |||
Lines changed: 28 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
90 | 106 | | |
91 | 107 | | |
92 | 108 | | |
93 | 109 | | |
94 | 110 | | |
95 | 111 | | |
| 112 | + | |
96 | 113 | | |
97 | 114 | | |
98 | 115 | | |
99 | 116 | | |
100 | 117 | | |
101 | | - | |
102 | | - | |
| 118 | + | |
103 | 119 | | |
104 | 120 | | |
105 | 121 | | |
106 | | - | |
107 | | - | |
| 122 | + | |
108 | 123 | | |
109 | 124 | | |
110 | 125 | | |
| |||
0 commit comments