Repository navigation
Do the plugin's work in fewer passes - #114
Merged
Merged
Conversation
- `extractCssFromCode` replaces each template and appends its CSS as soon as its interpolations resolve, instead of collecting the extractions and walking them twice. The magic string is still only created for the first extraction. - `transform` builds its import statements as one string instead of joining an array. - Map lookups that called `has()` before `get()` now call `get()` once. - `hotUpdate` returns early when no CSS depends on the edited module, so Vite keeps its own list of modules instead of receiving a copy that it has to reconcile. A new dev server test edits a module that nothing interpolates, which covers that path. The build output is unchanged, and no snapshots changed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
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 |
nstepien
added a commit
that referenced
this pull request
Nov 4, 2026
main reshaped the code this branch builds on since the last merge, so the merge ports the branch onto main's design again: - The scope visitor is shared across parses (#109), so the callbacks for raw TypeScript bindings and `export default` join it, and the default export is recorded through its visit state. - Imported modules are resolved, loaded, and parsed once per transform through main's loadImportedModule (#124), which now also skips external modules, keys modules by moduleKey, and records dependencies by file. - Modules are parsed as the language the bundler assigned them through main's parseLangOf (#125), which this branch had too. - extractCssFromCode keeps main's single pass (#114), and hotUpdate its early return, with this branch's handling of query variants. - readModuleCode moved to module level, as consistent-function-scoping is on since #109. Tests: the inline snapshots of this branch's tests follow Rolldown's new module comments (`// path` instead of `//#region path` and `//#endregion`), with no other change. The dev server test of virtual modules uses main's shared getCode and getStylesheets helpers. 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.
extractCssFromCodereplaces each template and appends its CSS as soon as its interpolations resolve, instead of collecting the extractions and walking them twice. The magic string is still only created for the first extraction.transformbuilds its import statements as one string instead of joining an array.has()beforeget()now callget()once.hotUpdatereturns early when no CSS depends on the edited module. Vite treats a missing return value as "unchanged", so it keeps its own list of modules instead of receiving a copy that it has to reconcile with the list it keeps forhandleHotUpdateplugins. A new dev server test edits a module that nothing interpolates, which covers that path. ThegetCodeandgetStylesheetshelpers moved to module level so both dev server tests share them.The build output is unchanged, and no snapshots changed.
🤖 Generated with Claude Code