TypeScript HTTP handlers#4931
Merged
JasonAtClockwork merged 14 commits intoMay 22, 2026
Merged
Conversation
This commit adds host support for registering HTTP handlers in V8 modules, and a minimal draft of TypeScript bindings support for the same. The TypeScript bindings support is fully vibe-coded and unreviewed, and is present only to allow a new smoketest, which is added to the `http_routes` suite. The host changes were also AI-assisted, but I reviewed and polished them.
coolreader18
approved these changes
May 7, 2026
Contributor
coolreader18
left a comment
There was a problem hiding this comment.
Some comments, but overall LGTM
coolreader18
reviewed
May 7, 2026
3 tasks
Centril
approved these changes
May 8, 2026
Contributor
Centril
left a comment
There was a problem hiding this comment.
Looks good; I have no comments beyond Noa's.
Contributor
Author
|
@coolreader18 @Centril to quote the PR description:
|
…/v8-host Resolved conflicts in: crates/core/src/host/module_host.rs crates/core/src/host/v8/mod.rs
It's unreachable now, as both host types are supported.
# Description of Changes Cleaning up the TypeScript HTTP handler module bindings on top of the V8 host/module work from #4931. - Consolidate the inbound handler API around http_handlers.ts - keeps outbound procedure HTTP in http_internal.ts - moves shared HTTP code into http_shared.ts to avoid dependency issues - moves the inbound wire/runtime bridge into runtime.ts # API and ABI breaking changes Cleaning up the API layer: - spacetimedb.httpHandler(...) - spacetimedb.httpRouter(...) - Router - handler-side Request # Expected complexity level and risk 2 - I needed to move code out of http_internal.ts to have it shareable for http_handler.ts adding more churn than I'd like. # Testing - [x] Expanded the smoketests - [x] Expanded unit test coverage - [x] Local throwaway test suite
…/v8-host Resolved conflicts due to C# and TypeScript smoketests looking similar: crates/smoketests/tests/smoketests/http_routes.rs
7f37ff6
into
phoebe/http-handlers-webhooks
43 of 46 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #4636 .
Description of Changes
This commit adds host support for registering HTTP handlers in V8 modules, and a minimal draft of TypeScript bindings support for the same. The TypeScript bindings support is fully vibe-coded and unreviewed, and is present only to allow a new smoketest, which is added to the
http_routessuite. The host changes were also AI-assisted, but I reviewed and polished them.API and ABI breaking changes
Adds new TypeScript "ABI." Also adds a new API, which I sure hope will be overwritten by @JasonAtClockwork .
Expected complexity level and risk
2: pretty simple extensions to TypeScript execution, which largely mirror existing
call_proceduremachinery.Testing