Skip to content

[Feature]: Hot-reload mobile web bundle on manifest mtime and probe repo/unpacked bundle roots #31280

Open

Description

@zhangxaochen

Summary

In the desktop runtime (src/main/runtime/bundled-mobile-web-bundle.ts), loadBundledMobileWebBundle() memoizes the parsed mobile web bundle indefinitely in process memory and only probes packaged app.asar paths.

Current Behavior (Before)

  1. No Hot-Reload on Rebuild: Once loadBundledMobileWebBundle() reads out/mobile-web/manifest.json, cachedBundle is never invalidated even when out/mobile-web is rebuilt on disk with a newer manifest.json mtime, requiring a full desktop process restart to serve updated mobile web assets.
  2. No Repo / Unpacked Override Probing: getBundledMobileWebBundleRoot() does not support ORCA_MOBILE_WEB_BUNDLE_DIR, does not check the repository out/mobile-web directory when running from dist/win-unpacked, and does not probe app.asar.unpacked/out/mobile-web.

Expected Behavior (After)

  1. Track the root and manifest.json mtimeMs alongside the cached bundle so loadBundledMobileWebBundle() returns the same object reference when mtimeMs is unchanged (avoiding event-loop SHA-256 recomputation on every RPC call) and automatically reloads when manifest.json is updated on disk.
  2. Support ORCA_MOBILE_WEB_BUNDLE_DIR override and probe the repo out/mobile-web (for unpackaged / win-unpacked builds) and app.asar.unpacked/out/mobile-web before falling back to app.asar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions