Skip to content
Back to archipelago.banuacoder.com

Feature SDKs (Pro)

app_debugger_miniapp Pro ​

Tier
Proversion 0.3.4
Command
archipelago generate app_debugger_miniapp
Generates
  • features/app_debugger_miniapp/app_debugger_miniapp
  • features/app_debugger_miniapp/app_debugger_miniapp_api
  • features/app_debugger_miniapp/app_debugger_miniapp_noop
Generates first
app_debugger, webview_sdk_advancedwhen needed and missing, so there is nothing to install first
Depends on
shared_identifiersgenerate these first

Mini-app bridge inspector sub-brick for app_debugger. Adds a Bridge tool showing JS↔native mini-app bridge traffic (invocations, denials, errors) as a live, tappable list with a detail dialog. Automatically swapped to a no-op stub in production-flavor builds via build_prepare.

Variables ​

This brick has no generation-time variables.

Install ​

Interactive ​

bash
archipelago generate app_debugger_miniapp

Non-interactive (CI) ​

bash
archipelago generate app_debugger_miniapp --config my_config.json

Prerequisites ​

  • app_debugger is generated first when the project lacks it.
  • webview_sdk_advanced is a hard dependency (app_debugger_miniapp and app_debugger_miniapp_noop both depend on its webview_advanced package at ../../webview_advanced for MiniAppBridgeEvent/MiniAppBridgeDispatcher). pre_gen.dart self-generates it via SubBrickGenerator if it is missing (since 0.2.2), so no manual step is needed.

Generated Structure ​

text
features/
└── app_debugger_miniapp/
    ├── app_debugger_miniapp_api/
    │   └── lib/src/
    │       ├── bridge_inspector_sdk.dart
    │       └── models/                  # BridgeInspectorConfig
    ├── app_debugger_miniapp/
    │   └── lib/src/
    │       ├── bridge_inspector_sdk_impl.dart
    │       ├── bridge_inspector_page.dart
    │       └── di/
    └── app_debugger_miniapp_noop/
        └── lib/src/di/

Public API ​

dart
final sdk = getIt<BridgeInspectorSDK>();

// Wire into your mini-app host so every bridge call is captured:
dispatcher.onEvent = sdk.observerCallback; // null-safe in the noop stub

sdk.eventStream.listen((event) {
  print('${event.capability}.${event.method} -> ${event.isOk}');
});

sdk.currentEvents;  // buffered snapshot, most-recent last
sdk.clearEvents();

Events are held in an in-memory ring buffer capped at BridgeInspectorConfig.maxEntries (default 200) — the oldest entry is dropped once full.

DI & Wiring ​

  • AppDebuggerMiniappPackageModule is declared under archipelago: di_modules and registered into the app injector by post_gen.
  • BridgeInspectorSDKImpl is @Singleton(as: BridgeInspectorSDK) (eager, since 0.2.2); it registers itself with FeatureSDKRegistry and registers BridgeInspectorPage with DebuggerPanelPageRegistry in its constructor.
  • post_gen patches the archipelago:debug_panel_pages sentinel in app_debugger's own di/debug_tools.dart to resolve the SDK eagerly before first frame (fixed in 0.2.2). The marker moved between app_debugger versions, so the hook uses the first file that has it: app_debugger's lib/src/di/debug_tools.dart (2.0.0 and later), its lib/src/app_debugger_sdk_impl.dart (1.3.0 to 1.15.x), then the app's lib/bootstrap.dart (older), and adds the imports and path dependencies to that package. A file that already resolves the SDK is left as it is. If no file has the marker, pre_gen prints the lines to add and stops before it writes any file.

Dependencies ​

app_debugger_miniapp and app_debugger_miniapp_noop packages depend on webview_advanced (the package generated by webview_sdk_advanced) plus the workspace's feature_sdk, router_registry, identifiers, dependencies. No external pub.dev packages beyond what webview_sdk_advanced already pulls in.

Platform Setup ​

None beyond whatever webview_sdk_advanced already requires.

Limitations ​

  • The noop package (app_debugger_miniapp_noop) registers nothing: BridgeInspectorSDK is only ever resolved from inside app_debugger's own production-stripped composition (per 0.2.1 CHANGELOG), so there is no always-inert stub class to fall back on if a call site resolves it unconditionally from always-on app code.

Changelog ​

Run archipelago brick info app_debugger_miniapp to see the latest published version. Enterprise customers can read the full CHANGELOG.md in the brick source repository.