Repository navigation
Conversation
Co-authored-by: edemaine <edemaine@mit.edu> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Shared unescaping and load hooks src/utils/webpack-like.ts, src/webpack/loaders/load.ts, src/rspack/loaders/load.ts |
Adds bundler-specific resource path unescaping and applies it to non-virtual IDs passed to the load hooks. Virtual IDs retain their existing decoding behavior. |
Transform IDs and integration tests src/webpack/loaders/transform.ts, src/rspack/loaders/transform.ts, test/unit-tests/escaped-path/escaped-path.test.ts |
Uses normalized IDs for transform filters, handlers, and source-map merging. Tests check hash-containing paths, virtual IDs, and the utility’s bundler-specific behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
- unjs/unplugin#608: Wires the Rspack loaders into the Rsbuild integration, which uses the loaders changed here.
- unjs/unplugin#626: Changes the same webpack and Rspack transform loaders and their source-map handling.
Suggested reviewers: sxzz, boluwatifeajayi
Merge Risk: 
Minimal · previous review 3b0c4
-
The change unescapes webpack and rspack resource paths before they reach load and transform hooks, so paths containing characters like
#can be read correctly. No concrete defect was identified in the reviewed changes, and the added tests cover both bundlers and the escape helper. Merge risk is minimal.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue
#591requires usable, unescaped paths in webpack and rspackloadandtransformhooks. The loaders callunescapeResourcePathwith the correct bundler.loadpreserves virtual module decoding and leading\0IDs.transformuses the unescaped ID for filtering, the hook argument, and source-map merging. The new tests run webpack and rspack builds withmsg#hash.js, verify both hooks receive the real path, verify the virtual\0ID, and test both escape characters.
-
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
commit: |
Fixes #591. Replaces #592.
Webpack escapes special characters in a resource path with a
\0prefix (msg#hash.jsbecomesmsg\0#hash.js), and rspack does the same with a zero-width space (\u200B).loadandtransformreceived these escaped paths.unescapeResourcePath(path, framework)and use it in the webpack and rspackloadandtransformloaders#load, unescape real paths only. Virtual module ids are decoded as before, because ids such as\0virtual:foo(Rollup convention) must keep their leading\0msg#hash.jsfile and a\0-prefixed virtual id, plus unit tests for the helperBuilds on #592 by @edemaine and keeps its approach; rebased on current
mainwith a smaller test instead of a fixture per bundler.Not changed: for virtual modules,
transformstill receives the encoded virtual path (_virtual_%00...) rather than the decoded id thatloadgets.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests