Repository navigation
Serve the official RPC Studio - #4
Merged
Merged
Conversation
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>
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.
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
?studionow serves the same small HTML page as the upstream services: it loads the official Studio app and mounts<skir-studio-app>.?listis 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 answers404unless Studio is enabled for the endpoint, so method metadata is exposed under the same switch as before.studio_app_js_urlis a new config key (SKIR_SERVER_STUDIO_APP_JS_URL), defaulting to the jsDelivr build ofskir-studio, for projects that must host the script themselves.Record names are derived
The runtime
Typehas no record names, ids or doc comments, and type descriptors need an id per struct and enum.TypeDescriptorderives them:<Method>Requestand<Method>Response;details: [Detail]becomesDetail);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-coreand the runtime.Breaking
StudioRenderer::render()now takes the app script URL instead of a server and an endpoint.data-skir-studiometadata 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.