Skip to content

[codex] Improve frontend lazy-loading boundaries - #194

Merged
adrev merged 1 commit into
mainfrom
codex/frontend-lazy-boundaries
Aug 5, 2026
Merged

[codex] Improve frontend lazy-loading boundaries#194
adrev merged 1 commit into
mainfrom
codex/frontend-lazy-boundaries

Conversation

@adrev

@adrev adrev commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • move the handout queue out of the React component so socket listeners no longer eagerly import the lazy modal
  • replace the render-time global callback with a tested useSyncExternalStore subscription
  • preserve dice-box renderer-level dynamic imports instead of collapsing every renderer into one 4.3 MB chunk
  • update the agent contract to use Fable's current name and signatures

Verification

  • Node 24.19.0
  • 144 test files / 1766 tests passed
  • lint: 0 warnings
  • shared/client/server production builds passed
  • npm audit: 0 vulnerabilities
  • git diff --check clean

Bundle result

  • HandoutModal is now a real 2.19 kB lazy chunk; the ineffective dynamic-import warning is gone
  • dice entry is 380 kB and renderer chunks remain independently lazy instead of one 4.3 MB vendor chunk
  • Rollup still reports the optional 2.89 MB offscreen renderer against the global 700 kB warning threshold; it is no longer bundled with unused on-screen/fallback renderers

Summary by CodeRabbit

  • New Features

    • Added centralized handout handling so incoming handouts are queued and displayed in order.
    • Handouts now support titles, content, optional images, and direct-message indicators.
    • Improved handout dismissal behavior and updates while multiple handouts are pending.
  • Bug Fixes

    • Improved loading of 3D renderer components by preserving dynamic loading, helping prevent oversized bundles and smoother startup.

Co-Authored-By: CodeX <codex@openai.com>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f035a49c-6ce5-4c12-bba8-d7fe177364c4

📥 Commits

Reviewing files that changed from the base of the PR and between 9abbee0 and 23c884b.

📒 Files selected for processing (6)
  • AGENTS.md
  • client/src/components/session/HandoutModal.tsx
  • client/src/socket/listeners.ts
  • client/src/stores/handoutQueue.test.ts
  • client/src/stores/handoutQueue.ts
  • client/vite.config.ts

📝 Walkthrough

Walkthrough

The change adds a shared handout queue, connects socket events and modal rendering to it, preserves separate renderer imports in Vite, and renames the local executor from Claude to Fable in coordination guidance.

Changes

Shared handout queue

Layer / File(s) Summary
Handout queue store and tests
client/src/stores/handoutQueue.ts, client/src/stores/handoutQueue.test.ts
The new store manages typed FIFO handouts, subscriptions, dismissal, and test resets. Tests cover queue ordering and notifications.
Socket and modal integration
client/src/socket/listeners.ts, client/src/components/session/HandoutModal.tsx
Socket events enqueue handouts through the store. The modal reads the external queue and uses shared dismissal.

Vite renderer chunking

Layer / File(s) Summary
Dynamic renderer chunk preservation
client/vite.config.ts
Manual chunking no longer assigns dice and Babylon.js modules to vendor-dice, preserving their dynamic imports.

Fable coordination guidance

Layer / File(s) Summary
Executor naming and ownership rules
AGENTS.md
Coordination guidance renames Claude to Fable across roles, ownership, queueing, review, and deployment rules.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SocketListeners
  participant HandoutQueue
  participant HandoutModal
  participant User
  SocketListeners->>HandoutQueue: pushHandout(payload)
  HandoutQueue-->>HandoutModal: notify subscribed listener
  HandoutModal->>HandoutQueue: getHandoutQueue()
  User->>HandoutModal: dismiss handout
  HandoutModal->>HandoutQueue: dismissHandout()
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/frontend-lazy-boundaries

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.

@adrev
adrev merged commit 9ee08fd into main Aug 5, 2026
1 of 2 checks passed
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