-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qwikui.com and preview over-fetches and over-executes some js bundles #719
Comments
Either the solution from QwikDev/qwik#5478: build: {
// Disables the preload.
modulePreload: false,
}, or the this from the starter code:
don't seem to resolve the issue. So again, it could be a bug caused by nx, shiki 🤷♂️, the cloudflare adapter with SSG, or |
Closing as this seems to have been fixed by moving qwik-themes code themeSig.value initial assignment from a useVisibleTask$ to onClick$ when clicking on "copy code" button of "Make it Yours" feat. |
TLDR
This is a complex network/bundling issue that looks scary because more kb are being transferred and more resources are being downloaded (as showcased at the bottom of the dev tools), but it seems to be constrained to qwikui.com and isn't a real problem (yet) for the end-user (a.k.a the developer) since it doesn't noticeably slow down page loads.
I suggest not looking into it further as our time is probably best spent elsewhere. We might eventually end up fixing this in future updates or bug fixes.
Description
An image is worth a thousand words:
As you can see, on preview (and this happens in prod too), qwik is downloading and executing (see the ServiceWorkerjs chunks (such as
accordion-trigger-2CzFt9Ho.js
,accordion-context-id--dprVjBd.js
,collapsible-context-id-n_KRb9sO.js
,combobox-context-id-sPdc1JgF.js
,scroll-area-qwikified-VYs7Nxwj.js
,key-code.type-Yo321nVC.js
, etc.), that are not even present on the page. The good news is, all of those chunks are served from the service-worker, and they don't seem to end up into terrible waterfalls (it seems to do some kind of "multi-threading", reducing the waterfall to 2 cascades).I spent about a full week on this issue. It is not easy to understand what's causing it. The farthest I could get with a reproduction is this: QwikDev/qwik#6150 which seems to be a service-worker.js bug. On qwikui.com the bug seems to go even further with chunks being served from the service worker. The difference in my reproduction is that the service-worker only pre-populates the cache and doesn't serve the js chunks, whereas on qwikui.com, it serves the chunks to the main thread. The following image could explain why:
If we look at the actual bundled file being served, we can see for example that
entry_make_it_yours-H_X7utmV.js
has a few imports that it shouldn't have.Potential causes (from least likely to most likely)
preserveModules
on every package or changing the website vite.config to match usual templates doesn't remove the bug.The text was updated successfully, but these errors were encountered: