TYPESCRIPT · ASTRO PERFORMANCE
GitHub ↗
astro-dev-island-hydration-advisor — Astro Island Hydration Profiler & Optimizer
astro-dev-island-hydration-advisor inspects every hydrated component on an Astro page to flag eager client:load islands that sit below the viewport fold. It measures JavaScript bundle weight per island and recommends switching to client:visible, client:idle, or static rendering to cut Total Blocking Time.
$ npm install -D astro-dev-island-hydration-advisor
01. Architectural Specifications
STATUS: PRODUCTION READY
[ 01 // CAPABILITY ]
Viewport Fold Analysis
Visually maps the initial viewport fold line and checks all island bounding coordinates.
[ 02 // CAPABILITY ]
Eager Hydration Flagging
Detects client:load on components below the fold and quantifies TBT/INP performance penalties.
[ 03 // CAPABILITY ]
Nano Strategy Advisor
Prompts Gemini Nano to formulate component-specific recommendations (client:visible, client:idle).
02. Implementation & Usage
BUN / ASTRO 5+
// Installation
CLI
bun add astro-dev-island-hydration-advisor
# or
pnpm add astro-dev-island-hydration-advisor
// Configuration
astro.config.mjs
// astro.config.mjs
import { defineConfig } from "astro/config";
import devIslandAdvisor from "astro-dev-island-hydration-advisor";
export default defineConfig({
integrations: [
devIslandAdvisor({
foldThresholdPx: 100,
highlightEagerIslands: true
})
]
});
// Chrome Built-in AI Prerequisites
- 1. Open
chrome://flagsin Google Chrome 128+ - 2. Set
#prompt-api-for-gemini-nanoto Enabled - 3. Set
#optimization-guide-on-device-modelto Enabled ByPassPerfRequirement - 4. Restart Chrome and verify model status at
chrome://components