Repository navigation
v0.2.0 - Multiple Hydration Passes
What's Changed
✨ New Features
- Multiple Hydration Passes: Test setup stages can now call
preparePageForHydrationmultiple times before navigation- Each call accumulates data instead of overwriting
- Isolated test stages don't need to know about each other
- Later hydrations overwrite earlier ones for the same section (last write wins)
- All errors are aggregated into a single result
🔧 Implementation Details
preparePageForHydrationnow stores blobs in an array (window.__HYDRATION_BLOBS__)bootstrapHydrationprocesses all blobs sequentially (oldest to newest)- Results are aggregated where
overallSuccessis true only if ALL hydrations succeed - Backward compatible - single blob usage still works
📚 Example Usage
// Test setup stage 1 - User profile
await preparePageForHydration(page, {
userProfile: { name: 'Test User', email: 'test@example.com' }
});
// Test setup stage 2 - Settings (isolated from stage 1)
await preparePageForHydration(page, {
settings: { theme: 'dark', notifications: true }
});
// Navigate - both hydrations will be applied
await page.goto('/');
const result = await getHydrationResult(page);
// result.sections will contain both userProfile and settings🧪 Testing
- Added comprehensive integration tests for multiple hydration scenarios
- Updated all unit tests to match new implementation
- All existing tests continue to pass
Full Changelog: v0.1.0...v0.2.0