Skip to content

Serve the official RPC Studio - #4

Merged
happyDemon merged 1 commit into
mainfrom
official-rpc-studio
Nov 10, 2026
Merged

happyDemon merged 1 commit into
mainfrom
official-rpc-studio

Conversation

@happyDemon

Copy link
Copy Markdown
Member

Why

Studio rendered a static page that dumped each method's request and response types. It could not send a request, and it looked nothing like the RPC Studio the Skir docs describe, which every upstream Skir service serves.

What changes

  • ?studio now serves the same small HTML page as the upstream services: it loads the official Studio app and mounts <skir-studio-app>.
  • ?list is new. The Studio app reads the endpoint's methods from it. The answer follows the upstream format: each method with its name, number and the type descriptors of its request and response. It answers 404 unless Studio is enabled for the endpoint, so method metadata is exposed under the same switch as before.
  • studio_app_js_url is a new config key (SKIR_SERVER_STUDIO_APP_JS_URL), defaulting to the jsDelivr build of skir-studio, for projects that must host the script themselves.

Record names are derived

The runtime Type has no record names, ids or doc comments, and type descriptors need an id per struct and enum. TypeDescriptor derives them:

  • a method's request and response are <Method>Request and <Method>Response;
  • a nested struct or enum is named after the field or variant that holds it (details: [Detail] becomes Detail);
  • records with the same shape share one definition, and a name already taken by another shape gets a number (Detail2).

The names only label the Studio forms; the wire format is untouched. Real names and doc comments need the generators to emit them, which is a follow-up across generator-core and the runtime.

Breaking

  • StudioRenderer::render() now takes the app script URL instead of a server and an endpoint.
  • The old page and its data-skir-studio metadata attribute are gone.

Checked

Against a Laravel 13 app with four endpoints: the Studio app loaded the method list, built the request form for a method with an enum and nested structs, and a call sent from the app returned the expected response.

Studio was a static page that printed each method's types. An endpoint
now serves Skir's RPC Studio app and answers `?list` with its methods
as type descriptors, in the format of the upstream Skir services, so
the app can build request forms and call the methods.

Runtime types carry no record names, so the names in the list are
derived from the method and from the field or variant holding a record.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@happyDemon
happyDemon merged commit a539eea into main Nov 10, 2026
6 checks passed
@happyDemon
happyDemon deleted the official-rpc-studio branch November 10, 2026 20:48
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