Performance: Hybrid applications
MEDIUM IMPACT
Hybrid applications impact initial load speed and runtime responsiveness by combining server-side and client-side rendering.
import { Controller, Get, Render } from '@nestjs/common'; @Controller() export class AppController { @Get() @Render('index') root() { return { message: 'Hello from server' }; } } // Client-side JS is code-split and lazy-loaded only when needed
import { Controller, Get, Render } from '@nestjs/common'; @Controller() export class AppController { @Get() @Render('index') root() { return { message: 'Hello from server' }; } } // Heavy client-side JS bundle loaded without code splitting
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Server-side render only | Minimal DOM nodes initially | 1 reflow on initial load | Low paint cost | [OK] Good |
| Hybrid with large JS bundle | Many DOM nodes hydrated | Multiple reflows during hydration | High paint cost due to JS execution | [X] Bad |
| Hybrid with code splitting | DOM nodes hydrated progressively | Single reflow per chunk | Moderate paint cost | [!] OK |