@qwik.dev/core 2.0.0-beta.14 → 2.0.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @qwik.dev/core/testing 2.0.0-beta.14-dev+1e7496d
3
+ * @qwik.dev/core/testing 2.0.0-beta.16-dev+a83ccf3
4
4
  * Copyright QwikDev. All Rights Reserved.
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
@@ -23640,7 +23640,7 @@ error: ${text}`);
23640
23640
  });
23641
23641
 
23642
23642
  // packages/qwik/src/testing/vdom-diff.unit-util.ts
23643
- import { Fragment as Fragment2, Slot as Slot2, _getDomContainer, isSignal as isSignal2 } from "../core.mjs";
23643
+ import { Fragment as Fragment2, Slot as Slot2, _getDomContainer, isSignal as isSignal2, untrack as untrack2 } from "../core.mjs";
23644
23644
  import { _isJSXNode, _isStringifiable } from "@qwik.dev/core/internal";
23645
23645
  import { expect } from "vitest";
23646
23646
 
@@ -24005,7 +24005,6 @@ var ELEMENT_PROPS = "q:props";
24005
24005
  var ELEMENT_SEQ = "q:seq";
24006
24006
  var ELEMENT_SEQ_IDX = "q:seqIdx";
24007
24007
  var ELEMENT_BACKPATCH_DATA = "qwik/backpatch";
24008
- var Q_PREFIX = "q:";
24009
24008
  var NON_SERIALIZABLE_MARKER_PREFIX = ":";
24010
24009
  var USE_ON_LOCAL = NON_SERIALIZABLE_MARKER_PREFIX + "on";
24011
24010
  var USE_ON_LOCAL_SEQ_IDX = NON_SERIALIZABLE_MARKER_PREFIX + "onIdx";
@@ -24045,6 +24044,7 @@ var STORE_ALL_PROPS = Symbol("store.all");
24045
24044
  var _CONST_PROPS = Symbol("CONST");
24046
24045
  var _VAR_PROPS = Symbol("VAR");
24047
24046
  var _OWNER = Symbol("OWNER");
24047
+ var _PROPS_HANDLER = Symbol("PROPS_HANDLER");
24048
24048
  var _IMMUTABLE = Symbol("IMMUTABLE");
24049
24049
  var _UNINITIALIZED = Symbol("UNINITIALIZED");
24050
24050
 
@@ -24109,6 +24109,13 @@ var getEventDataFromHtmlAttribute = (htmlKey) => {
24109
24109
  }
24110
24110
  return ["document", htmlKey.substring(12)];
24111
24111
  };
24112
+ var getScopedEventName = (scope, eventName) => {
24113
+ const suffix = ":" + eventName;
24114
+ return scope ? scope + suffix : suffix;
24115
+ };
24116
+ var getLoaderScopedEventName = (scope, scopedEvent) => {
24117
+ return scope ? "-" + scopedEvent : scopedEvent;
24118
+ };
24112
24119
 
24113
24120
  // packages/qwik/src/core/shared/utils/flyweight.ts
24114
24121
  var EMPTY_ARRAY = [];
@@ -24123,16 +24130,18 @@ function createPropsProxy(owner) {
24123
24130
  var PropsProxyHandler = class {
24124
24131
  constructor(owner) {
24125
24132
  this.owner = owner;
24133
+ __publicField(this, "$effects$");
24134
+ __publicField(this, "$container$", null);
24126
24135
  }
24127
24136
  get(_, prop) {
24128
24137
  if (prop === _CONST_PROPS) {
24129
24138
  return this.owner.constProps;
24130
- }
24131
- if (prop === _VAR_PROPS) {
24139
+ } else if (prop === _VAR_PROPS) {
24132
24140
  return this.owner.varProps;
24133
- }
24134
- if (prop === _OWNER) {
24141
+ } else if (prop === _OWNER) {
24135
24142
  return this.owner;
24143
+ } else if (prop === _PROPS_HANDLER) {
24144
+ return this;
24136
24145
  }
24137
24146
  let value;
24138
24147
  if (prop === "children") {
@@ -24145,6 +24154,9 @@ var PropsProxyHandler = class {
24145
24154
  }
24146
24155
  }
24147
24156
  value = directGetPropsProxyProp(this.owner, prop);
24157
+ if (prop in this.owner.varProps) {
24158
+ addPropsProxyEffect(this, prop);
24159
+ }
24148
24160
  }
24149
24161
  return value instanceof WrappedSignalImpl && value.$flags$ & 4 /* UNWRAP */ ? value.value : value;
24150
24162
  }
@@ -24153,6 +24165,10 @@ var PropsProxyHandler = class {
24153
24165
  this.owner = value;
24154
24166
  } else if (prop === "children") {
24155
24167
  this.owner.children = value;
24168
+ } else if (prop === _CONST_PROPS) {
24169
+ this.owner.constProps = value;
24170
+ } else if (prop === _VAR_PROPS) {
24171
+ this.owner.varProps = value;
24156
24172
  } else {
24157
24173
  if (typeof prop === "string" && typeof this.owner.type === "string") {
24158
24174
  const attr = jsxEventToHtmlAttribute(prop);
@@ -24168,12 +24184,18 @@ var PropsProxyHandler = class {
24168
24184
  } else if (!(prop in this.owner.varProps)) {
24169
24185
  this.owner.toSort = true;
24170
24186
  }
24171
- this.owner.varProps[prop] = value;
24187
+ if (this.owner.varProps[prop] !== value) {
24188
+ this.owner.varProps[prop] = value;
24189
+ triggerPropsProxyEffect(this, prop);
24190
+ }
24172
24191
  }
24173
24192
  return true;
24174
24193
  }
24175
24194
  deleteProperty(_, prop) {
24176
24195
  let didDelete = delete this.owner.varProps[prop];
24196
+ if (didDelete) {
24197
+ triggerPropsProxyEffect(this, prop);
24198
+ }
24177
24199
  if (this.owner.constProps) {
24178
24200
  didDelete = delete this.owner.constProps[prop] || didDelete;
24179
24201
  }
@@ -24189,13 +24211,19 @@ var PropsProxyHandler = class {
24189
24211
  } else if (prop === _CONST_PROPS || prop === _VAR_PROPS) {
24190
24212
  return true;
24191
24213
  }
24192
- if (typeof prop === "string" && typeof this.owner.type === "string") {
24193
- const attr = jsxEventToHtmlAttribute(prop);
24194
- if (attr) {
24195
- prop = attr;
24214
+ const inVarProps = prop in this.owner.varProps;
24215
+ if (typeof prop === "string") {
24216
+ if (inVarProps) {
24217
+ addPropsProxyEffect(this, prop);
24218
+ }
24219
+ if (typeof this.owner.type === "string") {
24220
+ const attr = jsxEventToHtmlAttribute(prop);
24221
+ if (attr) {
24222
+ prop = attr;
24223
+ }
24196
24224
  }
24197
24225
  }
24198
- return prop in this.owner.varProps || (this.owner.constProps ? prop in this.owner.constProps : false);
24226
+ return inVarProps || (this.owner.constProps ? prop in this.owner.constProps : false);
24199
24227
  }
24200
24228
  getOwnPropertyDescriptor(_, p) {
24201
24229
  const value = p === "children" ? this.owner.children : this.owner.constProps && p in this.owner.constProps ? this.owner.constProps[p] : this.owner.varProps[p];
@@ -24220,6 +24248,39 @@ var PropsProxyHandler = class {
24220
24248
  return out;
24221
24249
  }
24222
24250
  };
24251
+ var addPropsProxyEffect = (propsProxy, prop) => {
24252
+ const ctx = tryGetInvokeContext();
24253
+ if (ctx) {
24254
+ if (propsProxy.$container$ === null) {
24255
+ if (ctx.$container$) {
24256
+ propsProxy.$container$ = ctx.$container$;
24257
+ }
24258
+ } else {
24259
+ assertTrue(
24260
+ !ctx.$container$ || ctx.$container$ === propsProxy.$container$,
24261
+ "Do not use props across containers"
24262
+ );
24263
+ }
24264
+ }
24265
+ const effectSubscriber = ctx?.$effectSubscriber$;
24266
+ if (effectSubscriber) {
24267
+ addStoreEffect(propsProxy.owner._proxy, prop, propsProxy, effectSubscriber);
24268
+ }
24269
+ };
24270
+ var triggerPropsProxyEffect = (propsProxy, prop) => {
24271
+ const effects = getEffects(propsProxy.$effects$, prop);
24272
+ if (effects) {
24273
+ propsProxy.$container$?.$scheduler$(
24274
+ 7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
24275
+ void 0,
24276
+ propsProxy,
24277
+ effects
24278
+ );
24279
+ }
24280
+ };
24281
+ function getEffects(effects, prop) {
24282
+ return effects?.get(prop);
24283
+ }
24223
24284
  var directGetPropsProxyProp = (jsx2, prop) => {
24224
24285
  return jsx2.constProps && prop in jsx2.constProps ? jsx2.constProps[prop] : jsx2.varProps[prop];
24225
24286
  };
@@ -24322,7 +24383,7 @@ var SignalImpl = class {
24322
24383
  constructor(container, value) {
24323
24384
  __publicField(this, "$untrackedValue$");
24324
24385
  /** Store a list of effects which are dependent on this signal. */
24325
- __publicField(this, "$effects$", null);
24386
+ __publicField(this, "$effects$");
24326
24387
  __publicField(this, "$container$", null);
24327
24388
  __publicField(this, "$wrappedSignal$", null);
24328
24389
  this.$container$ = container;
@@ -24336,7 +24397,7 @@ var SignalImpl = class {
24336
24397
  force() {
24337
24398
  this.$container$?.$scheduler$(
24338
24399
  7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
24339
- null,
24400
+ void 0,
24340
24401
  this,
24341
24402
  this.$effects$
24342
24403
  );
@@ -24361,7 +24422,7 @@ var SignalImpl = class {
24361
24422
  this.$untrackedValue$ = value;
24362
24423
  this.$container$?.$scheduler$(
24363
24424
  7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
24364
- null,
24425
+ void 0,
24365
24426
  this,
24366
24427
  this.$effects$
24367
24428
  );
@@ -24427,7 +24488,7 @@ var ComputedSignalImpl = class extends (_b = SignalImpl, _a = _EFFECT_BACK_REF,
24427
24488
  */
24428
24489
  __publicField(this, "$computeQrl$");
24429
24490
  __publicField(this, "$flags$");
24430
- __publicField(this, _a, null);
24491
+ __publicField(this, _a);
24431
24492
  this.$computeQrl$ = fn;
24432
24493
  this.$flags$ = flags;
24433
24494
  }
@@ -24435,7 +24496,7 @@ var ComputedSignalImpl = class extends (_b = SignalImpl, _a = _EFFECT_BACK_REF,
24435
24496
  this.$flags$ |= 1 /* INVALID */;
24436
24497
  this.$container$?.$scheduler$(
24437
24498
  7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
24438
- null,
24499
+ void 0,
24439
24500
  this,
24440
24501
  this.$effects$
24441
24502
  );
@@ -24506,13 +24567,13 @@ var AsyncComputedSignalImpl = class extends (_b2 = ComputedSignalImpl, _a2 = _EF
24506
24567
  constructor(container, fn, flags = 1 /* INVALID */) {
24507
24568
  super(container, fn, flags);
24508
24569
  __publicField(this, "$untrackedLoading$", false);
24509
- __publicField(this, "$untrackedError$", null);
24510
- __publicField(this, "$loadingEffects$", null);
24511
- __publicField(this, "$errorEffects$", null);
24570
+ __publicField(this, "$untrackedError$");
24571
+ __publicField(this, "$loadingEffects$");
24572
+ __publicField(this, "$errorEffects$");
24512
24573
  __publicField(this, "$destroy$");
24513
24574
  __publicField(this, "$promiseValue$", NEEDS_COMPUTATION);
24514
24575
  __publicField(this, "$promise$", null);
24515
- __publicField(this, _a2, null);
24576
+ __publicField(this, _a2);
24516
24577
  }
24517
24578
  /**
24518
24579
  * Loading is true if the signal is still waiting for the promise to resolve, false if the promise
@@ -24530,7 +24591,7 @@ var AsyncComputedSignalImpl = class extends (_b2 = ComputedSignalImpl, _a2 = _EF
24530
24591
  this.$untrackedLoading$ = value;
24531
24592
  this.$container$?.$scheduler$(
24532
24593
  7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
24533
- null,
24594
+ void 0,
24534
24595
  this,
24535
24596
  this.$loadingEffects$
24536
24597
  );
@@ -24552,7 +24613,7 @@ var AsyncComputedSignalImpl = class extends (_b2 = ComputedSignalImpl, _a2 = _EF
24552
24613
  this.$untrackedError$ = value;
24553
24614
  this.$container$?.$scheduler$(
24554
24615
  7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
24555
- null,
24616
+ void 0,
24556
24617
  this,
24557
24618
  this.$errorEffects$
24558
24619
  );
@@ -24582,7 +24643,7 @@ var AsyncComputedSignalImpl = class extends (_b2 = ComputedSignalImpl, _a2 = _EF
24582
24643
  if (isPromise(untrackedValue)) {
24583
24644
  const isFirstComputation = this.$promiseValue$ === NEEDS_COMPUTATION;
24584
24645
  this.untrackedLoading = true;
24585
- this.untrackedError = null;
24646
+ this.untrackedError = void 0;
24586
24647
  if (this.$promiseValue$ !== NEEDS_COMPUTATION) {
24587
24648
  cleanupDestroyable(this);
24588
24649
  }
@@ -24590,7 +24651,7 @@ var AsyncComputedSignalImpl = class extends (_b2 = ComputedSignalImpl, _a2 = _EF
24590
24651
  DEBUG3 && log3("Promise resolved", promiseValue);
24591
24652
  this.$promiseValue$ = promiseValue;
24592
24653
  this.untrackedLoading = false;
24593
- this.untrackedError = null;
24654
+ this.untrackedError = void 0;
24594
24655
  if (this.setValue(promiseValue)) {
24595
24656
  DEBUG3 && log3("Scheduling effects for subscribers", this.$effects$?.size);
24596
24657
  scheduleEffects(this.$container$, this, this.$effects$);
@@ -24989,8 +25050,8 @@ var WrappedSignalImpl = class extends (_b3 = SignalImpl, _a3 = _EFFECT_BACK_REF,
24989
25050
  __publicField(this, "$func$");
24990
25051
  __publicField(this, "$funcStr$");
24991
25052
  __publicField(this, "$flags$");
24992
- __publicField(this, "$hostElement$", null);
24993
- __publicField(this, _a3, null);
25053
+ __publicField(this, "$hostElement$");
25054
+ __publicField(this, _a3);
24994
25055
  this.$args$ = args;
24995
25056
  this.$func$ = fn;
24996
25057
  this.$funcStr$ = fnStr;
@@ -25205,7 +25266,7 @@ var StoreHandler = class {
25205
25266
  constructor($flags$, $container$) {
25206
25267
  this.$flags$ = $flags$;
25207
25268
  this.$container$ = $container$;
25208
- __publicField(this, "$effects$", null);
25269
+ __publicField(this, "$effects$");
25209
25270
  }
25210
25271
  toString() {
25211
25272
  return "[Store]";
@@ -25214,9 +25275,9 @@ var StoreHandler = class {
25214
25275
  const target = getStoreTarget(this);
25215
25276
  this.$container$?.$scheduler$(
25216
25277
  7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
25217
- null,
25278
+ void 0,
25218
25279
  this,
25219
- getEffects(target, prop, this.$effects$)
25280
+ getEffects2(target, prop, this.$effects$)
25220
25281
  );
25221
25282
  }
25222
25283
  get(target, prop) {
@@ -25288,9 +25349,9 @@ var StoreHandler = class {
25288
25349
  if (!Array.isArray(target)) {
25289
25350
  this.$container$?.$scheduler$(
25290
25351
  7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
25291
- null,
25352
+ void 0,
25292
25353
  this,
25293
- getEffects(target, prop, this.$effects$)
25354
+ getEffects2(target, prop, this.$effects$)
25294
25355
  );
25295
25356
  }
25296
25357
  return true;
@@ -25351,17 +25412,17 @@ function addStoreEffect(target, prop, store, effectSubscription) {
25351
25412
  }
25352
25413
  function setNewValueAndTriggerEffects(prop, value, target, currentStore) {
25353
25414
  target[prop] = value;
25354
- const effects = getEffects(target, prop, currentStore.$effects$);
25415
+ const effects = getEffects2(target, prop, currentStore.$effects$);
25355
25416
  if (effects) {
25356
25417
  currentStore.$container$?.$scheduler$(
25357
25418
  7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */,
25358
- null,
25419
+ void 0,
25359
25420
  currentStore,
25360
25421
  effects
25361
25422
  );
25362
25423
  }
25363
25424
  }
25364
- function getEffects(target, prop, storeEffects) {
25425
+ function getEffects2(target, prop, storeEffects) {
25365
25426
  let effectsToTrigger;
25366
25427
  if (storeEffects) {
25367
25428
  if (Array.isArray(target)) {
@@ -25382,7 +25443,7 @@ function getEffects(target, prop, storeEffects) {
25382
25443
  effectsToTrigger.add(effect);
25383
25444
  }
25384
25445
  }
25385
- return effectsToTrigger || null;
25446
+ return effectsToTrigger;
25386
25447
  }
25387
25448
 
25388
25449
  // packages/qwik/src/core/reactive-primitives/subscription-data.ts
@@ -25398,7 +25459,7 @@ var _a4;
25398
25459
  _a4 = _EFFECT_BACK_REF;
25399
25460
  var BackRef = class {
25400
25461
  constructor() {
25401
- __publicField(this, _a4, null);
25462
+ __publicField(this, _a4);
25402
25463
  }
25403
25464
  };
25404
25465
  function clearAllEffects(container, consumer) {
@@ -25412,6 +25473,7 @@ function clearAllEffects(container, consumer) {
25412
25473
  for (const [, effect] of effects) {
25413
25474
  clearEffectSubscription(container, effect);
25414
25475
  }
25476
+ effects.clear();
25415
25477
  }
25416
25478
  function clearEffectSubscription(container, effect) {
25417
25479
  const backRefs = effect[2 /* BACK_REF */];
@@ -25423,12 +25485,16 @@ function clearEffectSubscription(container, effect) {
25423
25485
  clearSignal(container, producer, effect);
25424
25486
  } else if (producer instanceof AsyncComputedSignalImpl) {
25425
25487
  clearAsyncComputedSignal(producer, effect);
25488
+ } else if (isPropsProxy(producer)) {
25489
+ const propsHandler = producer[_PROPS_HANDLER];
25490
+ clearStoreOrProps(propsHandler, effect);
25426
25491
  } else if (container.$storeProxyMap$.has(producer)) {
25427
25492
  const target = container.$storeProxyMap$.get(producer);
25428
25493
  const storeHandler = getStoreHandler(target);
25429
- clearStore(storeHandler, effect);
25494
+ clearStoreOrProps(storeHandler, effect);
25430
25495
  }
25431
25496
  }
25497
+ backRefs.clear();
25432
25498
  }
25433
25499
  function clearSignal(container, producer, effect) {
25434
25500
  const effects = producer.$effects$;
@@ -25436,7 +25502,7 @@ function clearSignal(container, producer, effect) {
25436
25502
  effects.delete(effect);
25437
25503
  }
25438
25504
  if (producer instanceof WrappedSignalImpl) {
25439
- producer.$hostElement$ = null;
25505
+ producer.$hostElement$ = void 0;
25440
25506
  clearAllEffects(container, producer);
25441
25507
  }
25442
25508
  }
@@ -25450,14 +25516,14 @@ function clearAsyncComputedSignal(producer, effect) {
25450
25516
  pendingEffects.delete(effect);
25451
25517
  }
25452
25518
  }
25453
- function clearStore(producer, effect) {
25519
+ function clearStoreOrProps(producer, effect) {
25454
25520
  const effects = producer?.$effects$;
25455
25521
  if (effects) {
25456
- for (const [propKey, propEffects] of effects.entries()) {
25522
+ for (const [prop, propEffects] of effects.entries()) {
25457
25523
  if (propEffects.has(effect)) {
25458
25524
  propEffects.delete(effect);
25459
25525
  if (propEffects.size === 0) {
25460
- effects.delete(propKey);
25526
+ effects.delete(prop);
25461
25527
  }
25462
25528
  }
25463
25529
  }
@@ -25717,12 +25783,12 @@ var _jsxSplit = (type, varProps, constProps, children, flags, key, dev) => {
25717
25783
  for (const k in varProps) {
25718
25784
  if (k === "children") {
25719
25785
  children || (children = varProps.children);
25720
- varProps.children = void 0;
25786
+ delete varProps.children;
25721
25787
  } else if (k === "key") {
25722
25788
  key || (key = varProps.key);
25723
- varProps.key = void 0;
25789
+ delete varProps.key;
25724
25790
  } else if (constProps && k in constProps) {
25725
- varProps[k] = void 0;
25791
+ delete varProps[k];
25726
25792
  }
25727
25793
  }
25728
25794
  }
@@ -26445,8 +26511,8 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
26445
26511
  } else if (isSignal(jsxValue)) {
26446
26512
  expectVirtual("S" /* WrappedSignal */, null);
26447
26513
  const unwrappedSignal = jsxValue instanceof WrappedSignalImpl ? jsxValue.$unwrapIfSignal$() : jsxValue;
26448
- const currentSignal = vCurrent?.[_EFFECT_BACK_REF]?.get("." /* VNODE */)?.[0 /* CONSUMER */];
26449
- if (currentSignal !== unwrappedSignal) {
26514
+ const hasUnwrappedSignal = vCurrent?.[_EFFECT_BACK_REF]?.get("." /* VNODE */)?.[2 /* BACK_REF */]?.has(unwrappedSignal);
26515
+ if (!hasUnwrappedSignal) {
26450
26516
  const vHost = vNewNode || vCurrent;
26451
26517
  descend(
26452
26518
  resolveSignalAndDescend(
@@ -26802,14 +26868,15 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
26802
26868
  if (isHtmlAttributeAnEventName(key2)) {
26803
26869
  const data = getEventDataFromHtmlAttribute(key2);
26804
26870
  if (data) {
26805
- const scope = data[0];
26806
- const eventName = data[1];
26871
+ const [scope, eventName] = data;
26872
+ const scopedEvent = getScopedEventName(scope, eventName);
26873
+ const loaderScopedEvent = getLoaderScopedEventName(scope, scopedEvent);
26807
26874
  if (eventName) {
26808
- vNewNode.setProp(HANDLER_PREFIX + ":" + scope + ":" + eventName, value);
26875
+ vNewNode.setProp(HANDLER_PREFIX + ":" + scopedEvent, value);
26809
26876
  if (scope) {
26810
26877
  vNewNode.setAttr(key2, "", journal);
26811
26878
  }
26812
- registerQwikLoaderEvent(eventName);
26879
+ registerQwikLoaderEvent(loaderScopedEvent);
26813
26880
  }
26814
26881
  }
26815
26882
  needsQDispatchEventPatch = true;
@@ -26962,14 +27029,24 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
26962
27029
  let srcIdx = 0;
26963
27030
  let dstIdx = 0;
26964
27031
  let patchEventDispatch = false;
26965
- const setAttribute = (key, value, vHost) => {
26966
- vHost.setAttr(
26967
- key,
26968
- value !== null ? serializeAttribute(key, value, scopedStyleIdPrefix) : null,
26969
- journal
26970
- );
27032
+ const setAttributeDirect = (vnode2, key, value, dstIdx2, isNewKey) => {
27033
+ const serializedValue = value != null ? serializeAttribute(key, value, scopedStyleIdPrefix) : null;
27034
+ if (isNewKey) {
27035
+ if (serializedValue != null) {
27036
+ dstAttrs.splice(dstIdx2, 0, key, serializedValue);
27037
+ journal.push(2 /* SetAttribute */, vnode2.element, key, serializedValue);
27038
+ }
27039
+ } else {
27040
+ if (serializedValue != null) {
27041
+ dstAttrs[dstIdx2 + 1] = serializedValue;
27042
+ journal.push(2 /* SetAttribute */, vnode2.element, key, serializedValue);
27043
+ } else {
27044
+ dstAttrs.splice(dstIdx2, 2);
27045
+ journal.push(2 /* SetAttribute */, vnode2.element, key, null);
27046
+ }
27047
+ }
26971
27048
  };
26972
- const record = (key, value) => {
27049
+ const record = (key, value, dstIdx2, isNewKey) => {
26973
27050
  if (key.startsWith(":")) {
26974
27051
  vnode.setProp(key, value);
26975
27052
  return;
@@ -27013,27 +27090,32 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
27013
27090
  }
27014
27091
  if (isPromise(value)) {
27015
27092
  const vHost = vnode;
27016
- const attributePromise = value.then(
27017
- (resolvedValue) => setAttribute(key, resolvedValue, vHost)
27018
- );
27093
+ const attributePromise = value.then((resolvedValue) => {
27094
+ const idx = mapApp_findIndx(dstAttrs, key, 0);
27095
+ const isNewKey2 = idx < 0;
27096
+ const currentDstIdx = isNewKey2 ? idx ^ -1 : idx;
27097
+ setAttributeDirect(vHost, key, resolvedValue, currentDstIdx, isNewKey2);
27098
+ });
27019
27099
  asyncAttributePromises.push(attributePromise);
27020
27100
  return;
27021
27101
  }
27022
- setAttribute(key, value, vnode);
27102
+ setAttributeDirect(vnode, key, value, dstIdx2, isNewKey);
27023
27103
  };
27024
27104
  const recordJsxEvent = (key, value) => {
27025
27105
  const data = getEventDataFromHtmlAttribute(key);
27026
27106
  if (data) {
27027
27107
  const [scope, eventName] = data;
27028
- record(":" + scope + ":" + eventName, value);
27029
- registerQwikLoaderEvent(eventName);
27108
+ const scopedEvent = getScopedEventName(scope, eventName);
27109
+ const loaderScopedEvent = getLoaderScopedEventName(scope, scopedEvent);
27110
+ record(":" + scopedEvent, value, 0, false);
27111
+ registerQwikLoaderEvent(loaderScopedEvent);
27030
27112
  patchEventDispatch = true;
27031
27113
  }
27032
27114
  };
27033
27115
  while (srcIdx < srcAttrs.length || dstIdx < dstAttrs.length) {
27034
27116
  const srcKey = srcIdx < srcAttrs.length ? srcAttrs[srcIdx] : void 0;
27035
27117
  const dstKey = dstIdx < dstAttrs.length ? dstAttrs[dstIdx] : void 0;
27036
- if (dstKey?.startsWith(HANDLER_PREFIX) || dstKey?.startsWith(Q_PREFIX)) {
27118
+ if (dstKey?.startsWith(HANDLER_PREFIX)) {
27037
27119
  dstIdx += 2;
27038
27120
  continue;
27039
27121
  }
@@ -27041,14 +27123,14 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
27041
27123
  if (isHtmlAttributeAnEventName(dstKey)) {
27042
27124
  dstIdx += 2;
27043
27125
  } else {
27044
- record(dstKey, null);
27126
+ record(dstKey, null, dstIdx, false);
27045
27127
  }
27046
27128
  } else if (dstKey === void 0) {
27047
27129
  const srcValue = srcAttrs[srcIdx + 1];
27048
27130
  if (isHtmlAttributeAnEventName(srcKey)) {
27049
27131
  recordJsxEvent(srcKey, srcValue);
27050
27132
  } else {
27051
- record(srcKey, srcValue);
27133
+ record(srcKey, srcValue, dstIdx, true);
27052
27134
  }
27053
27135
  srcIdx += 2;
27054
27136
  dstIdx += 2;
@@ -27060,7 +27142,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
27060
27142
  if (isEventHandler) {
27061
27143
  recordJsxEvent(srcKey, srcValue);
27062
27144
  } else {
27063
- record(srcKey, srcValue);
27145
+ record(srcKey, srcValue, dstIdx, false);
27064
27146
  }
27065
27147
  } else if (isEventHandler && !vnode.element.qDispatchEvent) {
27066
27148
  recordJsxEvent(srcKey, srcValue);
@@ -27072,7 +27154,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
27072
27154
  if (isHtmlAttributeAnEventName(srcKey)) {
27073
27155
  recordJsxEvent(srcKey, srcValue);
27074
27156
  } else {
27075
- record(srcKey, srcValue);
27157
+ record(srcKey, srcValue, dstIdx, true);
27076
27158
  }
27077
27159
  srcIdx += 2;
27078
27160
  dstIdx += 2;
@@ -27080,7 +27162,7 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
27080
27162
  if (isHtmlAttributeAnEventName(dstKey)) {
27081
27163
  dstIdx += 2;
27082
27164
  } else {
27083
- record(dstKey, null);
27165
+ record(dstKey, null, dstIdx, false);
27084
27166
  }
27085
27167
  }
27086
27168
  }
@@ -27264,32 +27346,14 @@ var vnode_diff = (container, jsxNode, vStartNode, scopedStyleIdPrefix) => {
27264
27346
  deleteFromSideBuffer(null, lookupKey);
27265
27347
  }
27266
27348
  if (host) {
27267
- let vNodeProps = host.getProp(
27349
+ const vNodeProps = host.getProp(
27268
27350
  ELEMENT_PROPS,
27269
27351
  container.$getObjectById$
27270
27352
  );
27271
- let propsAreDifferent = false;
27272
27353
  if (!shouldRender) {
27273
- propsAreDifferent = propsDiffer(
27274
- jsxProps[_CONST_PROPS],
27275
- vNodeProps?.[_CONST_PROPS]
27276
- ) || propsDiffer(
27277
- jsxProps[_VAR_PROPS],
27278
- vNodeProps?.[_VAR_PROPS]
27279
- );
27280
- shouldRender = shouldRender || propsAreDifferent;
27354
+ shouldRender || (shouldRender = handleProps(host, jsxProps, vNodeProps, container));
27281
27355
  }
27282
27356
  if (shouldRender) {
27283
- if (propsAreDifferent) {
27284
- if (vNodeProps) {
27285
- vNodeProps[_CONST_PROPS] = jsxProps[_CONST_PROPS];
27286
- vNodeProps[_VAR_PROPS] = jsxProps[_VAR_PROPS];
27287
- vNodeProps[_OWNER] = jsxProps[_OWNER];
27288
- } else if (jsxProps) {
27289
- host.setProp(ELEMENT_PROPS, jsxProps);
27290
- vNodeProps = jsxProps;
27291
- }
27292
- }
27293
27357
  host.setProp(OnRenderProp, componentQRL);
27294
27358
  host.flags &= ~32 /* Deleted */;
27295
27359
  container.$scheduler$(6 /* COMPONENT */, host, componentQRL, vNodeProps);
@@ -27397,7 +27461,41 @@ function getComponentHash(vNode, getObject) {
27397
27461
  }
27398
27462
  function Projection() {
27399
27463
  }
27400
- function propsDiffer(src, dst) {
27464
+ function handleProps(host, jsxProps, vNodeProps, container) {
27465
+ let shouldRender = false;
27466
+ let propsAreDifferent = false;
27467
+ if (vNodeProps) {
27468
+ const effects = vNodeProps[_PROPS_HANDLER].$effects$;
27469
+ const constPropsDifferent = handleChangedProps(
27470
+ jsxProps[_CONST_PROPS],
27471
+ vNodeProps[_CONST_PROPS],
27472
+ vNodeProps[_PROPS_HANDLER],
27473
+ container,
27474
+ false
27475
+ );
27476
+ propsAreDifferent = constPropsDifferent;
27477
+ shouldRender || (shouldRender = constPropsDifferent);
27478
+ if (effects && effects.size > 0) {
27479
+ const varPropsDifferent = handleChangedProps(
27480
+ jsxProps[_VAR_PROPS],
27481
+ vNodeProps[_VAR_PROPS],
27482
+ vNodeProps[_PROPS_HANDLER],
27483
+ container
27484
+ );
27485
+ propsAreDifferent || (propsAreDifferent = varPropsDifferent);
27486
+ }
27487
+ }
27488
+ if (propsAreDifferent) {
27489
+ if (vNodeProps) {
27490
+ vNodeProps[_OWNER] = jsxProps[_OWNER];
27491
+ } else if (jsxProps) {
27492
+ host.setProp(ELEMENT_PROPS, jsxProps);
27493
+ vNodeProps = jsxProps;
27494
+ }
27495
+ }
27496
+ return shouldRender;
27497
+ }
27498
+ function handleChangedProps(src, dst, propsHandler, container, triggerEffects = true) {
27401
27499
  const srcEmpty = isPropsEmpty(src);
27402
27500
  const dstEmpty = isPropsEmpty(dst);
27403
27501
  if (srcEmpty && dstEmpty) {
@@ -27425,15 +27523,22 @@ function propsDiffer(src, dst) {
27425
27523
  if (srcLen !== dstLen) {
27426
27524
  return true;
27427
27525
  }
27526
+ let changed = false;
27527
+ propsHandler.$container$ = container;
27428
27528
  for (const key of srcKeys) {
27429
27529
  if (key === "children" || key === QBackRefs) {
27430
27530
  continue;
27431
27531
  }
27432
27532
  if (!Object.prototype.hasOwnProperty.call(dst, key) || src[key] !== dst[key]) {
27433
- return true;
27533
+ changed = true;
27534
+ if (triggerEffects) {
27535
+ triggerPropsProxyEffect(propsHandler, key);
27536
+ } else {
27537
+ return true;
27538
+ }
27434
27539
  }
27435
27540
  }
27436
- return false;
27541
+ return changed;
27437
27542
  }
27438
27543
  function isPropsEmpty(props) {
27439
27544
  if (!props) {
@@ -27774,7 +27879,7 @@ function findAncestorBlockingChore(chore, type) {
27774
27879
  const blockingChores = isNormalQueue ? current.chores : current.blockedChores;
27775
27880
  if (blockingChores) {
27776
27881
  for (const blockingChore of blockingChores) {
27777
- if (blockingChore.$type$ < 16 /* VISIBLE */ && blockingChore.$type$ !== 3 /* TASK */ && blockingChore.$type$ !== 1 /* QRL_RESOLVE */ && blockingChore.$type$ !== 2 /* RUN_QRL */) {
27882
+ if (blockingChore.$type$ < 16 /* VISIBLE */ && blockingChore.$type$ !== 3 /* TASK */ && blockingChore.$type$ !== 1 /* QRL_RESOLVE */ && blockingChore.$type$ !== 2 /* RUN_QRL */ && blockingChore.$state$ === 0 /* NONE */) {
27778
27883
  return blockingChore;
27779
27884
  }
27780
27885
  }
@@ -27800,17 +27905,17 @@ function findBlockingChore(chore, choreQueue, blockedChores, runningChores, cont
27800
27905
  continue;
27801
27906
  }
27802
27907
  for (const candidate of choreQueue) {
27803
- if (candidate.$type$ === rule.blockingType && rule.match(chore, candidate, container)) {
27908
+ if (candidate.$type$ === rule.blockingType && rule.match(chore, candidate, container) && candidate.$state$ === 0 /* NONE */) {
27804
27909
  return candidate;
27805
27910
  }
27806
27911
  }
27807
27912
  for (const candidate of blockedChores) {
27808
- if (candidate.$type$ === rule.blockingType && rule.match(chore, candidate, container)) {
27913
+ if (candidate.$type$ === rule.blockingType && rule.match(chore, candidate, container) && candidate.$state$ === 0 /* NONE */) {
27809
27914
  return candidate;
27810
27915
  }
27811
27916
  }
27812
27917
  for (const candidate of runningChores) {
27813
- if (candidate.$type$ === rule.blockingType && rule.match(chore, candidate, container)) {
27918
+ if (candidate.$type$ === rule.blockingType && rule.match(chore, candidate, container) && candidate.$state$ !== 2 /* FAILED */) {
27814
27919
  return candidate;
27815
27920
  }
27816
27921
  }
@@ -27836,7 +27941,7 @@ function findBlockingChoreForVisible(chore, runningChores, container) {
27836
27941
  continue;
27837
27942
  }
27838
27943
  for (const candidate of runningChores) {
27839
- if (candidate.$type$ === rule.blockingType && rule.match(chore, candidate, container)) {
27944
+ if (candidate.$type$ === rule.blockingType && rule.match(chore, candidate, container) && candidate.$state$ !== 2 /* FAILED */) {
27840
27945
  return candidate;
27841
27946
  }
27842
27947
  }
@@ -28017,7 +28122,7 @@ function choreComparator(a, b) {
28017
28122
  }
28018
28123
  return 1;
28019
28124
  }
28020
- if (a.$type$ === 7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */ && b.$type$ === 7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */ && (a.$target$ instanceof StoreHandler && b.$target$ instanceof StoreHandler || a.$target$ instanceof AsyncComputedSignalImpl && b.$target$ instanceof AsyncComputedSignalImpl) && a.$payload$ !== b.$payload$) {
28125
+ if (a.$type$ === 7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */ && b.$type$ === 7 /* RECOMPUTE_AND_SCHEDULE_EFFECTS */ && (a.$target$ instanceof StoreHandler && b.$target$ instanceof StoreHandler || a.$target$ instanceof PropsProxyHandler && b.$target$ instanceof PropsProxyHandler || a.$target$ instanceof AsyncComputedSignalImpl && b.$target$ instanceof AsyncComputedSignalImpl) && a.$payload$ !== b.$payload$) {
28021
28126
  return 1;
28022
28127
  }
28023
28128
  return 0;
@@ -28129,6 +28234,13 @@ This is often caused by modifying a signal in an already rendered component duri
28129
28234
  }
28130
28235
  const shouldBlock = chore.$type$ !== 1 /* QRL_RESOLVE */ && chore.$type$ !== 2 /* RUN_QRL */;
28131
28236
  if (shouldBlock) {
28237
+ const runningChore = getRunningChore(chore);
28238
+ if (runningChore) {
28239
+ if (isResourceChore(runningChore)) {
28240
+ addBlockedChore(chore, runningChore, blockedChores);
28241
+ }
28242
+ return chore;
28243
+ }
28132
28244
  const blockingChore = findBlockingChore(
28133
28245
  chore,
28134
28246
  choreQueue,
@@ -28140,11 +28252,6 @@ This is often caused by modifying a signal in an already rendered component duri
28140
28252
  addBlockedChore(chore, blockingChore, blockedChores);
28141
28253
  return chore;
28142
28254
  }
28143
- const runningChore = getRunningChore(chore);
28144
- if (runningChore) {
28145
- addBlockedChore(chore, runningChore, blockedChores);
28146
- return chore;
28147
- }
28148
28255
  }
28149
28256
  addChoreAndIncrementBlockingCounter(chore, choreQueue);
28150
28257
  DEBUG6 && debugTrace(
@@ -28301,7 +28408,7 @@ This is often caused by modifying a signal in an already rendered component duri
28301
28408
  applyJournalFlush();
28302
28409
  const blockingChore = findBlockingChoreForVisible(chore, runningChores, container);
28303
28410
  if (blockingChore && blockingChore.$state$ === 1 /* RUNNING */) {
28304
- addBlockedChore(chore, blockingChore, blockedChores);
28411
+ (blockingChore.$blockedChores$ || (blockingChore.$blockedChores$ = new ChoreArray())).add(chore);
28305
28412
  continue;
28306
28413
  }
28307
28414
  }
@@ -28577,8 +28684,14 @@ function addChore(chore, choreArray) {
28577
28684
  function vNodeAlreadyDeleted(chore) {
28578
28685
  return !!(chore.$host$ && vnode_isVNode(chore.$host$) && chore.$host$.flags & 32 /* Deleted */);
28579
28686
  }
28687
+ function isResourceChore(chore) {
28688
+ return chore.$type$ === 3 /* TASK */ && !!chore.$payload$ && !!(chore.$payload$.$flags$ & 4 /* RESOURCE */);
28689
+ }
28580
28690
  function addBlockedChore(blockedChore, blockingChore, blockedChores) {
28581
28691
  var _a5;
28692
+ if (!isResourceChore(blockedChore) && choreComparator(blockedChore, blockingChore) === 0) {
28693
+ return;
28694
+ }
28582
28695
  DEBUG6 && debugTrace(
28583
28696
  `blocked chore by ${debugChoreToString(blockingChore)}`,
28584
28697
  blockedChore,
@@ -28678,9 +28791,9 @@ function debugTrace(action, arg, queue2, blockedChores) {
28678
28791
  lines.push(line);
28679
28792
  }
28680
28793
  }
28681
- if (blockedChores && blockedChores.size > 0) {
28794
+ if (blockedChores && blockedChores.length > 0) {
28682
28795
  lines.push("");
28683
- lines.push(`\u{1F6AB} Blocked Chores (${blockedChores.size} items):`);
28796
+ lines.push(`\u{1F6AB} Blocked Chores (${blockedChores.length} items):`);
28684
28797
  Array.from(blockedChores).forEach((chore, index) => {
28685
28798
  const type = debugChoreTypeToString(chore.$type$);
28686
28799
  const host = String(chore.$host$).replaceAll(/\n.*/gim, "");
@@ -28867,15 +28980,15 @@ async function serialize(serializationContext) {
28867
28980
  const s11nWeakRefs = /* @__PURE__ */ new Map();
28868
28981
  let parent;
28869
28982
  const qrlMap = /* @__PURE__ */ new Map();
28870
- const outputArray = (value, keepNulls, writeFn) => {
28983
+ const outputArray = (value, keepUndefined, writeFn) => {
28871
28984
  $writer$.write("[");
28872
28985
  let separator = false;
28873
28986
  let length;
28874
- if (keepNulls) {
28987
+ if (keepUndefined) {
28875
28988
  length = value.length;
28876
28989
  } else {
28877
28990
  length = value.length - 1;
28878
- while (length >= 0 && value[length] === null) {
28991
+ while (length >= 0 && value[length] === void 0) {
28879
28992
  length--;
28880
28993
  }
28881
28994
  length++;
@@ -28890,7 +29003,7 @@ async function serialize(serializationContext) {
28890
29003
  }
28891
29004
  $writer$.write("]");
28892
29005
  };
28893
- const output = (type, value, keepNulls) => {
29006
+ const output = (type, value, keepUndefined) => {
28894
29007
  $writer$.write(`${type},`);
28895
29008
  if (typeof value === "number") {
28896
29009
  $writer$.write(value.toString());
@@ -28905,7 +29018,7 @@ async function serialize(serializationContext) {
28905
29018
  }
28906
29019
  $writer$.write(lastIdx === 0 ? s : s.slice(lastIdx));
28907
29020
  } else {
28908
- outputArray(value, keepNulls, (valueItem, idx) => {
29021
+ outputArray(value, !!keepUndefined, (valueItem, idx) => {
28909
29022
  writeValue(valueItem, idx);
28910
29023
  });
28911
29024
  }
@@ -29061,7 +29174,12 @@ async function serialize(serializationContext) {
29061
29174
  const writeObjectValue = (value) => {
29062
29175
  if (isPropsProxy(value)) {
29063
29176
  const owner = value[_OWNER];
29064
- output(32 /* PropsProxy */, [_serializationWeakRef(owner), owner.varProps, owner.constProps]);
29177
+ output(32 /* PropsProxy */, [
29178
+ _serializationWeakRef(owner),
29179
+ owner.varProps,
29180
+ owner.constProps,
29181
+ value[_PROPS_HANDLER].$effects$
29182
+ ]);
29065
29183
  } else if (value instanceof SubscriptionData) {
29066
29184
  output(33 /* SubscriptionData */, [value.data.$scopedStyleIdPrefix$, value.data.$isConst$]);
29067
29185
  } else if (isStore(value)) {
@@ -29090,7 +29208,7 @@ async function serialize(serializationContext) {
29090
29208
  }
29091
29209
  }
29092
29210
  const out = [storeTarget, flags, effects, ...innerStores];
29093
- while (out[out.length - 1] == null) {
29211
+ while (out[out.length - 1] === void 0) {
29094
29212
  out.pop();
29095
29213
  }
29096
29214
  output(29 /* Store */, out);
@@ -29099,7 +29217,13 @@ async function serialize(serializationContext) {
29099
29217
  const result2 = value[SerializerSymbol](value);
29100
29218
  if (isPromise(result2)) {
29101
29219
  const forwardRef = resolvePromise(result2, $addRoot$, (resolved, resolvedValue) => {
29102
- return new PromiseResult(28 /* SerializerSignal */, resolved, resolvedValue, null, null);
29220
+ return new PromiseResult(
29221
+ 28 /* SerializerSignal */,
29222
+ resolved,
29223
+ resolvedValue,
29224
+ void 0,
29225
+ void 0
29226
+ );
29103
29227
  });
29104
29228
  output(2 /* ForwardRef */, forwardRef);
29105
29229
  } else {
@@ -29128,10 +29252,9 @@ async function serialize(serializationContext) {
29128
29252
  } else if (value instanceof SignalImpl) {
29129
29253
  if (value instanceof SerializerSignalImpl) {
29130
29254
  addPreloadQrl(value.$computeQrl$);
29131
- const forwardRefId = resolvePromise(
29132
- getCustomSerializerPromise(value, value.$untrackedValue$),
29133
- $addRoot$,
29134
- (resolved, resolvedValue) => {
29255
+ const maybeValue = getCustomSerializerPromise(value, value.$untrackedValue$);
29256
+ if (isPromise(maybeValue)) {
29257
+ const forwardRefId = resolvePromise(maybeValue, $addRoot$, (resolved, resolvedValue) => {
29135
29258
  return new PromiseResult(
29136
29259
  28 /* SerializerSignal */,
29137
29260
  resolved,
@@ -29139,9 +29262,11 @@ async function serialize(serializationContext) {
29139
29262
  value.$effects$,
29140
29263
  value.$computeQrl$
29141
29264
  );
29142
- }
29143
- );
29144
- output(2 /* ForwardRef */, forwardRefId);
29265
+ });
29266
+ output(2 /* ForwardRef */, forwardRefId);
29267
+ } else {
29268
+ output(28 /* SerializerSignal */, [value.$computeQrl$, value.$effects$, maybeValue]);
29269
+ }
29145
29270
  return;
29146
29271
  }
29147
29272
  if (value instanceof WrappedSignalImpl) {
@@ -29176,12 +29301,22 @@ async function serialize(serializationContext) {
29176
29301
  value.$untrackedError$
29177
29302
  );
29178
29303
  }
29304
+ let keepUndefined = false;
29179
29305
  if (v !== NEEDS_COMPUTATION) {
29180
29306
  out.push(v);
29307
+ if (!isAsync && v === void 0) {
29308
+ keepUndefined = true;
29309
+ }
29181
29310
  }
29182
- output(isAsync ? 27 /* AsyncComputedSignal */ : 26 /* ComputedSignal */, out);
29311
+ output(isAsync ? 27 /* AsyncComputedSignal */ : 26 /* ComputedSignal */, out, keepUndefined);
29183
29312
  } else {
29184
- output(24 /* Signal */, [value.$untrackedValue$, ...value.$effects$ || []]);
29313
+ const v = value.$untrackedValue$;
29314
+ const keepUndefined = v === void 0;
29315
+ const out = [v];
29316
+ if (value.$effects$) {
29317
+ out.push(...value.$effects$);
29318
+ }
29319
+ output(24 /* Signal */, out, keepUndefined);
29185
29320
  }
29186
29321
  } else if (value instanceof URL) {
29187
29322
  output(6 /* URL */, value.href);
@@ -29248,9 +29383,9 @@ async function serialize(serializationContext) {
29248
29383
  value.varProps,
29249
29384
  value.constProps,
29250
29385
  value.children,
29251
- value.toSort || null
29386
+ value.toSort || void 0
29252
29387
  ];
29253
- while (out[out.length - 1] == null) {
29388
+ while (out[out.length - 1] === void 0) {
29254
29389
  out.pop();
29255
29390
  }
29256
29391
  output(31 /* JSXNode */, out);
@@ -29263,7 +29398,7 @@ async function serialize(serializationContext) {
29263
29398
  value[_EFFECT_BACK_REF],
29264
29399
  value.$state$
29265
29400
  ];
29266
- while (out[out.length - 1] == null) {
29401
+ while (out[out.length - 1] === void 0) {
29267
29402
  out.pop();
29268
29403
  }
29269
29404
  output(21 /* Task */, out);
@@ -29367,7 +29502,7 @@ async function serialize(serializationContext) {
29367
29502
  await outputRoots();
29368
29503
  }
29369
29504
  var PromiseResult = class {
29370
- constructor($type$, $resolved$, $value$, $effects$ = null, $qrl$ = null) {
29505
+ constructor($type$, $resolved$, $value$, $effects$ = void 0, $qrl$ = void 0) {
29371
29506
  this.$type$ = $type$;
29372
29507
  this.$resolved$ = $resolved$;
29373
29508
  this.$value$ = $value$;
@@ -29376,20 +29511,27 @@ var PromiseResult = class {
29376
29511
  }
29377
29512
  };
29378
29513
  function getCustomSerializerPromise(signal, value) {
29379
- return new Promise((resolve) => {
29380
- signal.$computeQrl$.resolve().then((arg) => {
29514
+ if (value === NEEDS_COMPUTATION) {
29515
+ return value;
29516
+ }
29517
+ return maybeThen(
29518
+ signal.$computeQrl$.resolved || signal.$computeQrl$.resolve(),
29519
+ (arg) => {
29381
29520
  let data;
29521
+ if (typeof arg === "function") {
29522
+ arg = arg();
29523
+ }
29382
29524
  if (arg.serialize) {
29383
29525
  data = arg.serialize(value);
29384
- } else if (SerializerSymbol in value) {
29526
+ } else if (typeof value === "object" && SerializerSymbol in value) {
29385
29527
  data = value[SerializerSymbol](value);
29386
29528
  }
29387
29529
  if (data === void 0) {
29388
29530
  data = NEEDS_COMPUTATION;
29389
29531
  }
29390
- resolve(data);
29391
- });
29392
- });
29532
+ return data;
29533
+ }
29534
+ );
29393
29535
  }
29394
29536
  var discoverValuesForVNodeData = (vnodeData, callback) => {
29395
29537
  for (const value of vnodeData) {
@@ -29426,7 +29568,7 @@ function serializeWrappingFn(serializationContext, value) {
29426
29568
  return [syncFnId, value.$args$];
29427
29569
  }
29428
29570
  function filterEffectBackRefs(effectBackRef) {
29429
- let effectBackRefToSerialize = null;
29571
+ let effectBackRefToSerialize = void 0;
29430
29572
  if (effectBackRef) {
29431
29573
  for (const [effectProp, effect] of effectBackRef) {
29432
29574
  if (effect[2 /* BACK_REF */]) {
@@ -29581,7 +29723,7 @@ var _SharedContainer = class {
29581
29723
  throw Error("Not implemented");
29582
29724
  };
29583
29725
  const choreQueue = new ChoreArray();
29584
- const blockedChores = /* @__PURE__ */ new Set();
29726
+ const blockedChores = new ChoreArray();
29585
29727
  const runningChores = /* @__PURE__ */ new Set();
29586
29728
  this.$scheduler$ = createScheduler(
29587
29729
  this,
@@ -30090,7 +30232,7 @@ var inflate = (container, target, typeId, data) => {
30090
30232
  asyncComputed.$loadingEffects$ = new Set(d2[2]);
30091
30233
  asyncComputed.$errorEffects$ = new Set(d2[3]);
30092
30234
  asyncComputed.$untrackedLoading$ = d2[4];
30093
- asyncComputed.$untrackedError$ = d2[5] || null;
30235
+ asyncComputed.$untrackedError$ = d2[5];
30094
30236
  const hasValue = d2.length > 6;
30095
30237
  if (hasValue) {
30096
30238
  asyncComputed.$untrackedValue$ = d2[6];
@@ -30105,7 +30247,9 @@ var inflate = (container, target, typeId, data) => {
30105
30247
  const computed = target;
30106
30248
  const d2 = data;
30107
30249
  computed.$computeQrl$ = d2[0];
30108
- computed.$effects$ = new Set(d2[1]);
30250
+ if (d2[1]) {
30251
+ computed.$effects$ = new Set(d2[1]);
30252
+ }
30109
30253
  const hasValue = d2.length > 2;
30110
30254
  if (hasValue) {
30111
30255
  computed.$untrackedValue$ = d2[2];
@@ -30190,6 +30334,7 @@ var inflate = (container, target, typeId, data) => {
30190
30334
  owner._proxy = propsProxy;
30191
30335
  }
30192
30336
  propsProxy[_OWNER] = owner;
30337
+ propsProxy[_PROPS_HANDLER].$effects$ = d[3];
30193
30338
  break;
30194
30339
  case 33 /* SubscriptionData */: {
30195
30340
  const effectData = target;
@@ -31077,9 +31222,6 @@ var DomContainer = class extends _SharedContainer {
31077
31222
  this.$setServerData$();
31078
31223
  element.setAttribute(QContainerAttr, "resumed" /* RESUMED */);
31079
31224
  element.qContainer = this;
31080
- if (!qTest && element.isConnected) {
31081
- element.dispatchEvent(new CustomEvent("qresume", { bubbles: true }));
31082
- }
31083
31225
  const qwikStates = element.querySelectorAll('script[type="qwik/state"]');
31084
31226
  if (qwikStates.length !== 0) {
31085
31227
  const lastState = qwikStates[qwikStates.length - 1];
@@ -31087,6 +31229,9 @@ var DomContainer = class extends _SharedContainer {
31087
31229
  preprocessState(this.$rawStateData$, this);
31088
31230
  this.$stateData$ = wrapDeserializerProxy(this, this.$rawStateData$);
31089
31231
  }
31232
+ if (!qTest && element.isConnected) {
31233
+ element.dispatchEvent(new CustomEvent("qresume", { bubbles: true }));
31234
+ }
31090
31235
  }
31091
31236
  $setRawState$(id, vParent) {
31092
31237
  this.$stateData$[id] = vParent;
@@ -32015,19 +32160,18 @@ var vnode_applyJournal = (journal) => {
32015
32160
  key = "class";
32016
32161
  }
32017
32162
  const value = journal[idx++];
32163
+ const shouldRemove = value == null || value === false;
32018
32164
  if (isBooleanAttr(element, key)) {
32019
32165
  element[key] = parseBoolean(value);
32020
- } else if (key === "value" && key in element) {
32021
- element.value = String(value);
32022
32166
  } else if (key === dangerouslySetInnerHTML) {
32023
32167
  element.innerHTML = value;
32024
32168
  element.setAttribute(QContainerAttr, "html" /* HTML */);
32169
+ } else if (shouldRemove) {
32170
+ element.removeAttribute(key);
32171
+ } else if (key === "value" && key in element) {
32172
+ element.value = String(value);
32025
32173
  } else {
32026
- if (value == null || value === false) {
32027
- element.removeAttribute(key);
32028
- } else {
32029
- element.setAttribute(key, String(value));
32030
- }
32174
+ element.setAttribute(key, String(value));
32031
32175
  }
32032
32176
  break;
32033
32177
  case 3 /* HoistStyles */:
@@ -32659,6 +32803,7 @@ function materializeFromVNodeData(vParent, vData, element, child) {
32659
32803
  const nodeIsElement = isElement(node);
32660
32804
  return !nodeIsElement || nodeIsElement && shouldSkipElement(node);
32661
32805
  };
32806
+ let components = null;
32662
32807
  processVNodeData2(vData, (peek, consumeValue, consume, getChar, nextToConsumeIdx) => {
32663
32808
  if (isNumber2(peek())) {
32664
32809
  while (shouldSkipNode(child)) {
@@ -32681,6 +32826,7 @@ function materializeFromVNodeData(vParent, vData, element, child) {
32681
32826
  } else if (peek() === VNodeDataChar.SCOPED_STYLE) {
32682
32827
  vParent.setAttr(QScopedStyle, consumeValue(), null);
32683
32828
  } else if (peek() === VNodeDataChar.RENDER_FN) {
32829
+ (components || (components = [])).push(vParent);
32684
32830
  vParent.setAttr(OnRenderProp, consumeValue(), null);
32685
32831
  } else if (peek() === VNodeDataChar.ID) {
32686
32832
  if (!container) {
@@ -32762,6 +32908,15 @@ function materializeFromVNodeData(vParent, vData, element, child) {
32762
32908
  textIdx += length;
32763
32909
  }
32764
32910
  });
32911
+ if (components) {
32912
+ if (!container) {
32913
+ container = getDomContainer(element);
32914
+ }
32915
+ for (const component of components) {
32916
+ container.ensureProjectionResolved(component);
32917
+ }
32918
+ components = null;
32919
+ }
32765
32920
  vParent.lastChild = vLast;
32766
32921
  return vFirst;
32767
32922
  }
@@ -33402,7 +33557,7 @@ function diffJsxVNode(received, expected, path = [], container, isSsr) {
33402
33557
  }
33403
33558
  const propLowerCased = prop.toLowerCase();
33404
33559
  let receivedValue = received.getAttr(prop) || received.getAttr(propLowerCased) || receivedElement?.getAttribute(prop) || receivedElement?.getAttribute(propLowerCased);
33405
- let expectedValue = prop === "key" || prop === ELEMENT_KEY ? receivedValue : expected.props[prop];
33560
+ let expectedValue = prop === "key" || prop === ELEMENT_KEY ? receivedValue : untrack2(() => expected.props[prop]);
33406
33561
  if (typeof receivedValue === "boolean" || typeof receivedValue === "number") {
33407
33562
  receivedValue = serializeBooleanOrNumberAttribute(receivedValue);
33408
33563
  }
@@ -34450,7 +34605,7 @@ var preloaderPre = (container, options, nonce) => {
34450
34605
  ]);
34451
34606
  container.closeElement();
34452
34607
  const script2 = `let b=fetch("${bundleGraphPath}");import("${preloaderBundle}").then(({l})=>l(${JSON.stringify(base2)},b${optsStr}));`;
34453
- const scriptAttrs = ["type", "module", "async", true];
34608
+ const scriptAttrs = ["type", "module", "async", true, "crossorigin", "anonymous"];
34454
34609
  if (nonce) {
34455
34610
  scriptAttrs.push("nonce", nonce);
34456
34611
  }