Native dev client module for Tamer4Lynx — QR scan, discovery, URL persistence, reload bridge, embedded dev launcher UI.
npm install @tamer4lynx/tamer-dev-clientAdd to your app's dependencies and run t4l link. The monorepo's tamer-dev-app workspace uses it for the reference launcher experience.
The npm tarball includes dist/dev-client.lynx.bundle and dist/tamer-debug.lynx.bundle (both built in prepublishOnly). Installs do not run Rspeedy. To work on this package from a git clone, run npm run build once so dist/ exists.
The dev client provides:
- Discovery — Find dev servers on the local network
- Connect — Enter URL or scan QR code to connect
- Recent — List of recently used dev server URLs
- Reload — Reload the Lynx bundle
- Compatibility check — Validates native modules between app and project
- Debug Panel — Minimal debug UI available as
tamer-debug.lynx.bundle
When building the dev app (t4l build ios -d / t4l build android -d), the dev client UI is embedded and the Lynx bundle is loaded from the connected dev server.
The tamer-debug.lynx.bundle provides a lightweight debug panel that can be overlaid on your project activity/viewcontroller. User projects that consume @tamer4lynx/tamer-dev-client should:
-
Copy both bundles to their native assets:
- Android:
app/src/main/assets/dev-client.lynx.bundleandapp/src/main/assets/tamer-debug.lynx.bundle - iOS: Add both bundles as Copy Bundle Resource build phase files
- Android:
-
Update the native
TemplateProviderto load both bundles. Generated code viat4l android create/t4l ios createautomatically includes this support, but custom implementations should checkloadTemplateand handle both bundle names.
The native Android/iOS pieces register Lynx DevTool when you use a debug build of the host (e.g. t4l build ios -d / t4l build android -d). Connect the desktop Lynx DevTool over USB to inspect elements, debug JS, and use Trace.
Release / production hosts (-r, -p) do not enable DevTool: on iOS, flags are wrapped in #if DEBUG; on Android, DevTool artifacts are debug variants only and the bootstrap no-ops in release.
Requires: tamer-app-shell, tamer-insets, tamer-system-ui, tamer-plugin, tamer-router, react-router, @lynx-js/react.
Uses lynx.ext.json. Run t4l link after adding to your app.
iOS template ios/templates/LynxInitProcessor.swift ships with empty GENERATED IMPORTS / GENERATED AUTOLINK sections; t4l link ios fills them from discovered native packages. Do not commit a hand-written list of globalConfig.register(...) into that template — regenerate via link when dependencies change.
The generated ProjectViewController.swift (from t4l ios create) includes log-relay lifecycle hooks. If you wire tamer-dev-client into a custom view controller, replicate the same calls:
override func viewDidLoad() {
super.viewDidLoad()
TamerRelogLogService.connect()
// ...
}
func reloadLynxView() {
TamerRelogLogService.disconnect()
// ...
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
TamerRelogLogService.disconnect()
}TamerRelogLogService is declared internal (not private) so DevServerPrefs.fetchMetaDict can call devServerProbeBaseForMeta from the same module without requiring a separate import.
This error occurs when building dev-client from source with mismatched @lynx-js/* package versions. The dev-client's build toolchain (@lynx-js/react-rsbuild-plugin, @lynx-js/rspeedy) must align with your project's @lynx-js/react version.
Fix:
- Ensure
@lynx-js/react,@lynx-js/react-rsbuild-plugin, and@lynx-js/rspeedyuse compatible versions (same minor version recommended). - Delete
node_modulesand reinstall:rm -rf node_modules package-lock.json && npm install - If using a monorepo, ensure workspace hoisting doesn't create duplicate versions of
@lynx-js/*packages.
The published npm package includes a prebuilt dist/dev-client.lynx.bundle, so npm install from the registry should not trigger this error.