Skip to content

Commit e832641

Browse files
committed
wip requeue on fire
1 parent 537e45d commit e832641

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

packages/docs/vite.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export default defineConfig(async () => {
173173
],
174174
},
175175
}),
176-
qwikVite(),
176+
qwikVite({ debug: true }),
177177
partytownVite({
178178
dest: resolve('dist', '~partytown'),
179179
}),

packages/qwik/src/core/preloader.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
/**
23
* Note: this file gets built separately from the rest of the core module, and is then kept separate
34
* in the dist directory via manualChunks. This way it can run before the rest of the core module is
@@ -85,6 +86,8 @@ const preloadOne = (bundle: BundleImport, priority?: boolean) => {
8586
return;
8687
}
8788
if (bundle.$url$) {
89+
const start = performance.now();
90+
console.log('>> preloadOne', bundle.$url$, priority);
8891
const link = doc.createElement('link');
8992
link.href = bundle.$url$!;
9093
link.rel = rel;
@@ -95,6 +98,8 @@ const preloadOne = (bundle: BundleImport, priority?: boolean) => {
9598
}
9699
link.as = 'script';
97100
link.onload = link.onerror = () => {
101+
const end = performance.now();
102+
console.log('<< preloadOne done', bundle.$url$, priority, `${end - start}ms`);
98103
link.remove();
99104
if (priority) {
100105
highCount--;
@@ -185,6 +190,9 @@ const preload = (name: string | string[], priority?: boolean) => {
185190
return;
186191
}
187192
const queue = priority ? high : low;
193+
console.log(
194+
`preload queue ${name} ${priority ? 'high' : 'low'} - high ${high.length} low ${low.length}`
195+
);
188196
if (Array.isArray(name)) {
189197
queue.push(...(name.map(ensureBundle).filter(Boolean) as BundleImport[]).reverse());
190198
} else {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ export const createQRL = <TYPE>(
127127
};
128128

129129
const resolve = async (containerEl?: Element): Promise<TYPE> => {
130+
// Give it another bump
131+
preload(symbol, true);
130132
if (symbolRef !== null) {
131133
// Resolving (Promise) or already resolved (value)
132134
return symbolRef;

0 commit comments

Comments
 (0)