Skip to content

Commit ff61f13

Browse files
committed
chore: query param
1 parent 7276ed6 commit ff61f13

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/docs/src/root.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { component$, useContextProvider, useStore } from '@builder.io/qwik';
2-
import { QwikCityProvider, RouterOutlet, ServiceWorkerRegister } from '@builder.io/qwik-city';
2+
import { QwikCityProvider, RouterOutlet } from '@builder.io/qwik-city';
33
import { Insights } from '@builder.io/qwik-labs';
44
import RealMetricsOptimization from './components/real-metrics-optimization/real-metrics-optimization';
55
import { RouterHead } from './components/router-head/router-head';
@@ -56,7 +56,7 @@ export default component$(() => {
5656
<script dangerouslySetInnerHTML={uwu} />
5757
<RouterHead />
5858

59-
<ServiceWorkerRegister />
59+
{/* <ServiceWorkerRegister /> */}
6060

6161
<script dangerouslySetInnerHTML={`(${collectSymbols})()`} />
6262
<Insights publicApiKey={import.meta.env.PUBLIC_QWIK_INSIGHTS_KEY} />

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import { isBrowser } from '@builder.io/qwik/build';
23
import { base, getBundle, graph } from './bundle-graph';
34
import {
@@ -68,6 +69,8 @@ export const getQueue = () => {
6869
* We make sure to first preload the high priority items.
6970
*/
7071
export const trigger = () => {
72+
const params = new URLSearchParams(window.location.search);
73+
const limit = params.get('limit');
7174
if (!queue.length) {
7275
return;
7376
}
@@ -76,9 +79,10 @@ export const trigger = () => {
7679
const bundle = queue[0];
7780
const inverseProbability = bundle.$inverseProbability$;
7881
const probability = 1 - inverseProbability;
82+
console.log('limit :', limit);
7983
const allowedPreloads = graph
8084
? // The more likely the bundle, the more simultaneous preloads we want to allow
81-
Math.max(1, config[maxSimultaneousPreloadsStr] * probability)
85+
Math.max(1, Number(limit) || config[maxSimultaneousPreloadsStr] * probability)
8286
: // While the graph is not available, we limit to 2 preloads
8387
2;
8488
if (preloadCount < allowedPreloads) {

0 commit comments

Comments
 (0)