Repository navigation
Stop builds from hanging on mutually interpolated class names - #102
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
3 tasks done
To resolve a class name imported from another module, a module's transform waits for `this.load()` of that module, which runs its transform. When two modules interpolate each other's class names, each transform waited for the other to finish, and the build never completed. Track which module each running transform is waiting for, and skip loading a module whose transform is already waiting for the current one, directly or through other transforms. Its transform has parsed it before resolving anything, so its exported values are read from the cache. Only loads that would close a cycle are skipped, so concurrent transforms still wait for each other and register their stylesheets as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nstepien
force-pushed
the
fix-cyclic-interpolation-hang
branch
from
October 15, 2026 17:40
f4740c2 to
3cdc545
Compare
- Use descendant selectors in the cycle fixtures. TypeScript still needs the `: string` annotations, as each class name's type depends on the other's. - Walk the pending loads recursively, which needs no type annotation. - Note why buildEnd leaves pendingLoads alone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nstepien
added a commit
that referenced
this pull request
Oct 16, 2026
#102 changed the CSS of the cycle fixtures, and with it their stylesheet IDs. Merging its branch into this one updated this snapshot, but GitHub restacked this branch onto the squash-merged #102 by replaying only its own commit, which dropped that merge. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nstepien
added a commit
that referenced
this pull request
Oct 17, 2026
main took in the first slice of this PR (#79) and solved several of its other problems differently since August, so the merge ports the rest of this branch onto main's design instead of keeping both: - Values, class names included, come from the parse of each module, and const initializers resolve lazily (#79). Re-exports, `export *`, default and namespace imports, and `export default` resolve through the same evaluator, with ESM precedence and ambiguity. - Cycles are handled by main's pendingLoads and isWaitingFor (#102), so the wait graph, the deferred same-file passes, and the import-last ordering are gone, along with the guard against inlining the class names of skipped templates, which needed the imported modules' transforms. - Class names are IIFEs (#87, #98), so `moduleSideEffects: true` is gone. - Vite's dev server keeps main's behavior (#104) and does not transform imported modules through transformRequest. There, the code of modules that no file holds comes from their `load` hooks. - UNREADABLE_MODULE and UNPARSEABLE_MODULE are gone: a module whose code cannot be read exports nothing, and modules are parsed as the language Rolldown assigned them. - Kept: raw TypeScript bindings, `meta.moduleType` parsing, prologue-safe imports, query-variant module identity, skipping external modules, and resolving each import once per transform. Tests: main's suite, plus this branch's tests of the kept features, with new cases for the paths that no fixture reached. The tests of the removed behavior, and the cycle test that main already has, are dropped. basic.input.ts is restored for main's inlineConst tests, and this branch's barrel.ts is now barrel-index.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
To resolve a class name imported from another module, a module's transform waits for
this.load()of that module, which runs that module's transform. When two modules interpolate each other's class names, each transform waited for the other to finish, and the build never completed.Changes
pendingLoads), and skip loading a module whose transform is already waiting for the current one, directly or through other transforms (isWaitingFor). That module's transform parsed it before resolving anything, so its exported values come from the cache.Tests
cycle-a.tsandcycle-b.ts, whose CSS interpolates each other's class names. A Vite build of them timed out before this change and now completes with both rules.sideEffects: false.Test plan
node --run format:check,lint,typecheck,buildnode --run test: 16/16 against the source and against the builtdist(CI=true)🤖 Generated with Claude Code