Skip to content

Dejavu

Wait... didn't we just compose this?

CI Maven Central Compose License

Lock in Compose performance. Catch recomposition regressions before your users do.

The Problem

Compose's recomposition behavior is an implicit contract — composables should recompose when their inputs change and stay stable otherwise. But that contract breaks silently, and today's options for catching it are limited:

  • Layout Inspector — manual, requires a running app, can't automate, can't run in CI
  • Manual tracking codeSideEffect counters, LaunchedEffect logging, wrapper composables; invasive, doesn't scale, and ships in your production code
  • Neither gives you a testable, automatable contract you can enforce on every PR

What Dejavu Does

Dejavu is a test-only library that turns recomposition behavior into assertions. Tag your composables with standard Modifier.testTag(), write expectations against recomposition counts, and get structured diagnostics when something changes — whether from a teammate, a library upgrade, an AI agent rewriting your UI code, or a refactor that silently destabilizes a lambda.

  • Zero production code changes — just Modifier.testTag()
  • One-line test setupcreateRecompositionTrackingRule<Activity>()
  • Rich diagnostics — source location, recomposition timeline, parameter diffs, causality analysis
  • Per-instance tracking — multiple instances of the same composable get independent counters

Next Steps