Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the editor synchronization logic by introducing a new WebSocket-based preview sync runtime and a structured protocol, replacing the legacy implementation. Key additions include a robust transport layer with reconnection support, an embedded bootstrap mechanism for iframe integration, and a refined scene synchronization command that supports backlog recovery. The initialization process was updated to conditionally start the sync runtime based on configuration. Review feedback identifies performance bottlenecks caused by frequent state serialization and a logic error in the scene comparison logic within the synchronization command.
packages/webgal/src/Core/util/syncWithEditor/previewSyncRuntime.ts
Outdated
Show resolved
Hide resolved
packages/webgal/src/Core/util/syncWithEditor/runtime/previewSyncSceneCommand.ts
Outdated
Show resolved
Hide resolved
packages/webgal/src/Core/util/syncWithEditor/runtime/previewSyncSceneCommand.ts
Outdated
Show resolved
Hide resolved
4 tasks
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
Enable_Editor_Sync开启且初始场景就绪后再启动预览同步DebugCommand、webSocketFunc和旧场景同步主路径Impact
webgal-editor-preview-sync.v1subprotocol 和新的 request/event/response envelope 对接embeddedLaunchId,超时后退回未绑定注册JMP绑定改为复用新的场景快进实现Test Plan
yarn buildEnable_Editor_Sync=true的工程,确认引擎启动后会在初始场景完成加载后建立预览同步连接preview.ready.updated和首个stage.snapshot.updatedpreview.command.sync-scene、preview.command.run-snippet、preview.command.set-effect等命令可被接收并返回成功响应