start_remote() auto-registers @remote_command methods#95
Merged
Conversation
start_remote() now calls register_remote_commands() before publishing, so tagged methods just work without a separate call. The explicit method remains available and idempotent. Docs now present @remote_command as the primary way to expose methods and frame app.remote(...) as the low-level primitive it builds on (kept for free functions / dynamic registration). No behavior removed; fully backward compatible. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Simplifies the remote API surface based on feedback.
start_remote()now auto-registers@remote_command-tagged methods, soregister_remote_commands()no longer needs to be called manually:Why not just remove
app.remote?app.remote()isn't a parallel feature to@remote_command— it's the engine underneath it.register_remote_commands()callsself.remote(...)for each tagged method, so it can't be deleted. Instead this PR reframes it: docs now present@remote_commandas the way to expose methods, andapp.remote(...)as the low-level primitive it builds on (still there for free functions or dynamic runtime registration). Nothing is removed; fully backward compatible.Changes
start_remote()callsregister_remote_commands()before publishing (idempotent —remote()overwrites by name).register_remote_commands()documented as auto-called / rarely needed.@remote_command;remote()reframed as the primitive.self.remote(...)/@app.remoteusage still works.Tests
test_start_remote_auto_registers_commands(tagged methods exposed with no explicit register call).register_remote_commands()to exercise auto-registration throughstart_remote.Targeted for release v1.7.1 (backward-compatible refinement).
🤖 Generated with Claude Code