DEV Community

mage0535
mage0535

Posted on • Originally published at hermes-agent.nousresearch.com

hermes-memory-installer Fix: Loading Memory Sidecar Modules from Runtime Scripts

Hermes, the JavaScript engine powering React Native, relies on precompiled bytecode bundles to achieve its performance. The hermes-memory-installer project extends this model by allowing you to install memory sidecar modules—bytecode segments that live directly in memory, ready for zero-delay access. A recent fix makes these sidecar modules finally accessible from runtime scripts, addressing a long-standing gap in dynamic code loading.

Before the fix, sidecar modules were strictly static: you declared them at installation time (often alongside the initial bundle), and the installer loaded them into memory immediately. This worked for predetermined code splits, but any request that originated from a script executed at runtime—such as a user-triggered import, a route-based lazy load, or a require() inside a callback—was not resolved from the sidecar. Those modules fell through to the standard Hermes bytecode compilation path, defeating the purpose of memory-sidecar optimization.

The fix realigns the loading logic: when a runtime script triggers a module resolution, the installer now checks for a matching sidecar identifier. If found, it serves the bytecode directly from the memory region instead of relying on file system reads or on-the

Top comments (0)