Skip to content

fix(qwik-vite): keep reachable deps when reducing cyclic bundle graphs - #8907

Merged
maiieul merged 2 commits into
mainfrom
fix/bundle-graph-cyclic-deps
Aug 5, 2026
Merged

fix(qwik-vite): keep reachable deps when reducing cyclic bundle graphs#8907
maiieul merged 2 commits into
mainfrom
fix/bundle-graph-cyclic-deps

Conversation

@maiieul

@maiieul maiieul commented Aug 3, 2026

Copy link
Copy Markdown
Member

What is it?

  • Bug

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 main and pass here. Split out of #8785 so it can land on its own.

@maiieul
maiieul requested a review from a team as a code owner August 3, 2026 15:24
@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 764fdd7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@qwik.dev/core Patch
eslint-plugin-qwik Patch
@qwik.dev/react Patch
@qwik.dev/router Patch
create-qwik Patch

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

@maiieul maiieul self-assigned this Aug 3, 2026
@maiieul maiieul moved this from Backlog to Waiting For Review in Qwik Development Aug 3, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8907

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8907

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8907

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8907

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8907

@qwik.dev/devtools

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/devtools@8907

commit: 764fdd7

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

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

maiieul added 2 commits August 4, 2026 06:02
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
maiieul force-pushed the fix/bundle-graph-cyclic-deps branch from 2598e01 to 764fdd7 Compare August 4, 2026 04:02
@maiieul
maiieul enabled auto-merge August 4, 2026 04:15
@maiieul
maiieul merged commit 48d860c into main Aug 5, 2026
48 checks passed
@maiieul
maiieul deleted the fix/bundle-graph-cyclic-deps branch August 5, 2026 13:20
@github-project-automation github-project-automation Bot moved this from Waiting For Review to Done in Qwik Development Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants