Skip to content

Commit f6750e0

Browse files
committed
chore: repro
1 parent 28de164 commit f6750e0

File tree

15 files changed

+160
-25
lines changed

15 files changed

+160
-25
lines changed

packages/qwik-router/src/buildtime/markdown/rehype.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function createExport(mdast: Root, identifierName: string, val: any) {
144144
type: 'ExportNamedDeclaration',
145145
source: null,
146146
specifiers: [],
147+
// @ts-ignore
147148
attributes: [],
148149
declaration: {
149150
type: 'VariableDeclaration',

packages/qwik/src/core/preloader/queue.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ if (isBrowser) {
265265
// Get early hints from qwikloader
266266
document.addEventListener('qsymbol', (ev) => {
267267
const { symbol, href } = (ev as QwikSymbolEvent).detail;
268+
console.log('queue.ts preload qsymbol symbol href', symbol, href);
268269
// the qrl class doesn't emit href, we don't need to preload
269270
if (href) {
270271
const hash = symbol.slice(symbol.lastIndexOf('_') + 1);

packages/qwik/src/core/reactive-primitives/impl/async-computed-signal-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { setupSignalValueAccess } from './signal-impl';
1111
import type { NoSerialize } from '../../shared/utils/serialize-utils';
1212
import { ChoreType } from '../../shared/util-chore-type';
1313

14-
const DEBUG = false;
14+
const DEBUG = true;
1515
const log = (...args: any[]) =>
1616
// eslint-disable-next-line no-console
1717
console.log('ASYNC COMPUTED SIGNAL', ...args.map(qwikDebugToString));

packages/qwik/src/core/reactive-primitives/impl/computed-signal-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { _EFFECT_BACK_REF, EffectProperty, NEEDS_COMPUTATION, SignalFlags } from
1313
import { SignalImpl } from './signal-impl';
1414
import type { QRLInternal } from '../../shared/qrl/qrl-class';
1515

16-
const DEBUG = false;
16+
const DEBUG = true;
1717
// eslint-disable-next-line no-console
1818
const log = (...args: any[]) => console.log('COMPUTED SIGNAL', ...args.map(qwikDebugToString));
1919

packages/qwik/src/core/reactive-primitives/impl/serializer-signal-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '../types';
1414
import { ComputedSignalImpl } from './computed-signal-impl';
1515

16-
const DEBUG = false;
16+
const DEBUG = true;
1717
// eslint-disable-next-line no-console
1818
const log = (...args: any[]) => console.log('SERIALIZER SIGNAL', ...args.map(qwikDebugToString));
1919

packages/qwik/src/core/reactive-primitives/impl/signal-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { Signal } from '../signal.public';
1414
import { SignalFlags, type EffectSubscription } from '../types';
1515
import { ChoreType } from '../../shared/util-chore-type';
1616

17-
const DEBUG = false;
17+
const DEBUG = true;
1818
// eslint-disable-next-line no-console
1919
const log = (...args: any[]) => console.log('SIGNAL', ...args.map(qwikDebugToString));
2020

packages/qwik/src/core/reactive-primitives/impl/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from '../types';
1919
import { ChoreType } from '../../shared/util-chore-type';
2020

21-
const DEBUG = false;
21+
const DEBUG = true;
2222

2323
// eslint-disable-next-line no-console
2424
const log = (...args: any[]) => console.log('STORE', ...args.map(qwikDebugToString));

packages/qwik/src/core/reactive-primitives/utils.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { isDomContainer } from '../client/dom-container';
2-
import { pad, qwikDebugToString } from '../debug';
2+
import { qwikDebugToString } from '../debug';
3+
import { preload } from '../preloader/queue';
34
import type { OnRenderFn } from '../shared/component.public';
45
import { assertDefined } from '../shared/error/assert';
56
import type { Props } from '../shared/jsx/jsx-runtime';
@@ -28,10 +29,13 @@ import {
2829
type StoreTarget,
2930
} from './types';
3031

31-
const DEBUG = false;
32+
const DEBUG = true;
3233

33-
// eslint-disable-next-line no-console
34-
const log = (...args: any[]) => console.log('SIGNAL', ...args.map(qwikDebugToString));
34+
const log = (...args: any[]) =>
35+
console.warn(
36+
'SIGNAL',
37+
...args.map((arg) => (arg && typeof arg === 'object' ? arg : qwikDebugToString(arg)))
38+
);
3539

3640
export const throwIfQRLNotResolved = (qrl: QRL) => {
3741
const resolved = qrl.resolved;
@@ -93,11 +97,14 @@ export const triggerEffects = (
9397
if (effects) {
9498
const scheduleEffect = (effectSubscription: EffectSubscription) => {
9599
const consumer = effectSubscription[EffectSubscriptionProp.CONSUMER];
100+
DEBUG && log('schedule.consumer', consumer);
96101
const property = effectSubscription[EffectSubscriptionProp.PROPERTY];
97102
assertDefined(container, 'Container must be defined.');
98103
if (isTask(consumer)) {
104+
// preload(consumer.$qrl$?.$hash$, 1);
105+
DEBUG && log('schedule.consumer.task', consumer);
99106
consumer.$flags$ |= TaskFlags.DIRTY;
100-
DEBUG && log('schedule.consumer.task', pad('\n' + String(consumer), ' '));
107+
101108
let choreType = ChoreType.TASK;
102109
if (consumer.$flags$ & TaskFlags.VISIBLE_TASK) {
103110
choreType = ChoreType.VISIBLE;
@@ -113,7 +120,6 @@ export const triggerEffects = (
113120
container.$scheduler$(ChoreType.QRL_RESOLVE, null, consumer.$computeQrl$);
114121
}
115122
}
116-
117123
(consumer as ComputedSignalImpl<unknown> | WrappedSignalImpl<unknown>).invalidate();
118124
} else if (property === EffectProperty.COMPONENT) {
119125
const host: HostElement = consumer as any;

packages/qwik/src/core/shared/qrl/qrl-class.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export const createQRL = <TYPE>(
182182

183183
if (isBrowser && chunk) {
184184
/** We run the QRL, so now the probability of the chunk is 100% */
185+
console.log('qrl-class.ts runQRL preload 1', chunk);
185186
preload(chunk, 1);
186187
}
187188

@@ -257,11 +258,13 @@ export const createQRL = <TYPE>(
257258
if (qDev) {
258259
seal(qrl);
259260
}
261+
260262
if (isBrowser && symbol) {
261263
/**
262264
* Preloading the symbol instead of the chunk allows us to get probabilities for the bundle
263265
* based on its contents.
264266
*/
267+
console.log('qrl-class.ts createQRL preload 0.8', chunk);
265268
preload(symbol, 0.8);
266269
}
267270
return qrl;

packages/qwik/src/core/shared/shared-serialization.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ import { WrappedSignalImpl } from '../reactive-primitives/impl/wrapped-signal-im
6666
import { SerializerSignalImpl } from '../reactive-primitives/impl/serializer-signal-impl';
6767
import { AsyncComputedSignalImpl } from '../reactive-primitives/impl/async-computed-signal-impl';
6868
import { isObject } from './utils/types';
69+
import { qwikDebugToString } from '../debug';
70+
71+
const DEBUG = true;
72+
73+
const log = (...args: any[]) =>
74+
console.warn(
75+
'SERIALIZATION',
76+
...args.map((arg) => (arg && typeof arg === 'object' ? arg : qwikDebugToString(arg)))
77+
);
6978

7079
/** Arrays/Objects are special-cased so their identifiers is a single digit. */
7180
const needsInflation = (typeId: TypeIds) =>
@@ -181,6 +190,7 @@ export const _eagerDeserializeArray = (
181190
for (let i = 0; i < data.length; i += 2) {
182191
out[i / 2] = deserializeData(container, data[i] as TypeIds, data[i + 1]);
183192
}
193+
DEBUG && log('eager deserialized array', out);
184194
return out;
185195
};
186196

@@ -260,13 +270,16 @@ const inflate = (
260270
break;
261271
}
262272
case TypeIds.Signal: {
273+
console.log('new signal', data);
263274
const signal = target as SignalImpl<unknown>;
264275
const d = data as [unknown, ...EffectSubscription[]];
265276
signal.$untrackedValue$ = d[0];
266277
signal.$effects$ = new Set(d.slice(1) as EffectSubscription[]);
267278
break;
268279
}
269280
case TypeIds.WrappedSignal: {
281+
console.log('new wrappedsignal', data);
282+
270283
const signal = target as WrappedSignalImpl<unknown>;
271284
const d = data as [
272285
number,
@@ -287,6 +300,7 @@ const inflate = (
287300
break;
288301
}
289302
case TypeIds.AsyncComputedSignal: {
303+
console.log('new asynccomputedsignal', data);
290304
const asyncComputed = target as AsyncComputedSignalImpl<unknown>;
291305
const d = data as [
292306
AsyncComputeQRL<unknown>,
@@ -314,6 +328,7 @@ const inflate = (
314328
// Inflating a SerializerSignal is the same as inflating a ComputedSignal
315329
case TypeIds.SerializerSignal:
316330
case TypeIds.ComputedSignal: {
331+
console.log('new computedsignal', data);
317332
const computed = target as ComputedSignalImpl<unknown>;
318333
const d = data as [QRLInternal<() => {}>, EffectSubscription[] | null, unknown?];
319334
computed.$computeQrl$ = d[0];

0 commit comments

Comments
 (0)