@@ -27,7 +27,7 @@ import {
27
27
QSlot ,
28
28
QSlotParent ,
29
29
QStyle ,
30
- QSubscribers ,
30
+ QBackRefs ,
31
31
QTemplate ,
32
32
Q_PREFIX ,
33
33
dangerouslySetInnerHTML ,
@@ -47,10 +47,8 @@ import type { HostElement, QElement, QwikLoaderEventScope, qWindow } from '../sh
47
47
import { DEBUG_TYPE , QContainerValue , VirtualType } from '../shared/types' ;
48
48
import type { DomContainer } from './dom-container' ;
49
49
import {
50
- ElementVNodeProps ,
51
50
VNodeFlags ,
52
51
VNodeProps ,
53
- VirtualVNodeProps ,
54
52
type ClientAttrKey ,
55
53
type ClientAttrs ,
56
54
type ClientContainer ,
@@ -70,7 +68,7 @@ import {
70
68
vnode_getParent ,
71
69
vnode_getProjectionParentComponent ,
72
70
vnode_getProp ,
73
- vnode_getPropStartIndex ,
71
+ vnode_getProps ,
74
72
vnode_getText ,
75
73
vnode_getType ,
76
74
vnode_insertBefore ,
@@ -93,15 +91,12 @@ import {
93
91
import { mapApp_findIndx } from './util-mapArray' ;
94
92
import { mapArray_set } from './util-mapArray' ;
95
93
import { getNewElementNamespaceData } from './vnode-namespace' ;
96
- import { WrappedSignal , EffectProperty , isSignal , EffectPropData } from '../signal/signal' ;
94
+ import { WrappedSignal , EffectProperty , isSignal , SubscriptionData } from '../signal/signal' ;
97
95
import type { Signal } from '../signal/signal.public' ;
98
96
import { executeComponent } from '../shared/component-execution' ;
99
97
import { isParentSlotProp , isSlotProp } from '../shared/utils/prop' ;
100
98
import { escapeHTML } from '../shared/utils/character-escaping' ;
101
- import {
102
- clearSubscriberEffectDependencies ,
103
- clearVNodeEffectDependencies ,
104
- } from '../signal/signal-subscriber' ;
99
+ import { clearAllEffects } from '../signal/signal-cleanup' ;
105
100
import { serializeAttribute } from '../shared/utils/styles' ;
106
101
import { QError , qError } from '../shared/error/error' ;
107
102
import { getFileLocationFromJsx } from '../shared/utils/jsx-filename' ;
@@ -196,7 +191,7 @@ export const vnode_diff = (
196
191
descend ( jsxValue , false ) ;
197
192
} else if ( isSignal ( jsxValue ) ) {
198
193
if ( vCurrent ) {
199
- clearVNodeEffectDependencies ( container , vCurrent ) ;
194
+ clearAllEffects ( container , vCurrent ) ;
200
195
}
201
196
expectVirtual ( VirtualType . WrappedSignal , null ) ;
202
197
descend (
@@ -412,9 +407,10 @@ export const vnode_diff = (
412
407
413
408
const projections : Array < string | JSXNodeInternal > = [ ] ;
414
409
if ( host ) {
410
+ const props = vnode_getProps ( host ) ;
415
411
// we need to create empty projections for all the slots to remove unused slots content
416
- for ( let i = vnode_getPropStartIndex ( host ) ; i < host . length ; i = i + 2 ) {
417
- const prop = host [ i ] as string ;
412
+ for ( let i = 0 ; i < props . length ; i = i + 2 ) {
413
+ const prop = props [ i ] as string ;
418
414
if ( isSlotProp ( prop ) ) {
419
415
const slotName = prop ;
420
416
projections . push ( slotName ) ;
@@ -653,7 +649,7 @@ export const vnode_diff = (
653
649
}
654
650
655
651
if ( isSignal ( value ) ) {
656
- const signalData = new EffectPropData ( {
652
+ const signalData = new SubscriptionData ( {
657
653
$scopedStyleIdPrefix$ : scopedStyleIdPrefix ,
658
654
$isConst$ : true ,
659
655
} ) ;
@@ -722,9 +718,7 @@ export const vnode_diff = (
722
718
723
719
function expectElement ( jsx : JSXNodeInternal , elementName : string ) {
724
720
const isSameElementName =
725
- vCurrent &&
726
- vnode_isElementVNode ( vCurrent ) &&
727
- elementName . toLowerCase ( ) === vnode_getElementName ( vCurrent ) ;
721
+ vCurrent && vnode_isElementVNode ( vCurrent ) && elementName === vnode_getElementName ( vCurrent ) ;
728
722
const jsxKey : string | null = jsx . key ;
729
723
let needsQDispatchEventPatch = false ;
730
724
const currentFile = getFileLocationFromJsx ( jsx . dev ) ;
@@ -801,10 +795,10 @@ export const vnode_diff = (
801
795
currentFile ?: string | null
802
796
) : boolean {
803
797
vnode_ensureElementInflated ( vnode ) ;
804
- const dstAttrs = vnode as ClientAttrs ;
798
+ const dstAttrs = vnode_getProps ( vnode ) as ClientAttrs ;
805
799
let srcIdx = 0 ;
806
800
const srcLength = srcAttrs . length ;
807
- let dstIdx = ElementVNodeProps . PROPS_OFFSET ;
801
+ let dstIdx = 0 ;
808
802
let dstLength = dstAttrs . length ;
809
803
let srcKey : ClientAttrKey | null = srcIdx < srcLength ? srcAttrs [ srcIdx ++ ] : null ;
810
804
let dstKey : ClientAttrKey | null = dstIdx < dstLength ? dstAttrs [ dstIdx ++ ] : null ;
@@ -832,7 +826,7 @@ export const vnode_diff = (
832
826
}
833
827
834
828
if ( isSignal ( value ) ) {
835
- const signalData = new EffectPropData ( {
829
+ const signalData = new SubscriptionData ( {
836
830
$scopedStyleIdPrefix$ : scopedStyleIdPrefix ,
837
831
$isConst$ : false ,
838
832
} ) ;
@@ -1136,7 +1130,7 @@ export const vnode_diff = (
1136
1130
jsxProps : Props
1137
1131
) {
1138
1132
if ( host ) {
1139
- clearVNodeEffectDependencies ( container , host ) ;
1133
+ clearAllEffects ( container , host ) ;
1140
1134
}
1141
1135
vnode_insertBefore (
1142
1136
journal ,
@@ -1253,8 +1247,8 @@ function propsDiffer(src: Record<string, any>, dst: Record<string, any>): boolea
1253
1247
if ( ! src || ! dst ) {
1254
1248
return true ;
1255
1249
}
1256
- let srcKeys = removePropsKeys ( Object . keys ( src ) , [ 'children' , QSubscribers ] ) ;
1257
- let dstKeys = removePropsKeys ( Object . keys ( dst ) , [ 'children' , QSubscribers ] ) ;
1250
+ let srcKeys = removePropsKeys ( Object . keys ( src ) , [ 'children' , QBackRefs ] ) ;
1251
+ let dstKeys = removePropsKeys ( Object . keys ( dst ) , [ 'children' , QBackRefs ] ) ;
1258
1252
if ( srcKeys . length !== dstKeys . length ) {
1259
1253
return true ;
1260
1254
}
@@ -1303,7 +1297,7 @@ export function cleanup(container: ClientContainer, vNode: VNode) {
1303
1297
do {
1304
1298
const type = vCursor [ VNodeProps . flags ] ;
1305
1299
if ( type & VNodeFlags . ELEMENT_OR_VIRTUAL_MASK ) {
1306
- clearVNodeEffectDependencies ( container , vCursor ) ;
1300
+ clearAllEffects ( container , vCursor ) ;
1307
1301
markVNodeAsDeleted ( vCursor ) ;
1308
1302
// Only elements and virtual nodes need to be traversed for children
1309
1303
if ( type & VNodeFlags . Virtual ) {
@@ -1313,7 +1307,7 @@ export function cleanup(container: ClientContainer, vNode: VNode) {
1313
1307
const obj = seq [ i ] ;
1314
1308
if ( isTask ( obj ) ) {
1315
1309
const task = obj ;
1316
- clearSubscriberEffectDependencies ( container , task ) ;
1310
+ clearAllEffects ( container , task ) ;
1317
1311
if ( task . $flags$ & TaskFlags . VISIBLE_TASK ) {
1318
1312
container . $scheduler$ ( ChoreType . CLEANUP_VISIBLE , task ) ;
1319
1313
} else {
@@ -1329,8 +1323,8 @@ export function cleanup(container: ClientContainer, vNode: VNode) {
1329
1323
vnode_getProp ( vCursor as VirtualVNode , OnRenderProp , null ) !== null ;
1330
1324
if ( isComponent ) {
1331
1325
// SPECIAL CASE: If we are a component, we need to descend into the projected content and release the content.
1332
- const attrs = vCursor ;
1333
- for ( let i = VirtualVNodeProps . PROPS_OFFSET ; i < attrs . length ; i = i + 2 ) {
1326
+ const attrs = vnode_getProps ( vCursor ) ;
1327
+ for ( let i = 0 ; i < attrs . length ; i = i + 2 ) {
1334
1328
const key = attrs [ i ] as string ;
1335
1329
if ( ! isParentSlotProp ( key ) && isSlotProp ( key ) ) {
1336
1330
const value = attrs [ i + 1 ] ;
0 commit comments