Browser Support #9
Labels
No labels
agent
blocked
agent
new
agent
review
agent
working
complexity
high
complexity
low
priority
high
priority
low
priority
medium
risk
high
risk
low
risk
medium
type
bug
type
chore
type
feature
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tfks/logbus#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Running logbus in the browser would enable demos, playground UIs, and real use cases like client-side log processing. This is more of a "pie in the sky" idea, not to be taken too seriously.
Feasibility Analysis
What compiles to WASM easily:
on_inputfunctions over JSON values) — trivialparse/*andformat/*plugins — pure computation, no I/Ojsplugin — rquickjs doesn't target WASM, but could swap to a WASM-friendly JS engine or just skip it in browser buildswasm-bindgen-futures+ manual scheduling can replace itWhat needs platform abstraction:
tokio::time→gloo_timersorsetTimeoutfutures::channel(works in WASM)Proposed Architecture
Feature-gate platform-specific code:
Abstract the runtime:
Native impl wraps tokio. WASM impl wraps
wasm-bindgen-futures+gloo_timers.Browser-specific plugins:
source/paste— textarea input, processes on paste or button clicksource/fetch— fetches a URL (via browser Fetch API) and streams responsesource/upload— File input element, reads via FileReader APIsink/dom— renders events into a DOM element (table, JSON tree)sink/download— accumulates output, triggers file downloadsink/websocket— sends events to a WebSocket endpointBuild setup:
JS API surface (via wasm-bindgen):