-
Notifications
You must be signed in to change notification settings - Fork 31
feat: replace legacy web explorer preview with Bevy Web #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
d74ad02
a5445ee
588446f
7677353
97b535f
be41563
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,14 +16,11 @@ import { debounce } from '../../../logic/debounce' | |||||||||
| /** | ||||||||||
| * This function gets file modification events and sends them to all the connected | ||||||||||
| * websockets, it is used to hot-reload assets of the scene. | ||||||||||
| * | ||||||||||
| * IMPORTANT: this is a legacy protocol and needs to be revisited for SDK7 | ||||||||||
| */ | ||||||||||
| export async function wireFileWatcherToWebSockets( | ||||||||||
| components: Pick<PreviewComponents, 'fs' | 'ws' | 'logger'>, | ||||||||||
| projectRoot: string, | ||||||||||
| projectKind: ProjectUnion['kind'], | ||||||||||
| desktopClient: boolean | ||||||||||
| projectKind: ProjectUnion['kind'] | ||||||||||
| ) { | ||||||||||
| const ignored = await getDCLIgnorePatterns(components, projectRoot) | ||||||||||
| const sceneId = b64HashingFunction(projectRoot) | ||||||||||
|
|
@@ -36,17 +33,15 @@ export async function wireFileWatcherToWebSockets( | |||||||||
| cwd: projectRoot | ||||||||||
| }) | ||||||||||
| .on('unlink', (_: unknown, file: string) => { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Pre-existing bug: chokidar Suggested fix:
Suggested change
|
||||||||||
| if (desktopClient) { | ||||||||||
| return removeModel(sceneId, file) | ||||||||||
| } | ||||||||||
| removeModel(sceneId, file) | ||||||||||
| }) | ||||||||||
| .on( | ||||||||||
| 'all', | ||||||||||
| debounce(async (a, file) => { | ||||||||||
| if (desktopClient) { | ||||||||||
| updateScene(sceneId, file) | ||||||||||
| } | ||||||||||
| return __LEGACY__updateScene(projectRoot, sceneUpdateClients, projectKind) | ||||||||||
| debounce(async (_, file) => { | ||||||||||
| updateScene(sceneId, file) | ||||||||||
| // Legacy JSON protocol: still the only one Bevy and Godot explorers understand. | ||||||||||
| // Remove once both consume the protobuf WsSceneMessage. | ||||||||||
| __LEGACY__updateScene(projectRoot, sceneUpdateClients, projectKind) | ||||||||||
| }, 800) | ||||||||||
| ) | ||||||||||
| } | ||||||||||
|
|
@@ -95,7 +90,7 @@ function sendSceneMessage(sceneMessage: WsSceneMessage) { | |||||||||
| } | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @deprecated old explorer (kernel) | ||||||||||
| * @deprecated legacy JSON protocol, consumed by Bevy and Godot explorers | ||||||||||
| */ | ||||||||||
| export function __LEGACY__updateScene(dir: string, clients: Set<WebSocket>, projectKind: ProjectUnion['kind']): void { | ||||||||||
| for (const client of clients) { | ||||||||||
|
|
@@ -105,7 +100,6 @@ export function __LEGACY__updateScene(dir: string, clients: Set<WebSocket>, proj | |||||||||
| payload: { sceneId: b64HashingFunction(dir), sceneType: projectKind } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| // Old explorer | ||||||||||
| client.send(sdk.UPDATE, { binary: false }) | ||||||||||
| client.send(JSON.stringify(message), { binary: false }) | ||||||||||
| } | ||||||||||
|
|
||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1]
--web-explorerwas removed fromdeclareArgs, butdecentraland/godot-explorer(scripts/bench/launch_devices.sh) anddecentraland/docsstill reference it. Thearglibrary throws on unknown flags, so this will crash those scripts on the next SDK release.Keep it as a deprecated no-op (same pattern as
--web3and--no-debug):