Repository navigation
Support Node.js embedder objects and bindings in the snapshot #37476
Description
Activity
I'll be looking into the ones in
module_wrap.handnode_contextify.hso that we can include the user modules in the snapshot. Also we need a better story for fast API objects likeFastHrtimethough right now we don't use fast API much in core so it's low priority.Reacted by Khaidi Chucc @nodejs/startup
ModuleWrap is blocked on v8:10855
cc @nodejs/startup
So we have to do some division of labor?
So we have to do some division of labor?
@XadillaX Just a FYI and to avoid stepping on each other's toes :) I suppose the majority of the list should be crossed out as invalid so there isn't actually that much work to do. Maybe it would be good to have a call about the list to figure out what should be excluded, or maybe discussing in the thread is already enough.
Maybe a good place to start is to document (that is, adding comments about) exactly what these classes are and what their fields are for.
- added a commit that references this issue
on Apr 8, 2021 - addedc++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.snapshotIssues and PRs related to the startup snapshot.Issues and PRs related to the startup snapshot.
on Aug 9, 2021 @joyeecheung the OP probably needs an update.
Fwiw, Blob objects likely should not be serialized. They should not live beyond the process in which they were created.
Reacted by Joyee Cheung- changed the title
[-]Support (de)serialization of Node.js embedder objects in the snapshot[/-][+]Support Node.js embedder objects and bindings in the snapshot[/+]on Sep 9, 2021 - added 2 commits that reference this issue
on Oct 19, 2021 - added a commit that references this issue
on Oct 23, 2021 32 remaining items
- added 2 commits that reference this issue
on Oct 14, 2022 - added 2 commits that reference this issue
on Nov 1, 2022 - added 2 commits that reference this issue
on Nov 4, 2022 - added 2 commits that reference this issue
on Jan 3, 2023 github-actions commented
on Jun 27, 2026 on Jun 27, 2026 – with GitHub ActionsContributorMore actionsThis issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jun 27, 2026 github-actions commented
on Jul 28, 2026 on Jul 28, 2026 – with GitHub ActionsContributorMore actionsThis issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
Here is a list of embedder object classes we have in core. In order to make userland snapshot possible (#35711) we should support as many as possible of them.
Some of them can't simply be deserialized - for example, the
HandleWraps, because theoretically we can't resurrect auv_handle_tfrom a snapshot, at best we can restore them by creating new ones, but that involves more work (which is system-specific) than "just deserialize the object". Some of them may be helper singletons that we can just throw away at serialization time and recreate upon deserialization, and some of them may not be supposed to be supported.class HistogramBase : public BaseObject: src/histogram.hclass ModuleWrap : public BaseObject: src/module_wrap.hclass Blob : public BaseObject: src/node_blob.hclass BlobBindingData : public BaseObject: src/node_blob.hclass MicrotaskQueueWrap : public BaseObject: src/node_contextify.hclass ContextifyScript : public BaseObject: src/node_contextify.hclass CompiledFnEntry final : public BaseObject: src/node_contextify.hclass BindingData : public BaseObject: src/node_http_parser.ccclass ConverterObject : public BaseObject: src/node_i18n.hclass JSTransferable : public BaseObject: src/node_messaging.hclass FastHrtime : public BaseObject: src/node_process_methods.cc (WIP at bootstrap: implement run-time user-land snapshots via --build-snapshot and --snapshot-blob #38905)class SerializerContext : public BaseObject: src/node_serdes.ccclass DeserializerContext : public BaseObject: src/node_serdes.ccclass SnapshotableObject : public BaseObject: src/node_snapshotable.hclass NodeCategorySet : public BaseObject: src/node_trace_events.ccclass WeakReference : public BaseObject: src/node_util.cc: src: support WeakReference, diagnostics_channel and net in the snapshot #44193class WASI : public BaseObject: src/node_wasi.hThe following are probably less likely to need support since they involve some kind of asynchronous state or references to opened system handles.
class Http2State : public BaseObject: src/node_http2_state.hclass AsyncWrap : public BaseObject: src/async_wrap.hclass PromiseWrap : public AsyncWrap: src/async_wrap.ccclass ChannelWrap : public AsyncWrap: src/cares_wrap.ccclass QueryWrap : public AsyncWrap: src/cares_wrap.ccclass HandleWrap : public AsyncWrap: src/handle_wrap.hclass HeapSnapshotStream : public AsyncWrap: src/heap_utils.ccclass JSBindingsConnection : public AsyncWrap: src/inspector_js_api.ccclass JSStream : public AsyncWrap: src/js_stream.hclass FixedSizeBlobCopyJob : public AsyncWrap: src/node_blob.hclass DirHandle : public AsyncWrap: src/node_dir.hclass FileHandle final : public AsyncWrap: src/node_file.hclass Http2Stream : public AsyncWrap: src/node_http2.hclass Http2Session : public AsyncWrap: src/node_http2.hclass Http2Ping : public AsyncWrap: src/node_http2.hclass Http2Settings : public AsyncWrap: src/node_http2.hclass Parser : public AsyncWrap: src/node_http_parser.ccclass WorkerHeapSnapshotTaker : public AsyncWrap: src/node_worker.ccclass Worker : public AsyncWrap: src/node_worker.hclass CompressionStream : public AsyncWrap: src/node_zlib.ccclass ReqWrap : public AsyncWrap: src/req_wrap.hclass StreamPipe : public AsyncWrap: src/stream_pipe.hclass BindingData : public SnapshotableObject: src/node_file.hclass BindingData : public SnapshotableObject: src/node_v8.hclass IntervalHistogram : public HandleWrap: src/histogram.hclass MessagePort : public HandleWrap: src/node_messaging.hclass StatWatcher : public HandleWrap: src/node_stat_watcher.hclass TraceSigintWatchdog : public HandleWrap: src/node_watchdog.hclass ProcessWrap : public HandleWrap: src/process_wrap.ccclass SignalWrap : public HandleWrap: src/signal_wrap.ccclass LibuvStreamWrap : public HandleWrap: src/stream_wrap.hclass UDPWrap final : public HandleWrap: src/udp_wrap.hclass Http2Stream::Provider::Stream : public Http2Stream: src/node_http2.hclass ZlibStream : public CompressionStream: src/node_zlib.ccclass BrotliCompressionStream : public CompressionStream: src/node_zlib.ccclass GetAddrInfoReqWrap : public ReqWrap: src/cares_wrap.ccclass GetNameInfoReqWrap : public ReqWrap: src/cares_wrap.ccclass ConnectWrap : public ReqWrap: src/connect_wrap.hclass FSReqBase : public ReqWrap: src/node_file.hclass FileHandleReadWrap final : public ReqWrap: src/node_file.hclass CloseReq final : public ReqWrap: src/node_file.hclass SendWrap : public ReqWrap: src/udp_wrap.ccclass ELDHistogram : public IntervalHistogram: src/node_perf.hclass ConnectionWrap : public LibuvStreamWrap: src/connection_wrap.hclass TTYWrap : public LibuvStreamWrap: src/tty_wrap.hclass JSUDPWrap final : public UDPWrap: src/js_udp_wrap.ccclass Http2StreamListener : public Stream: src/node_http2.hclass ShutdownWrap : public Stream: src/stream_base.hclass WriteWrap : public Stream: src/stream_base.hclass ReportWritesToJSStreamListener : public Stream: src/stream_base.hclass StreamBase : public Stream: src/stream_base.hclass ReadableListener : public Stream: src/stream_pipe.hclass WritableListener : public Stream: src/stream_pipe.hclass FSReqCallback final : public FSReqBase: src/node_file.hclass FSReqPromise final : public FSReqBase: src/node_file.hclass PipeWrap : public ConnectionWrap: src/pipe_wrap.hclass TCPWrap : public ConnectionWrap: src/tcp_wrap.hclass SimpleShutdownWrap : public ShutdownWrap: src/stream_base.hclass SimpleWriteWrap : public WriteWrap: src/stream_base.hclass EmitToJSStreamListener : public ReportWritesToJSStreamListener: src/stream_base.hclass CustomBufferJSListener : public ReportWritesToJSStreamListener: src/stream_base.hAnother list for external references registration:
config(all properties)symbols(all properties)