mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Implement deserialization functions to restore module metadata from binary cache format. This completes the second phase of the ESM bytecode caching feature. Changes: - Add deserializeCachedModuleMetadata() in ZigSourceProvider.cpp - Reads BMES binary format - Extracts requested modules, imports, exports, star exports - Returns DeserializedModuleMetadata structure with bytecode pointer - Add validateCachedModuleMetadata() for cache validation - Checks magic number (0x424D4553 "BMES") - Checks version compatibility (currently v1) - Add Zig binding validateMetadata() in CachedBytecode.zig - Create test-cache-roundtrip.js for round-trip testing - Update documentation with progress Implementation status: - Phase 1 (Serialization): 100% ✅ - Phase 2 (Deserialization): 90% ✅ - Phase 3 (Integration): 0% ⏳ Next steps: - JSModuleRecord reconstruction from metadata - ModuleLoader integration - Cache storage implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6 lines
126 B
JavaScript
6 lines
126 B
JavaScript
// Test library for ESM cache
|
|
export const greeting = "Hello from cached ESM!";
|
|
export function add(a, b) {
|
|
return a + b;
|
|
}
|