feat(components): let a non-Electron host serve the local planes - #1
Draft
pythonlearner1025 wants to merge 1 commit into
Draft
feat(components): let a non-Electron host serve the local planes#1pythonlearner1025 wants to merge 1 commit into
pythonlearner1025 wants to merge 1 commit into
Conversation
The local Machine RPC, local file preview, local project git state, local project control and local session-control planes all gate on `window.__LODY_ELECTRON__`. The transport behind them is `window.ipc`, which is not Electron-specific: `getIpcServices()` is a generic proxy and the local Loro data plane already gates on that alone. Declare `window.__LODY_LOCAL_BRIDGE__` and accept it beside the Electron flag, so a host that installs `window.ipc` by some other means can reach the same planes. Every predicate is widened by disjunction, so it can only become true where it was false; no Electron path changes. Model: claude-opus-5[1m]
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.
The local Machine RPC, local file preview, local project git state, local
project control and local session-control planes all gate on
window.__LODY_ELECTRON__. The transport behind them iswindow.ipc, which isnot Electron-specific:
getIpcServices()is a generic proxy and the local Lorodata plane already gates on that alone.
Declare
window.__LODY_LOCAL_BRIDGE__and accept it beside the Electron flag,so a host that installs
window.ipcby some other means can reach the sameplanes. Every predicate is widened by disjunction, so it can only become true
where it was false; no Electron path changes.
Compatibility
Every change is additive at its default. With the new prop, parameter or flag
absent, the touched components render and behave exactly as they do today, and
no existing call site in this repository passes one.
Testing
packages/componentstypecheck and the full vitest suite pass. No new test: every guard is inside a provider that needs a live machine route.Notes for the reviewer
The alternative you may prefer is a capability probe over
window.ipcinstead of a second global. That would suit a host equally well and this PR would be withdrawn for it — the flag is the smallest change, not the only one. Note that the local Loro DATA plane already gates ongetIpcServices()alone, so the asymmetry this removes is already half gone upstream.Review metadata
BlitzOS fork only. Delete this section before sending the PR to
LodyAI/Lody.blitz/seam-1-non-electron-local-bridgef3474894 (the pinned upstream commit)