Skip to content

node:v8: Serializer and Deserializer classes remain absent from current surface #3680

Description

@andrewtdiz

Summary

Current Perry exposes the top-level v8.serialize() / v8.deserialize() path, but the class-based V8 serialization APIs are still not in the current manifest/runtime surface. This is a focused follow-up to closed #3294 / #2492.

Local evidence

Current perry --print-api-manifest entries for v8:

GCProfiler
cachedDataVersionTag
deserialize
getHeapCodeStatistics
getHeapSpaceStatistics
getHeapStatistics
serialize
start
stop

Node v25.9.0 baseline from disposable probe test-files/tmp_v8_missing_surface_probe.ts:

Serializer: function
Deserializer: function
DefaultSerializer: function
DefaultDeserializer: function

Normal Perry compile:

Collecting modules...
Error: `v8.Serializer` is not implemented in Perry — see `perry --print-api-manifest` for the supported surface, or set `PERRY_ALLOW_UNIMPLEMENTED=1` to ignore. (#463)

With PERRY_ALLOW_UNIMPLEMENTED=1:

Serializer: undefined
Deserializer: undefined
DefaultSerializer: undefined
DefaultDeserializer: undefined

Expected

node:v8 should export Node-compatible Serializer, Deserializer, DefaultSerializer, and DefaultDeserializer constructors, with representative write/read/release round trips matching Node for covered values.

Actual

The class exports are not present in the manifest, normal compilation stops at the manifest guard, and the bypassed runtime namespace returns undefined for all four constructors.

Suggested PR cut

Implement this as one class-based serialization cut, reusing the existing top-level serde path where possible:

  • new v8.Serializer() / new v8.DefaultSerializer()
  • writeHeader, writeValue, releaseBuffer, primitive writer helpers where feasible
  • new v8.Deserializer(buffer) / new v8.DefaultDeserializer(buffer)
  • readHeader, readValue, primitive reader helpers where feasible
  • Node-compatible validation for invalid constructor/input cases covered by parity tests

Acceptance

  • Add a dedicated parity case for class-based V8 serialization.
  • Constructors are function-shaped under namespace and named imports.
  • A representative object can be written, released as a Buffer, read back, and compared to Node output behavior.
  • Invalid input paths match Node error class/code for covered cases.
  • Manifest/docs are updated so the class APIs are no longer silently absent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions