-
Notifications
You must be signed in to change notification settings - Fork 1.4k
perf(qwikloader): put qwikloader in a separate bundle #7613
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
Conversation
🦋 Changeset detectedLatest commit: 61213c5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
f0c1116
to
4163cce
Compare
would be interesting to see if 103 Early Hints would help, but Safari doesn't implement preload so that's a huge chunk of the mobile userbase for which it won't work. |
I tried it on my Android phone as follows:
this shows that the qwikloader was loaded fast enough IMHO |
d7aa008
to
eedb9c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so in 2G for me there's only a tiny window where I can click and qwikloader isn't loaded yet. It's more visible on slow 3G throttling because of the fake latency. So users with real world latency could theoretically experience it, although they'd have to click pretty fast. But I believe this should slightly improve the FCP for most apps so I think it's a good change.
@wmertens few things - 1, The code looks great, good job! 2, I think a changeset is needed here
That way we're safe even if it takes way longer for some reason WDYT? |
this doesn't impact LCP and reduces download size, and allows earlier execution
eedb9c2
to
61213c5
Compare
@shairez hmm, the inline script would actually mean repeating much of the qwikloader internals. Our tests show that the qwikloader is available pretty instantly. Added the changeset. |
ok cool |
We were embedding the qwikloader, which is faster for initial load, but recent experiments with modulepreload show that this isn't necessary.
By putting the qwikloader in its own bundle and using modulepreload + async module script:
This doesn't seem to impact LCP at all.
In the pathological 3G simulation with the fixed 2s lag, the chunk is fetched first, while the html is still downloading, and finishes pretty soon after html finished downloading and while the other resources are also downloading, so the user doesn't really notice anything.
compared to before:

(the other two yellow preloads you see are the preloader bundle and the qwik core bundle)
PS it would be really cute to find a string to embed in the preloader that would make the current
uD3ipkCl
hash start withql_
. Anybody with a lot of compute time to burn? :)