Skip to content

Commit a0906bf

Browse files
committed
fix underprefetching
1 parent f21f18c commit a0906bf

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/qwik/src/optimizer/src/plugins/bundle-graph.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ export function convertManifestToBundleGraph(
5858
for (const bundleName of Object.keys(graph)) {
5959
const bundle = graph[bundleName];
6060
const imports = bundle.imports?.filter((dep) => graph[dep]) || [];
61-
62-
// We only include dynamic imports that have qrl segments
63-
// If the dev wants to include other dynamic imports, they can just make a qrl()
64-
const dynamicImports = bundle.dynamicImports?.filter((dep) => graph[dep]?.hasSegments) || [];
61+
const dynamicImports = bundle.dynamicImports?.filter((dep) => graph[dep]) || [];
6562

6663
// Overwrite so we don't mutate
6764
graph[bundleName] = {

packages/qwik/src/server/preloading.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ If we have available bandwidth, we can download code before it is needed. We sho
3131

3232
To know which code is most likely to be needed, we can use the bundle scoring system.
3333

34+
We will err on the side of caution, so if we are not sure, we will preload the bundle. This is better than making the user wait. In the end, all of the code that might be needed for the current page should be preloaded. However, we should make sure that bundles that are more likely to be needed are preloaded first.
35+
3436
### Bundle scoring system
3537

36-
Each bundle gets a score based on:
38+
Each bundle gets some metrics that will be used to score it. The scoring should help us decide which bundles to preload first.
3739

3840
- Interactivity: How much impact to interactivity is there if the bundle is missing?
3941
- score 0 to 5
4042
- a click handler is very interactive, but the Task that gets executed by the signal that changes might also be important
41-
- qwik core is not interactive at all, but its importers are
42-
- dependencies get the sum score of their importers
43+
- qwik core is not interactive directly, so it gets 0.
4344
- Size: How much code is there to download?
4445
- score: percentage of total js bundle size, including all static imports and their static imports etc
4546
- heavy bundles that are not interactive should not be preloaded at all, but very interactive bundles should be preloaded before others, so that smaller bundles can download in parallel.

0 commit comments

Comments
 (0)