From 310f3a8a88091a203be56ffc370cae9120e886d8 Mon Sep 17 00:00:00 2001 From: Dwiki Riyadi Date: Mon, 9 Nov 2026 07:15:22 +0700 Subject: [PATCH] docs: sync the Guide with S6 devtools gating Kotlin: how the no-op's API parity is checked (ABI dumps, ignoring what the Compose compiler generates) and that the sample compiles against both artifacts. Dart: DevToolsGate.assertMatchesFlavor's rule for a missing define, and the self-gated UI entry points. Co-Authored-By: Claude Opus 5.5 --- .../internal/development/guide/02-packages/11-dev-tools.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/internal/development/guide/02-packages/11-dev-tools.mdx b/docs/internal/development/guide/02-packages/11-dev-tools.mdx index 141c0d9..a069b99 100644 --- a/docs/internal/development/guide/02-packages/11-dev-tools.mdx +++ b/docs/internal/development/guide/02-packages/11-dev-tools.mdx @@ -328,7 +328,9 @@ This note builds the base devtools on Kotlin. Capture lives in `commonMain`, the The no-op module has no devtools logic, but its API still names types from other modules (`SinewHttpHooks` from network, `InspectableStore` from storage, `CrashReporter` from exception, `@Composable` from the Compose runtime). So it depends on `sinew-network`, `sinew-storage`, `sinew-exception` and `compose-runtime`, exactly as the real modules expose them. -**API parity:** CI merges the ABI dumps of `sinew-devtools` and `sinew-devtools-ui` and compares them with `sinew-devtools-noop`'s dump. They must be identical. +**API parity:** Kotlin's built-in ABI validation (`abiValidation()`) is on for the three modules, with reference dumps in each module's `api/`. `checkDevtoolsNoopAbi`, in CI, compares the no-op's JVM, Android and klib dumps with `sinew-devtools`' and `sinew-devtools-ui`'s together, line by line. It ignores the header comments that name the library and what the Compose compiler generates (`ComposableSingletons` lambda holders, `$stable`/`$stableprop`), since the no-op's capture classes are built with Compose and the real `sinew-devtools` isn't. The no-op's stubs fail safe where a value must come back: every name is sensitive, no body is kept, nothing is recorded. + +The sample's four entry points wrap the app in `SinewDevTools`; CI builds the Android production release (the no-op) beside staging (the real one), so the same app code compiles against both. #### Wiring: only in the platform entry points {#kotlin-wiring-only-in-the-platform-entry-points} @@ -461,6 +463,8 @@ abstract final class DevToolsGate { A profile build is release-signed and installable, so `kDebugMode` alone is never the gate. +`assertMatchesFlavor()` throws only when the define names **another** flavor than `appFlavor`. A missing define passes, since devtools are then off and that fails safe (throwing would crash a production build that simply lacks the define), and so does an app without flavors. `SinewDevTools` and `DevToolsMenuItem` also check `DevToolsGate.enabled` themselves, so a `main` that forgot the gate still ships only the app in production. Checked by hand for #46: a release web build of the example with `SINEW_FLAVOR=production` contains no marker; with `staging` it does. + #### Using it {#dart-using-it} ```dart