Skip to content

Experimental Electrobun: auto-detect runtime in scaffold and examples before falling back to WASM #127

@devallibus

Description

@devallibus

Summary

The experimental Electrobun path is present and tested at the adapter level, but the default scaffold and most example entrypoints still only check isTauri(). That means an Electrobun session needs custom startup wiring even when a bridge is already available.

Timing note

This is intended as a follow-up once the next Electrobun release lands. It does not need to block current stable work.

Current state

  • The README explicitly calls out missing runtime auto-detection.
  • The base scaffold bootstraps Tauri or configures WASM.
  • examples/electrobun-counter already includes a small window.__ELECTROBUN__ registration helper that points in the right direction.

Why this matters

  • It lowers friction for dogfooding the experimental path.
  • It keeps the experimental story coherent without implying stable support.
  • It reduces copy/paste integration code across examples and downstream apps.

Suggested scope

  • Add a shared helper or bootstrap path that checks for an Electrobun bridge before falling back to WASM.
  • Wire that helper into example entrypoints and, if appropriate, the scaffolded template.
  • Keep the public status explicitly experimental in docs and generated projects.

Acceptance criteria

  • A project running inside Electrobun can register the runtime provider without custom bootstrap glue.
  • Non-Electrobun web builds still fall back cleanly to the current WASM path.
  • Docs and examples continue to describe Electrobun as experimental.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions