@@ -58,7 +58,6 @@ const preloadStr = 'preload';
5858
5959let highCount = 0 ;
6060let lowCount = 0 ;
61- const max = 11 ;
6261/**
6362 * This is called when a bundle is queued or finished loading.
6463 *
@@ -68,11 +67,11 @@ const max = 11;
6867 * We make sure to first empty the high priority items, first-in-last-out.
6968 */
7069const trigger = ( ) => {
71- while ( highCount < max && high . length ) {
70+ while ( highCount < 8 && high . length ) {
7271 const bundle = high . pop ( ) ! ;
7372 preloadOne ( bundle ! , true ) ;
7473 }
75- while ( highCount + lowCount < max && low . length ) {
74+ while ( highCount + lowCount < 4 && low . length ) {
7675 const bundle = low . pop ( ) ! ;
7776 preloadOne ( bundle ! ) ;
7877 }
@@ -127,7 +126,8 @@ const preloadOne = (bundle: BundleImport, priority?: boolean) => {
127126 preload ( bundle . $imports$ , priority ) ;
128127 preload ( bundle . $dynamicImports$ ) ;
129128 } else {
130- preload ( [ ...bundle . $imports$ , ...bundle . $dynamicImports$ ] ) ;
129+ // only preload direct imports, low priority
130+ preload ( bundle . $imports$ ) ;
131131 }
132132} ;
133133
@@ -154,7 +154,7 @@ const ensureBundle = (name: string) => {
154154 return bundle ;
155155} ;
156156
157- const parseBundleGraph = ( text : string , base : string ) => {
157+ const parseBundleGraph = ( text : string ) => {
158158 const graph = JSON . parse ( text ) as QwikBundleGraph ;
159159 let i = 0 ;
160160 // All existing loading bundles need imports processed
@@ -225,7 +225,7 @@ const loadBundleGraph = (basePath: string, manifestHash: string) => {
225225 // TODO check TTI, maybe inject fetch link with timeout so we don't do the fetch directly
226226 fetch ( `${ basePath } q-bundle-graph-${ manifestHash } .json` )
227227 . then ( ( res ) => res . text ( ) )
228- . then ( ( text ) => parseBundleGraph ( text , basePath ) )
228+ . then ( ( text ) => parseBundleGraph ( text ) )
229229 // We warn because it's not critical, and in the CI tests Windows serves up a HTML file instead the bundle graph sometimes, which breaks the tests that don't expect error logs
230230 . catch ( console . warn ) ;
231231} ;
0 commit comments