diff --git a/changelog.d/9780-bun-tcp-landing-followups.md b/changelog.d/9780-bun-tcp-landing-followups.md new file mode 100644 index 0000000000..e0293d2f4e --- /dev/null +++ b/changelog.d/9780-bun-tcp-landing-followups.md @@ -0,0 +1,15 @@ +**`Bun.listen` / `Bun.connect` are documented, and `perry-ext-http`'s unit +tests link again.** #9514's TCP socket facades added both methods to the +compile-time API manifest without regenerating the derived docs, so +`docs/src/api/reference.md` and `docs/api/perry.d.ts` had been stale since +2026-09-03 and the API-docs drift check failed on every run. They now list +both entries (3046 → 3048). + +Separately, `js_bun_tcp_listen` drives the shared async runtime from its +bind-poll loop via `perry_ffi::run_pending`. `perry-ext-net` stubs that +symbol only under `#[cfg(test)]`, which does not apply when it is linked as +an ordinary dependency into `perry-ext-http`'s test binary, so release-linking +that crate failed with `undefined symbol: perry_ffi_run_pending`. +`perry-ext-http`'s test shim now provides it, alongside the +`perry_ffi_spawn_async` stub that exists for the same transitive reason. +`perry-ext-ws` was checked and does not need it. diff --git a/crates/perry-ext-http/src/test_async_shims.rs b/crates/perry-ext-http/src/test_async_shims.rs index 6f642e5f85..45c21a58e9 100644 --- a/crates/perry-ext-http/src/test_async_shims.rs +++ b/crates/perry-ext-http/src/test_async_shims.rs @@ -64,3 +64,9 @@ pub extern "C" fn perry_ffi_spawn_blocking_with_reactor( // host stdlib archive, which unit-test binaries do not link. #[no_mangle] pub extern "C" fn perry_ffi_spawn_async(_ctx: *mut c_void) {} + +// Same story: `js_bun_tcp_listen` drives the shared runtime from its bind-poll +// loop (`perry_ffi::run_pending`), so linking perry-ext-net's object code into +// this crate's test binaries pulls the extern in with it. +#[no_mangle] +pub extern "C" fn perry_ffi_run_pending(_budget_ms: u64) {} diff --git a/docs/api/perry.d.ts b/docs/api/perry.d.ts index c8c478c975..a2a6b00868 100644 --- a/docs/api/perry.d.ts +++ b/docs/api/perry.d.ts @@ -1,6 +1,6 @@ // Auto-generated from Perry's API manifest (#465). Do not edit by hand. // Source: perry-api-manifest::API_MANIFEST -// Coverage: 2089 entries across 136 modules +// Coverage: 2091 entries across 136 modules type PerryI8 = number & { readonly __perryI8?: never }; type PerryI16 = number & { readonly __perryI16?: never }; @@ -375,6 +375,8 @@ declare module "bun" { /** stdlib */ export function build(...args: any[]): any; /** stdlib */ + export function connect(...args: any[]): any; + /** stdlib */ export function deepEquals(...args: any[]): any; /** stdlib */ export function file(...args: any[]): any; @@ -387,6 +389,8 @@ declare module "bun" { /** stdlib */ export function hash(...args: any[]): any; /** stdlib */ + export function listen(...args: any[]): any; + /** stdlib */ export function pathToFileURL(...args: any[]): any; /** stdlib */ export function serve(options: any): any; diff --git a/docs/src/api/reference.md b/docs/src/api/reference.md index 552694501d..dc3fde7ca7 100644 --- a/docs/src/api/reference.md +++ b/docs/src/api/reference.md @@ -2,7 +2,7 @@ This page is auto-generated from Perry's compile-time API manifest (`perry-api-manifest::API_MANIFEST`). It is the source of truth for what `perry compile` accepts; references to symbols not listed here produce `R005 UnimplementedApi` (issue #463). Stubs (#464) are flagged ⚠ — they link cleanly but no-op at runtime on the chosen target. -Total: 3046 entries across 138 modules. +Total: 3048 entries across 138 modules. ## Modules @@ -429,12 +429,14 @@ Total: 3046 entries across 138 modules. - `Terminal` — module - `Transpiler` — module - `build` — module +- `connect` — module - `deepEquals` — module - `file` — module - `fileURLToPath` — module - `gc` — module - `generateHeapSnapshot` — module - `hash` — module +- `listen` — module - `pathToFileURL` — module - `scan` — instance *(class: `Transpiler`)* - `scanImports` — instance *(class: `Transpiler`)*