Skip to content

fix: reject circular CSS module imports - #176

Open
wozhenbang2004 wants to merge 3 commits into
madyankin:masterfrom
wozhenbang2004:fix/circular-imports-175
Open

wozhenbang2004 wants to merge 3 commits into
madyankin:masterfrom
wozhenbang2004:fix/circular-imports-175

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Fixes #175.

Circular composes and @value imports now reject with the dependency chain, for example Circular dependency: .../b.css -> .../a.css -> .../b.css, instead of repeatedly loading the same files. Each branch carries its own ancestry, so parallel branches can still share dependencies.

Added regressions for both import syntaxes, self-imports, nested cycles, diamond dependencies and concurrent entry points. The four circular cases time out on master at the five-second limit; all six cases pass with the fix.

make lint compile USE_DOCKER=0, npm exec -- jest --runInBand (105 tests, 35 snapshots), and formatting checks pass on Node 24.22.3 / Linux. Also checked the built package with real files for resolver aliases, reuse after a failed render, cached imports and longer acyclic chains. Windows was not run.

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.

Circular composes/@value imports recurse until the process runs out of memory

1 participant