Skip to content

fix(qwik): over-preloading of all non-node_modules dynamic imports #7549

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

maiieul
Copy link
Contributor

@maiieul maiieul commented Apr 28, 2025

What is it?

  • enhancement

Description

The over-preloading only happens after all the critical chunks have been preloaded so that doesn't really degrade the UX but:

  • with import.meta.globs on qwik-ui we go from 252 network requests (~800ms, 553kb transferred) to 1187 requests (~3000ms, 1.3MB transferred) -> Some providers charge per-request so that would mean a x5 difference.
  • More requests means more bandwidth/mobile-data used by the end-user.
  • The more requests or kb/mb transferred, the more new devs will assume qwik is slow.
  • the over-preloaded chunks don't seem to be ever needed anyways.

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset with pnpm change
  • I made corresponding changes to the Qwik docs
  • I added new tests to cover the fix / functionality

@maiieul maiieul requested a review from a team as a code owner April 28, 2025 12:08
Copy link

changeset-bot bot commented Apr 28, 2025

⚠️ No Changeset found

Latest commit: e685912

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@maiieul maiieul changed the title fix(vite): over-preloading of all non-node_modules dynamic imports fix(preloader): over-preloading of all non-node_modules dynamic imports Apr 28, 2025
@maiieul maiieul changed the title fix(preloader): over-preloading of all non-node_modules dynamic imports fix(qwik): over-preloading of all non-node_modules dynamic imports Apr 28, 2025
Copy link
Contributor

github-actions bot commented Apr 28, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview aa6f7f3

Copy link

pkg-pr-new bot commented Apr 28, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@builder.io/qwik@7549
npm i https://pkg.pr.new/@builder.io/qwik-city@7549
npm i https://pkg.pr.new/eslint-plugin-qwik@7549
npm i https://pkg.pr.new/create-qwik@7549

commit: e685912

@wmertens
Copy link
Member

This breaks the js prefetching of links. Go to https://maiieul-1-14-0-alpha-slight.qwik-8nx.pages.dev/ecosystem/ and look at the network tab. Every ecosystem will import a bunch of files when you click.
Without this PR, the js files are prefetched on hover.

@maiieul maiieul marked this pull request as draft April 29, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants