Skip to content

Revert "Asset deprecation (#639)" + add async hydration tracker plugin as default#676

Merged
sugarmanz merged 7 commits intomainfrom
fix-async-tracker-logs
Jul 10, 2025
Merged

Revert "Asset deprecation (#639)" + add async hydration tracker plugin as default#676
sugarmanz merged 7 commits intomainfrom
fix-async-tracker-logs

Conversation

@sugarmanz
Copy link
Copy Markdown
Member

@sugarmanz sugarmanz commented Jul 8, 2025

Since SuspendableAsset was deprecated (in #639), consumers will need to add a AsyncHydrationTrackerPlugin to enable tracking of asset rendering state. This plugin is used directly in DecodableAsset code, and if it's not found, will log a warning. It's not a real warning, and should be disabled to limit noise in logs. We could enable conditional logging in findPlugin, or make AsyncHydrationTrackerPlugin a default plugin — for the sake of simplicity, this PR opts for the latter.

Unfortunately, through integration, #639 was identified as a performance detractor (opened #678). This PR also reverts that change to the original API, which would be a breaking change.

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major
  • N/A

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

Release Notes

  • Revert Asset deprecation #639 for performance reasons
  • AsyncHydrationTrackerPlugin is now a default AndroidPlayerPlugin
📦 Published PR as canary version: 0.12.0--canary.676.24246

Try this version out locally by upgrading relevant packages to 0.12.0--canary.676.24246

@sugarmanz sugarmanz requested a review from brocollie08 as a code owner July 8, 2025 08:22
@sugarmanz sugarmanz force-pushed the fix-async-tracker-logs branch from e9bc561 to 162f4fc Compare July 8, 2025 08:24
@sugarmanz sugarmanz force-pushed the fix-async-tracker-logs branch 2 times, most recently from cb285f0 to ef39da2 Compare July 8, 2025 08:26
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.36%. Comparing base (30e3510) to head (61a260a).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #676   +/-   ##
=======================================
  Coverage   90.36%   90.36%           
=======================================
  Files         333      333           
  Lines       20654    20654           
  Branches     2010     2010           
=======================================
  Hits        18664    18664           
  Misses       1974     1974           
  Partials       16       16           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sugarmanz sugarmanz force-pushed the fix-async-tracker-logs branch from b165e86 to 2f63369 Compare July 9, 2025 01:25
Comment on lines +117 to +123
androidPlayer.hooks.viewController.tap { viewController ->
viewController?.hooks?.view?.tap { view ->
view?.hooks?.onUpdate?.tap { _ ->
synchronized(trackedHydrations) {
trackedHydrations.clear()
}
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Unfortunately, androidPlayer.onUpdate triggers asset decoding logic, which isn't needed for this plugin and causes some redundant logs. This is more verbose, but more targeted and trims redundant operations. Really, it would be great to encapsulate the asset decoding lifecycle as another hook to tap.

fun basic() {
launchMock("badge-all")

androidComposeRule.waitForIdle()
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤞

sugarmanz added 2 commits July 8, 2025 23:34
* Revert "Asset deprecation (#639)"

This reverts commit db7a8c6.

* lint and keep tracker log fix

* keep log reduction
@sugarmanz sugarmanz changed the title add async hydration tracker plugin as default Revert "Asset deprecation (#639)" + add async hydration tracker plugin as default Jul 9, 2025
@sugarmanz sugarmanz added the minor Increment the minor version when merged label Jul 9, 2025
@sugarmanz
Copy link
Copy Markdown
Member Author

/canary

@KetanReddy
Copy link
Copy Markdown
Member

Are we aware of why the deprecation in #639 was a performance detractor?

@sugarmanz sugarmanz merged commit 7bf3cf8 into main Jul 10, 2025
11 checks passed
@sugarmanz sugarmanz deleted the fix-async-tracker-logs branch July 10, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants