Skip to content

Commit 494cda7

Browse files
committed
address review: clarify hmrClientEntry is a presence marker, not a path
Reword JSDoc and inline comment to make it explicit that only the presence of hmrClientEntry matters — the value itself is not read by any consumer, so assigning clientEntry to it is intentional marker semantics, not a real path reference.
1 parent 6b6da69 commit 494cda7

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

packages/fresh/src/build_cache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export interface BuildSnapshot<State> {
1818
version: string;
1919
clientEntry: string;
2020
/**
21-
* Pathname for an HMR-only client entry. When defined, the SSR runtime
22-
* always emits the boot script so HMR listeners attach to pages that
23-
* have no islands. Undefined outside of dev.
21+
* When defined, forces the boot script to be emitted in dev so HMR
22+
* listeners attach even on island-free pages. The value itself is
23+
* currently unused — only its presence matters. Undefined outside of dev.
2424
*/
2525
hmrClientEntry?: string;
2626
fsRoutes: FsRouteFile<State>[];

packages/plugin-vite/src/plugins/server_snapshot.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,12 @@ export function serverSnapshot(options: ResolvedFreshViteConfig): Plugin[] {
170170
const entryAssets: string[] = [];
171171

172172
if (isDev && server !== undefined) {
173-
// The client entry hosts the HMR listener. Set hmrClientEntry so
174-
// the SSR runtime always emits a boot script in dev, even when
175-
// a page has zero islands. Without this, edits to islands-free
176-
// routes never trigger a browser reload because the
177-
// `fresh:reload` WebSocket listener is never attached.
173+
// Set hmrClientEntry so the SSR runtime always emits a boot script
174+
// in dev, even when a page has zero islands. Without this, edits
175+
// to island-free routes never trigger a browser reload because the
176+
// `fresh:reload` WebSocket listener is never attached. The value
177+
// is used as a marker only — its presence is what matters, not
178+
// what it points to.
178179
hmrClientEntry = clientEntry;
179180

180181
for (const id of islands.keys()) {

0 commit comments

Comments
 (0)