mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This implements the remainder of functionality needed for Server HMR (Fast Refresh). How It Works - Turbopack detects file changes in RSC modules - Rust sends HMR update payloads to the Node.js runtime via the existing chunk update system - A Node-specific HMR client evaluates changed modules using shared HMR runtime logic (extracted earlier in this stack) - Only modified modules are re-evaluated. Unmodified modules retain their state - Next.js hot-reloader forwards updates to RSC workers, triggering automatic re-renders in clients Test Plan: Added an e2e test confirming that unaffected modules don't get re-evaluated when others change.
14 lines
346 B
TypeScript
14 lines
346 B
TypeScript
import { evaluatedAt } from '../unmodified-module'
|
|
|
|
const pageLoadId = Math.random().toString(36).slice(2)
|
|
|
|
export default function Page() {
|
|
return (
|
|
<div>
|
|
<p id="greeting">hello world</p>
|
|
<p id="page-load-id">Page Load ID: {pageLoadId}</p>
|
|
<p id="module-eval-time">Module Evaluated At: {evaluatedAt}</p>
|
|
</div>
|
|
)
|
|
}
|