Repository navigation
Fix route resolution and coherent development builds - #149
Conversation
Resolve aliased route imports through Rspack, evaluate paired Node edits, remove precommit CSS reloads, and emit versioned development browser manifests.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
Benchmark results
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d08c6755c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .getResolver('normal', {}) | ||
| .resolve({}, input.context, input.request, {}, (error, resolved) => { |
There was a problem hiding this comment.
Preserve dependency-specific resolver options
When a route imports a bare specifier under resolve.byDependency rules (for example, an esm.alias that differs from the global alias), this generic resolver can select a different file from the resolver that NormalModuleFactory would use for the actual dependency. If the generic result is a registered route, the subsequent mutation forces the import to that incorrect route; if only the dependency-specific result is a route, it remains untagged and bypasses client export pruning. Create the probe resolver with data.dependencyType and retain the original resolution context so it matches the real import resolution.
Useful? React with 👍 / 👎.
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Fixes #145, #146, #147, and #148.
Route imports now use Rspack’s actual resolved resource before choosing the client or server route transform. This preserves dependency-specific aliases, conditional package imports, extension priority, directory indexes, TypeScript paths, and symlinked route files. Queryless and explicitly tagged routes share one transform registration so importing a route twice does not duplicate its module state. RSC uses the native issuer layer to distinguish SSR client modules from server components; the old AST path guessing is removed.
Development changes now preserve a coherent server build and browser manifest:
manifest-<version>.jsasset. Previous versions remain available; native Weboutput.cleanis rejected during development. The obsolete virtual manifest entry, placeholder transform, and lazy-compilation exception are removed.Closed-issue audit and upstream comparison
Revisited #21, #24, #38, #78, #106, #124, #129, #130, #132, #133, #135, #136, and #139, tracing their implementation history and relevant adjacent behavior. #133 was closed as not planned after the reporter isolated external dependency paths; it is not presented as a plugin regression.
Additional reproduced bugs fixed:
?urlimports even when no extracted stylesheet existed. Use emitted compilation assets only.rootwas mistaken for an emitted container, splitting the application runtime and duplicating singleton state. Only nonemptyexposesdeclares a container.Cross-checked installed
@react-router/dev8.3.1 and the upstream Vite plugin, style collection, and RSC plugin. Vite owns root resolution, uses module IDs/queries for route chunks, and ignores URL/raw/inline CSS for style injection. The installed Vite implementation retains redirect-body, HTML-context escaping, and RSC basename limitations; regression tests define the corrected behavior here. Federation fixes were verified against native Rspack compilation and runtime identity because those mechanics are compiler-specific.Additional cache and configuration pass
buildInfoand restore it from every Web compilation, preserving normal caching and loader order. The regression covers cold, warm, and changed-export builds.rootID could overwrite the framework root and leave a self-parented route graph. Validate effective IDs, including inferred IDs, and reject non-string IDs..mjs, extensionless JS, and forced shared/runtime chunks, or for warm/Node-only builds changing server options and route partitions with unchanged browser assets.Verification
pnpm test: all workspace typechecks and 835 tests passed.pnpm build, source formatting, and diff checks passed..serverimports still fail.Versioned manifests preserve their own bytes and separately named assets; existing development JavaScript with unhashed filenames remains subject to normal HMR replacement.