File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
tests/runtime-legacy/samples/binding-backflow Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ class Svelte4Component {
66
66
* }} options
67
67
*/
68
68
constructor ( options ) {
69
+ // Using proxy state here isn't completely mirroring the Svelte 4 behavior, because mutations to a property
70
+ // cause fine-grained updates to only the places where that property is used, and not the entire property.
71
+ // Reactive statements and actions (the things where this matters) are handling this properly regardless, so it should be fine in practise.
69
72
const props = $ . proxy ( { ...( options . props || { } ) , $$events : this . #events } , false ) ;
70
73
this . #instance = ( options . hydrate ? $ . hydrate : $ . mount ) ( options . component , {
71
74
target : options . target ,
Original file line number Diff line number Diff line change @@ -34,14 +34,14 @@ export default test({
34
34
35
35
p = parents [ 'reactive_mutate' ] ;
36
36
assert . deepEqual ( p . value , { foo : 'kid' } ) ;
37
- assert . equal ( p . updates . length , 1 ) ;
37
+ assert . equal ( p . updates . length , 2 ) ;
38
38
39
39
p = parents [ 'init_update' ] ;
40
40
assert . deepEqual ( p . value , { foo : 'kid' } ) ;
41
41
assert . equal ( p . updates . length , 2 ) ;
42
42
43
43
p = parents [ 'init_mutate' ] ;
44
44
assert . deepEqual ( p . value , { foo : 'kid' } ) ;
45
- assert . equal ( p . updates . length , 1 ) ;
45
+ assert . equal ( p . updates . length , 2 ) ;
46
46
}
47
47
} ) ;
You can’t perform that action at this time.
0 commit comments