SIGN IN SIGN UP
denoland / deno UNCLAIMED

A modern runtime for JavaScript and TypeScript.

0 0 2 Rust

refactor(ext/process): bypass resource table for Node child_process stdio (#33176)

## Summary

- Add `op_node_spawn_child` that returns raw OS file descriptors for
stdin/stdout/stderr and extra stdio pipes, specifically for the Node
compat layer
- The existing `op_spawn_child` continues to return resource IDs for the
Deno API, preserving `getExtraPipeRids` and `kExtraStdio` for external
consumers
- Node's `child_process` polyfill now uses `Pipe.open(fd)` →
`FdStreamBase` for all stdio, completely bypassing the resource table
indirection (`BiPipeResource`/`ChildStdin`/`ChildStdout`/`ChildStderr` →
`StreamResource` → `core.read`/`core.write`)
- Remove the `StreamResource` class and `getStdioRids` internal from the
Node polyfill, which are no longer needed
- Export `nodeSpawnChild` — a lightweight spawn wrapper that returns an
object with raw fds and minimal methods (`status`, `kill`, `ref`,
`unref`), avoiding the overhead of creating a full `Deno.ChildProcess`
with web streams
- Export `nodeSpawnSyncChild` — calls `op_spawn_sync` directly and
returns `pid`/`killedByTimeout` as normal fields, removing the hidden
`_pid`/`_killedByTimeout` property hack from `spawnSyncInner`

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
B
Bartek Iwańczuk committed
62dfdab0c904d63e8373ee20799ecaf7a8b7d7bb
Parent: 3ec8514
Committed by GitHub <noreply@github.com> on 4/5/2026, 6:22:34 AM