Merged
Conversation
- Update all instances of EngineMessageType to RpcEngineType across the codebase for consistency in RPC communication. - Remove the deprecated engine-message.ts file and its associated types. - Refactor event handling in various components to utilize the new RpcEngineType for commands and events. - Ensure type safety and clarity in RPC method registrations and event emissions. This change enhances the overall structure of the engine's messaging system, aligning it with the new RPC framework.
- Update RPC event handlers in the engine to utilize RpcEngineType for better type safety and clarity. - Replace generic event handling with specific types for notify-engine-event and handle-input-event. - Ensure proper error handling for undefined events in the registration of handlers. - Refactor WebView and engine components to align with the new type-safe RPC structure. These changes improve the robustness of the messaging system and enhance maintainability across the codebase.
- Update RPC method calls in the engine to use RpcEngineType for improved clarity and type safety. - Refactor loadProject and input event handling to align with the new RPC structure. - Enhance maintainability by ensuring consistent usage of RPC types across the codebase. These changes contribute to a more robust and understandable messaging system within the engine.
…nication - Introduce RpcEngineParamMap for improved type safety in event handling and RPC method calls. - Refactor engine components to utilize the new type-safe RPC structure, ensuring consistent usage across the codebase. - Update message handling in WebView and GJS to align with the enhanced RPC framework. - Clean up deprecated types and streamline the messaging system for better maintainability. These changes contribute to a more robust and understandable messaging system within the engine, enhancing clarity and reducing potential errors.
…ation - Enhance RpcEngineParamMap to exclude START and STOP types for better clarity in event data. - Refactor EngineRpcRegistry to define specific parameters and responses for each RPC method, improving type safety. - Introduce a new RpcErrorCode enum for standardized error handling in RPC responses. - Update message conversion utilities to utilize the new error handling structure, ensuring consistent error reporting. These changes contribute to a more robust and maintainable RPC communication framework within the engine.
…r package independence
…rmance improvements
…rt and performance optimizations
…e readability - Consolidate RPC handler registration for loadProject, loadMap, start, and stop methods to enhance clarity. - Rename setupEventListeners to registerRpcHandlers for better alignment with functionality. - Remove unnecessary type annotations for parameters in handler functions to simplify the code. These changes contribute to a cleaner and more maintainable engine implementation.
- Update maker-web to use EngineRpcRegistry for proper typing - Translate German comments to English in maker-web app - Remove any types and use proper TypeScript types - Enhance error handling with robust type checking - Update all README.md files with comprehensive documentation - Improve project path configuration for better development setup - Ensure consistent typing patterns across all implementations
- Change iframe source URL from localhost:4173 to localhost:5000 for game-iframe. - Update project path from localhost:3000 to localhost:5001 for game-project.json. These adjustments ensure the application points to the correct local development servers.
…ssues - Fix TypeScript spread operator errors in message conversion - Align RPC response validation with type definitions - Add standardized message serialization with undefined handling - Update package exports for serialization utilities - Ensure consistent behavior across all platforms
…s platforms - Update all RPC endpoints to use standardized serialization - Remove debug logging infrastructure from endpoints - Ensure consistent message handling across GJS, Web, and WebView platforms - Improve error handling with transmission error utilities
- Fix unhandled promise rejection in ProjectView event handler - Remove debug logging from engine methods - Simplify parallel project loading logic - Ensure graceful handling of timing differences in parallel loading - Fix TypeScript return type inconsistencies in engine methods
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.
This PR improves RPC communication across the entire project by enhancing type safety and unifying implementations across all platform packages.
🎯 Motivation
The previous RPC communication had several issues:
🔧 Key Changes
Core Package Improvements (
message-channel-core)New Type Definitions:
RpcEngineTypeenum for unified message typesRpcEngineParamMapfor type-safe parameter mappingEngineRpcRegistryinterface for registry typingNew Utility Functions:
isRpcRequest,isRpcResponse)createRpcErrorPlatform-Specific Updates
GJS Package (
message-channel-gjs):RpcEndpointas generic class withRpcMethodRegistryWeb Package (
message-channel-web):WebView Package (
message-channel-webview):Engine Integration
Excalibur Engine:
RpcEngineTypeintegration instead of oldEngineMessageTypeGJS Engine:
📁 Affected Files
Core Packages
packages/message-channel-core/src/types/rpc.ts- New RPC typespackages/message-channel-core/src/utils/serialization.ts- Serializationpackages/message-channel-core/src/utils/validation.ts- Type guardsPlatform Packages
packages/message-channel-gjs/src/rpc-endpoint.ts- GJS RPC endpointpackages/message-channel-web/src/iframe-context.ts- Web iframe contextpackages/message-channel-webview/src/webkit-message-handler.ts- WebView handlerEngine Packages
packages/engine-excalibur/src/systems/editor-input.system.ts- Input systempackages/engine-gjs/src/widgets/webview.ts- GJS WebView widgetAPI Changes
EngineMessageType→RpcEngineType(enum values remain the same)RpcEndpointis now generic withRpcMethodRegistry<T>Migration Guide