fix(qwik-vite): keep reachable deps when reducing cyclic bundle graphs - #8907
Merged
Conversation
🦋 Changeset detectedLatest commit: 764fdd7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
@qwik.dev/core
@qwik.dev/router
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
@qwik.dev/devtools
commit: |
Contributor
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
A per-dep walk reached back through an import cycle and deleted deps from their own parent's set, collapsing those dep sets to empty so the preloader never learned about them. Reduce over the SCC condensation instead, which is a DAG, and always keep intra-component deps.
computeTotals had its own copy of the same Tarjan implementation.
maiieul
force-pushed
the
fix/bundle-graph-cyclic-deps
branch
from
August 4, 2026 04:02
2598e01 to
764fdd7
Compare
maiieul
enabled auto-merge
August 4, 2026 04:15
Varixo
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is it?
Description
When a bundle's imports form a cycle, the preload graph dropped deps it should have kept. The old
reduction walked out from each dep, came back around the cycle, and deleted that dep from its own
parent's set — so cyclic bundles could end up with an empty dep list and never get preloaded.
Reducing over the SCC condensation instead makes it a DAG problem, and intra-component deps are
always kept so each cycle stays connected. Output is unchanged for acyclic graphs (the existing
snapshot doesn't move).
Both new tests fail on
mainand pass here. Split out of #8785 so it can land on its own.