@@ -5,22 +5,52 @@ import { findPhraseTime, type WhisperOutput } from '../../whisper-types';
55import type { RSCKeyframeTriggers } from '../types' ;
66
77// Expert-level trigger phrases from approved script
8+ // TIMING NOTES (from whisper):
9+ // - "client requests a route" at 7.32s - request starts
10+ // - "server begins rendering immediately" at 9.5s - server lights up (after 1s travel)
11+ // - "doesn't wait for the slowest data dependency" at 13.5s
12+ // - "server streams React Flight" at 19.82s - streaming begins
13+ // - "First, you get the shell" at 32.74s - shell renders
14+ // - "Header, sidebar, welcome copy, footer" at 42.72s-45.76s
815const TRIGGER_CONFIG = {
9- requestStart : { phrase : "client requests a route" , fallback : 3.0 } ,
10- serverDoesntWait : { phrase : "doesn't wait for the slowest data dependency" , fallback : 8.0 } ,
11- startsStreaming : { phrase : "server streams React Flight" , fallback : 12.0 } ,
12- shellRenders : { phrase : "First you get the shell" , fallback : 18.0 } ,
13- headerRenders : { phrase : "Header," , fallback : 24.0 } ,
14- sidebarRenders : { phrase : "sidebar," , fallback : 25.0 } ,
15- welcomeRenders : { phrase : "welcome copy," , fallback : 26.0 } ,
16- footerRenders : { phrase : "footer." , fallback : 27.0 } ,
17- fastComponentsDone : { phrase : "incremental patch the client can reconcile" , fallback : 29.0 } ,
18- pageInteractive : { phrase : "interactivity can show up before the route is complete" , fallback : 35.0 } ,
19- suspenseBoundary : { phrase : "slow server subtrees sit behind Suspense boundaries" , fallback : 40.0 } ,
20- analyticsArrives : { phrase : "slow analytics call finally resolves" , fallback : 48.0 } ,
21- streamsIn : { phrase : "flushes the corresponding Flight chunk" , fallback : 52.0 } ,
22- fullyFunctional : { phrase : "progressive completion under real-world latency" , fallback : 58.0 } ,
23- conclusion : { phrase : "lower time to first content, earlier interaction" , fallback : 60.0 }
16+ // Request starts when narration says "client requests"
17+ requestStart : { phrase : "client requests a route" , fallback : 7.0 } ,
18+
19+ // Server lights up when "server begins rendering" (after request arrives)
20+ serverDoesntWait : { phrase : "server begins rendering" , fallback : 9.5 } ,
21+
22+ // Streaming starts when "server streams React Flight"
23+ startsStreaming : { phrase : "server streams React Flight" , fallback : 19.0 } ,
24+
25+ // Shell renders when "First, you get the shell"
26+ shellRenders : { phrase : "First, you get the shell" , fallback : 32.0 } ,
27+
28+ // Components stream in sequence - "Header, sidebar, welcome copy, footer"
29+ headerRenders : { phrase : "Header," , fallback : 42.5 } ,
30+ sidebarRenders : { phrase : "sidebar," , fallback : 43.5 } ,
31+ welcomeRenders : { phrase : "welcome copy," , fallback : 44.5 } ,
32+ footerRenders : { phrase : "footer." , fallback : 45.5 } ,
33+
34+ // Fast components done - "incremental patch"
35+ fastComponentsDone : { phrase : "incremental patch the client can reconcile" , fallback : 47.0 } ,
36+
37+ // Page becomes interactive - "interactivity can show up"
38+ pageInteractive : { phrase : "interactivity can show up" , fallback : 63.0 } ,
39+
40+ // Suspense boundary explanation
41+ suspenseBoundary : { phrase : "slow server subtrees sit behind suspense boundaries" , fallback : 68.0 } ,
42+
43+ // Analytics finally arrives - "slow analytics call finally resolves"
44+ analyticsArrives : { phrase : "slow analytics call finally resolves" , fallback : 80.0 } ,
45+
46+ // Heavy component streams in - "flushes the corresponding flight chunk"
47+ streamsIn : { phrase : "flushes the corresponding flight chunk" , fallback : 85.0 } ,
48+
49+ // Complete - "progressive completion"
50+ fullyFunctional : { phrase : "progressive completion" , fallback : 101.0 } ,
51+
52+ // Conclusion
53+ conclusion : { phrase : "Lower time to first content" , fallback : 97.0 }
2454} as const ;
2555
2656export function extractRSCKeyframeTriggers ( whisper : WhisperOutput ) : RSCKeyframeTriggers {
0 commit comments