Skip to content

revert: move SSE to devtools RPC#317

Merged
huang-julien merged 1 commit intomainfrom
revert-314-refactor/migrateRPC
Apr 4, 2026
Merged

revert: move SSE to devtools RPC#317
huang-julien merged 1 commit intomainfrom
revert-314-refactor/migrateRPC

Conversation

@huang-julien
Copy link
Copy Markdown
Member

Merged to early, RPC broken

@huang-julien huang-julien changed the title Revert "refactor: move SSE to devtools RPC" revert: move SSE to devtools RPC Apr 4, 2026
@huang-julien huang-julien merged commit 86b47d2 into main Apr 4, 2026
4 of 5 checks passed
@huang-julien huang-julien deleted the revert-314-refactor/migrateRPC branch April 4, 2026 14:43
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 28ac7672-c4cf-4539-94f1-38d04ea0359d

📥 Commits

Reviewing files that changed from the base of the PR and between 225d2aa and 049ecca.

📒 Files selected for processing (20)
  • client/app/app.vue
  • client/app/plugins/0.sse.ts
  • client/app/plugins/html-validate.ts
  • client/app/plugins/hydration.ts
  • client/app/plugins/lazy-load.ts
  • client/app/utils/routes.ts
  • src/devtools.ts
  • src/module.ts
  • src/runtime/core/rpc-types.ts
  • src/runtime/core/server/rpc-bridge.ts
  • src/runtime/core/server/sse.ts
  • src/runtime/core/server/types.ts
  • src/runtime/html-validate/handlers/nitro-handlers.plugin.ts
  • src/runtime/hydration/nitro.plugin.ts
  • src/runtime/hydration/types.ts
  • src/runtime/hydration/utils.ts
  • src/runtime/lazy-load/nitro.plugin.ts
  • src/runtime/types.d.ts
  • test/unit/core/rpc-bridge.test.ts
  • test/unit/core/sse.test.ts

📝 Walkthrough

Walkthrough

This pull request replaces the RPC-based devtools communication mechanism with a Server-Sent Events (SSE) architecture. The changes remove RPC bridge infrastructure (rpc-bridge.ts, RPC type definitions, and RPC initialization in devtools) and introduce a new SSE endpoint that broadcasts hydration mismatches, lazy-load reports, and HTML validation reports to connected clients. Client-side plugins are refactored to listen for SSE events instead of registering RPC callbacks, and server-side plugins are updated to emit events to the SSE stream via a new hints:sse:setup Nitro hook. Tests for RPC bridging are removed and replaced with SSE endpoint tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

The changes involve a significant architectural shift from bidirectional RPC to unidirectional SSE streaming. The review requires understanding: the removal of the old RPC pattern (rpc-bridge, type definitions, app.vue integration), the new SSE endpoint and hook system, three separate client-side SSE listeners with event parsing logic, type-safe server-side hook integration across multiple features (hydration, lazy-load, html-validate), and verification that all consumer plugins correctly subscribe to the corresponding SSE events. The heterogeneous nature—spanning client plugins, server handlers, type definitions, and test replacements—combined with logic density around event streaming and hook registration creates moderate-to-high cognitive load.

✨ 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 revert-314-refactor/migrateRPC

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 and usage tips.

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