Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slimy-lizards-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': patch
---

FIX: preloader now preloads bundles as long as they are part of the current viewport's bundles graph, even if their probability is very small
2 changes: 1 addition & 1 deletion packages/qwik/src/core/preloader/preloader.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ test('preloader script', () => {
* dereference objects etc, but that actually results in worse compression
*/
const compressed = compress(Buffer.from(preLoader), { mode: 1, quality: 11 });
expect([compressed.length, preLoader.length]).toEqual([1875, 5567]);
expect([compressed.length, preLoader.length]).toEqual([1872, 5549]);
});
3 changes: 1 addition & 2 deletions packages/qwik/src/core/preloader/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ export const adjustProbabilities = (
if (
// don't queue until we have initialized the preloader
base != null &&
bundle.$state$ < BundleImportState_Preload &&
bundle.$inverseProbability$ < config.$invPreloadProbability$
bundle.$state$ < BundleImportState_Preload
) {
if (bundle.$state$ === BundleImportState_None) {
bundle.$state$ = BundleImportState_Queued;
Expand Down
Loading