Simplify jqhtml class registration to use Manifest at runtime

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-07 18:30:49 +00:00
parent 12e676f317
commit 0894c33d3f
2 changed files with 15 additions and 94 deletions

View File

@@ -98,12 +98,26 @@ class Jqhtml_Integration {
// Data Cache Mode (jqhtml 2.x):
// - Enforces hot/cold cache parity - fresh data and cached data behave identically
// - Any ES6 class instance stored in this.data must be registered with jqhtml
// - Class registration is done by BundleCompiler via register_cache_class()
// - Without registration, class instances become plain objects on cache restore
// (properties preserved but prototype methods lost)
// ─────────────────────────────────────────────────────────────────────
jqhtml.set_cache_key(Rsx.scope_key(), 'data');
window.jqhtml.debug.verbose = false;
// ─────────────────────────────────────────────────────────────────────
// Register All Classes with jqhtml for Cache Serialization
//
// Loop through all classes already registered with Manifest and register
// them with jqhtml. This enables proper serialization of class instances
// stored in this.data during data caching.
// ─────────────────────────────────────────────────────────────────────
if (typeof jqhtml.register_cache_class === 'function') {
const all_classes = Manifest.get_all_classes();
for (const class_info of all_classes) {
jqhtml.register_cache_class(class_info.class_object);
}
console_debug('JQHTML_INIT', `Registered ${all_classes.length} classes for cache serialization`);
}
}
/**