Skip to content

Cleanup.#513

Merged
Laimiux merged 1 commit into
masterfrom
bezverhni/cleanup
May 21, 2026
Merged

Cleanup.#513
Laimiux merged 1 commit into
masterfrom
bezverhni/cleanup

Conversation

@alexanderbezverhni

Copy link
Copy Markdown
Collaborator

No description provided.

@alexanderbezverhni alexanderbezverhni self-assigned this May 20, 2026

@olive-agent olive-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formula-android/src/main/java/com/instacart/formula/android/RouteId.kt:24

Removing these deprecated Fragment* compatibility aliases and Fragment.getFormulaFragmentId() changes the published formula-android API surface in a breaking way. In particular, deleting getFormulaFragmentId() removes a JVM method that already-compiled consumers can still call, which can turn into NoSuchMethodError until they recompile. The alias removals in this cleanup are also source-breaking for Kotlin callers. If this is intended, it should land as part of the coordinated breaking-release/versioning/docs work; otherwise the deprecated forwarding API should stay in place for now.

@carrotkite

Copy link
Copy Markdown
2 Warnings
⚠️ No coverage data found for com/instacart/formula/android/RouteKey
⚠️ No coverage data found for com/instacart/formula/android/events/RouteLifecycleEvent

JaCoCo Code Coverage 93.83% ✅

Class Covered Meta Status
com/instacart/formula/android/NavigationState 100% 0%
com/instacart/formula/android/RouteId 100% 0%
com/instacart/formula/android/RouteEnvironment 100% 0%
com/instacart/formula/android/RouteOutput 100% 0%
com/instacart/formula/android/RouteKey No coverage data found : -% No coverage data found : -% 🃏
com/instacart/formula/android/FormulaFragment 50% 0%
com/instacart/formula/android/FeaturesBuilder 100% 0%
com/instacart/formula/android/NavigationStore 90% 0%
com/instacart/formula/android/events/RouteLifecycleEvent No coverage data found : -% No coverage data found : -% 🃏
com/instacart/formula/FormulaAndroid 100% 0%

Generated by 🚫 Danger

@carrotkite

Copy link
Copy Markdown

📊 Benchmark Comparison Report

Summary

  • Regressions: 0 ✅
  • Improvements: 22 🎉
  • Unchanged: 3

🎉 Performance Improvements

Benchmark Baseline Current Change
com.instacart.formula.benchmarks.ChildrenInitializationBenchmark.initializeNewChildren (childrenCount=100) 12.175 ± 0.197 us/op 6.796 ± 0.101 us/op -44.2% 🟢
com.instacart.formula.benchmarks.GlobalEffectQueueBenchmark.measure10Effects 0.701 ± 0.012 us/op 0.432 ± 0.005 us/op -38.3% 🟢
com.instacart.formula.benchmarks.ChildrenInitializationBenchmark.initializeNewChildren (childrenCount=25) 3.358 ± 0.039 us/op 2.084 ± 0.042 us/op -38.0% 🟢
com.instacart.formula.benchmarks.GlobalEffectQueueBenchmark.measure1Effect 0.056 ± 0.0 us/op 0.037 ± 0.002 us/op -34.6% 🟢
com.instacart.formula.benchmarks.ActionInitializationBenchmark.initializeNewActions (actionCount=100) 10.936 ± 0.276 us/op 7.575 ± 0.111 us/op -30.7% 🟢
com.instacart.formula.benchmarks.CallbackInitializationBenchmark.initializeNewCallbacks (callbackCount=50) 5.608 ± 1.15 us/op 3.932 ± 0.407 us/op -29.9% 🟢
com.instacart.formula.benchmarks.ActionInitializationBenchmark.initializeNewActions (actionCount=25) 3.286 ± 0.144 us/op 2.305 ± 0.06 us/op -29.8% 🟢
com.instacart.formula.benchmarks.CallbackInitializationBenchmark.initializeNewCallbacks (callbackCount=10) 1.531 ± 0.25 us/op 1.089 ± 0.121 us/op -28.9% 🟢
com.instacart.formula.benchmarks.GlobalEffectQueueBenchmark.measure100Effects 8.032 ± 0.215 us/op 5.816 ± 0.141 us/op -27.6% 🟢
com.instacart.formula.benchmarks.ChildrenCountBenchmark.stateChanges (childrenCount=100) 13.714 ± 0.076 us/op 10.212 ± 0.062 us/op -25.5% 🟢
com.instacart.formula.benchmarks.ChildrenCountBenchmark.stateChanges (childrenCount=25) 12.318 ± 0.658 us/op 9.273 ± 0.101 us/op -24.7% 🟢
com.instacart.formula.benchmarks.TransitionBenchmark.transitions (depth=20) 12.368 ± 0.05 us/op 9.453 ± 0.085 us/op -23.6% 🟢
com.instacart.formula.benchmarks.TransitionBenchmark.transitions (depth=10) 11.851 ± 0.059 us/op 9.099 ± 0.053 us/op -23.2% 🟢
com.instacart.formula.benchmarks.ActionCountBenchmark.stateChanges (actionCount=100) 12.974 ± 0.074 us/op 10.012 ± 0.081 us/op -22.8% 🟢
com.instacart.formula.benchmarks.ChildrenCountBenchmark.stateChanges (childrenCount=1) 11.709 ± 0.376 us/op 9.047 ± 0.114 us/op -22.7% 🟢
com.instacart.formula.benchmarks.TransitionBenchmark.transitions (depth=0) 11.501 ± 0.041 us/op 8.963 ± 0.142 us/op -22.1% 🟢
com.instacart.formula.benchmarks.ActionCountBenchmark.stateChanges (actionCount=25) 11.996 ± 0.058 us/op 9.35 ± 0.177 us/op -22.1% 🟢
com.instacart.formula.benchmarks.ActionCountBenchmark.stateChanges (actionCount=1) 11.603 ± 0.061 us/op 9.065 ± 0.107 us/op -21.9% 🟢
com.instacart.formula.benchmarks.CallbackOverheadBenchmark.transitions (callbackCount=50) 13.936 ± 0.494 us/op 10.902 ± 0.246 us/op -21.8% 🟢
com.instacart.formula.benchmarks.CallbackOverheadBenchmark.transitions (callbackCount=10) 11.955 ± 0.071 us/op 9.378 ± 0.088 us/op -21.6% 🟢
com.instacart.formula.benchmarks.ActionInitializationBenchmark.initializeNewActions (actionCount=1) 0.611 ± 0.053 us/op 0.496 ± 0.021 us/op -18.8% 🟢
com.instacart.formula.benchmarks.ChildrenInitializationBenchmark.initializeNewChildren (childrenCount=1) 0.62 ± 0.053 us/op 0.505 ± 0.055 us/op -18.5% 🟢
No significant changes (3 benchmarks)
Benchmark Baseline Current Change
com.instacart.formula.benchmarks.TransitionQueueBenchmark.measure1 0.32 ± 0.007 us/op 0.32 ± 0.006 us/op -0.1%
com.instacart.formula.benchmarks.TransitionQueueBenchmark.measure100 0.321 ± 0.003 us/op 0.316 ± 0.008 us/op -1.6%
com.instacart.formula.benchmarks.TransitionQueueBenchmark.measure10000 0.328 ± 0.009 us/op 0.318 ± 0.003 us/op -3.0%

Regressions: ±10% with non-overlapping confidence intervals. Improvements: ±10% change only.

Generated by 🚫 Danger

@alexanderbezverhni alexanderbezverhni marked this pull request as ready for review May 20, 2026 21:06
}

private val formulaRouteId: RouteId<*> by lazy {
private val formulaRouteId: RouteId<*> by lazy(LazyThreadSafetyMode.NONE) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only internally used from main thread?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct:

  • 1st call in onCreateView is guaranteed main thread
  • 2nd call in onCreateView (within setContent recomposition) may potentially be non-main, but formulaRouteId should always be already initialized at that point (by the 1st call)
  • setState -> updateVisibleFragments() -> onFragmentViewCreated() - guaranteed main thread
  • setState -> updateVisibleFragments() -> render() - guaranteed main thread due to prior Utils.assertMainThread()

@Laimiux Laimiux merged commit 17dc244 into master May 21, 2026
9 checks passed
@Laimiux Laimiux deleted the bezverhni/cleanup branch May 21, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants