File tree Expand file tree Collapse file tree 5 files changed +11
-45
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 5 files changed +11
-45
lines changed Original file line number Diff line number Diff line change @@ -20,23 +20,6 @@ function log_entry(signal, traces = []) {
20
20
return ;
21
21
}
22
22
23
- if ( signal . trace ) {
24
- var previous_captured_signals = captured_signals ;
25
- var captured = new Set ( ) ;
26
- set_captured_signals ( captured ) ;
27
-
28
- try {
29
- untrack ( signal . trace ) ;
30
- } finally {
31
- set_captured_signals ( previous_captured_signals ) ;
32
- }
33
-
34
- if ( captured . size > 0 ) {
35
- for ( const dep of captured ) log_entry ( dep ) ;
36
- return ;
37
- }
38
- }
39
-
40
23
const type = ( signal . f & DERIVED ) !== 0 ? '$derived' : '$state' ;
41
24
const current_reaction = /** @type {Reaction } */ ( active_reaction ) ;
42
25
const dirty = signal . wv > current_reaction . wv || current_reaction . wv === 0 ;
Original file line number Diff line number Diff line change @@ -524,16 +524,6 @@ function create_item(
524
524
var v = reactive ? ( mutable ? mutable_source ( value ) : source ( value ) ) : value ;
525
525
var i = ( flags & EACH_INDEX_REACTIVE ) === 0 ? index : source ( index ) ;
526
526
527
- if ( DEV && reactive ) {
528
- // For tracing purposes, we need to link the source signal we create with the
529
- // collection + index so that tracing works as intended
530
- /** @type {Value } */ ( v ) . trace = ( ) => {
531
- var collection_index = typeof i === 'number' ? index : i . v ;
532
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
533
- get_collection ( ) [ collection_index ] ;
534
- } ;
535
- }
536
-
537
527
/** @type {EachItem } */
538
528
var item = {
539
529
i,
Original file line number Diff line number Diff line change @@ -66,7 +66,6 @@ export function source(v, stack) {
66
66
67
67
if ( DEV && tracing_mode_flag ) {
68
68
signal . created = stack ?? get_stack ( 'CreatedAt' ) ;
69
- signal . trace = null ;
70
69
}
71
70
72
71
return signal ;
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ export interface Value<V = unknown> extends Signal {
22
22
updated ?: Error | null ;
23
23
trace_need_increase ?: boolean ;
24
24
trace_v ?: V ;
25
- trace ?: null | ( ( ) => void ) ;
26
25
}
27
26
28
27
export interface Reaction extends Signal {
Original file line number Diff line number Diff line change @@ -779,26 +779,21 @@ export function get(signal) {
779
779
active_reaction !== null &&
780
780
tracing_expressions . reaction === active_reaction
781
781
) {
782
- // Used when mapping state between special blocks like `each`
783
- if ( signal . trace ) {
784
- signal . trace ( ) ;
785
- } else {
786
- var trace = get_stack ( 'TracedAt' ) ;
782
+ var trace = get_stack ( 'TracedAt' ) ;
787
783
788
- if ( trace ) {
789
- var traces = tracing_expressions . entries . get ( signal ) ;
784
+ if ( trace ) {
785
+ var traces = tracing_expressions . entries . get ( signal ) ;
790
786
791
- if ( traces === undefined ) {
792
- tracing_expressions . entries . set ( signal , ( traces = [ ] ) ) ;
793
- }
787
+ if ( traces === undefined ) {
788
+ tracing_expressions . entries . set ( signal , ( traces = [ ] ) ) ;
789
+ }
794
790
795
- var last = traces . at ( - 1 ) ;
791
+ var last = traces . at ( - 1 ) ;
796
792
797
- // traces can be duplicated, e.g. by `snapshot` invoking both
798
- // both `getOwnPropertyDescriptor` and `get` traps at once
799
- if ( trace . stack !== last ?. stack ) {
800
- traces . push ( trace ) ;
801
- }
793
+ // traces can be duplicated, e.g. by `snapshot` invoking both
794
+ // both `getOwnPropertyDescriptor` and `get` traps at once
795
+ if ( trace . stack !== last ?. stack ) {
796
+ traces . push ( trace ) ;
802
797
}
803
798
}
804
799
}
You can’t perform that action at this time.
0 commit comments