Skip to content

feat: expose guarded lazy compilation option#66

Merged
ScriptedAlchemy merged 6 commits into
mainfrom
codex/lazy-compilation-option
Jun 29, 2026
Merged

feat: expose guarded lazy compilation option#66
ScriptedAlchemy merged 6 commits into
mainfrom
codex/lazy-compilation-option

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Collaborator

Summary\n- add a plugin lazyCompilation option that forwards to Rsbuild dev lazy compilation\n- guard React Router hydration-critical modules so browser manifest and route modules stay eager\n- also guard direct dev.lazyCompilation config when the plugin is installed\n\n## Verification\n- pnpm test:core tests/lazy-compilation.test.ts tests/index.test.ts\n- pnpm build

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ScriptedAlchemy, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 27 minutes and 43 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e92e657-655d-496e-a28b-e3bb8f961399

📥 Commits

Reviewing files that changed from the base of the PR and between c3afcde and 151404d.

📒 Files selected for processing (4)
  • src/index.ts
  • src/lazy-compilation.ts
  • tests/index.test.ts
  • tests/lazy-compilation.test.ts
📝 Walkthrough

Walkthrough

A new lazyCompilation option is added to PluginOptions, typed from RsbuildConfig['dev']['lazyCompilation']. A new guardReactRouterLazyCompilation helper in src/lazy-compilation.ts normalizes this option: it passes through undefined/false unchanged, expands true to { entries: true, imports: true }, and overrides the test predicate to return false for React Router hydration-critical modules (entry client path, virtual manifests, specific query strings) while preserving any user-defined test function or RegExp for all other modules. In src/index.ts, the plugin now computes a guarded lazy-compilation value from either plugin options or the existing Rsbuild dev config and spreads it into the dev configuration. Tests cover all input shapes and hydration-module exclusion behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a guarded lazy compilation option for the plugin.
Description check ✅ Passed The description is directly related to the changes and accurately summarizes the feature and verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/lazy-compilation-option

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jun 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/rsbuild-plugin-react-router@151404d

commit: 151404d

@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

Compared PR head 151404d against base 61f451e.

Total median wall time: 16.85s -> 16.60s (-1.5%, 1.01x speedup)
Compiler ready median: 14.58s -> 14.57s (-0.1%)
Route load median: 1.94s -> 1.92s (-1.2%)

Benchmark Base total Head total Delta Head ready Head routes Speedup Head RSS p95
large-355-ssr-esm 16.85s 16.60s -1.5% 14.57s 1.92s 1.01x -

Profile: large; mode: dev; iterations: 3; warmup: 0.
Workflow run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a061c6ce0b

ℹ️ 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".

Comment thread src/lazy-compilation.ts Outdated
@ScriptedAlchemy ScriptedAlchemy merged commit 31e5bf5 into main Jun 29, 2026
7 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the codex/lazy-compilation-option branch June 29, 2026 00:02
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.

1 participant