Skip to content

refactor!: external runtime via named exports - #2312

Open
vados-cosmonic wants to merge 7 commits into
bytecodealliance:mainfrom
vados-cosmonic:feat/runtime-named-exports
Open

vados-cosmonic wants to merge 7 commits into
bytecodealliance:mainfrom
vados-cosmonic:feat/runtime-named-exports

Conversation

@vados-cosmonic

Copy link
Copy Markdown
Collaborator

No description provided.

Publish the API-v2 runtime declaration contract and resource subpath. Generate
static named imports and stable trap contexts for tableGet, including calls
from remaining inline resource helpers. Resolve package and directory bases
centrally, with migration diagnostics for legacy provider files.

Cover packed NodeNext/bundler consumers, independent and re-exported runtimes,
selected realms, isolated stores, native linking errors, and browser URL loads.
Update CLI/API/WIT docs, migration notes, CI type checks, and release smoke.

Validation: 84 Rust tests, clippy/fmt, runtime type/lint/package checks, 27 focused
codegen tests, 20 browser tests, and the P3 passing-resources case. LTS failures
from local-server restrictions and concurrent workload noise passed isolated
reruns without threshold changes.

A local paired pilot against main's one-intrinsic factory runtime reduced the
resource bundle by 1,165 raw, 335 gzip, and 289 Brotli bytes with Rolldown. Named
output is only 60 raw bytes above inline; the adder control is byte-identical.
Startup timing improvements are modest and warm-call throughput is unchanged.
The complete shared benchmark harness and remaining migrations follow later.

BREAKING CHANGE: Experimental CM runtime API v2 replaces runtime.create with
named runtime and intrinsics/resource subpaths. cmRuntimeEsModule now names a
package or directory base. Providers must expose CM_RUNTIME_API_VERSION = 2 and
tableGet(context, table, handle); migrate file specifiers to directory bases and
regenerate bindings. Inline generation remains the default.
@vados-cosmonic
vados-cosmonic force-pushed the feat/runtime-named-exports branch from 5aa2b95 to 471c002 Compare October 25, 2026 11:16
@vados-cosmonic
vados-cosmonic force-pushed the feat/runtime-named-exports branch from 29166a6 to 3a0d946 Compare October 26, 2026 03:06
@vados-cosmonic
vados-cosmonic force-pushed the feat/runtime-named-exports branch from 5add603 to 664891c Compare October 26, 2026 03:49

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant