File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11import { 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' ;
33import { Insights } from '@builder.io/qwik-labs' ;
44import RealMetricsOptimization from './components/real-metrics-optimization/real-metrics-optimization' ;
55import { 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 } />
Original file line number Diff line number Diff line change 1+ /* eslint-disable no-console */
12import { isBrowser } from '@builder.io/qwik/build' ;
23import { base , getBundle , graph } from './bundle-graph' ;
34import {
@@ -68,6 +69,8 @@ export const getQueue = () => {
6869 * We make sure to first preload the high priority items.
6970 */
7071export 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 ) {
You can’t perform that action at this time.
0 commit comments