Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jvm and ios-async-node-ability-to-remove-resolved-async-node #488

Merged

Conversation

sakuntala-motukuri
Copy link
Contributor

@sakuntala-motukuri sakuntala-motukuri commented Aug 12, 2024

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major

Does your PR have any documentation updates?

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

Version

Published prerelease version: 0.9.0-next.7

Changelog

Release Notes

Update Rules Versions (#496)

Update JS Rules to latest Aspect major

Android/JVM - expose constantController (#489)

Expose the core Player constantsController to Android/JVM consumers

AndroidPlayer provides top-level api and plugins access including constantsController with AssetContext

Sample usage:
assetContext.player.constantsController.getConstants(key, namespace)

Storybook Addon Fixes (#449)

  • Re-adds the ability to render Asset properties as a tab in storybook
  • Re-adds the flow-refresh addon
  • Fixes the dependencies & package layout for the storybook addon
  • Fix dark-mode support

[Hermes] Android integration (#410)

Initial integration with the Hermes JavaScript runtime. This shows a tremendous size improvement over the existing J2V8 integration of ~70% (7.6 MB -> 2.3 MB, architecture dependent).

Opt-in

For now, the default runtime integration provided by the Android Player will still be com.intuit.playerui:j2v8-android, but Hermes can be opted in manually by excluding the J2V8 transitive dependency and including the Hermes artifact:

dependencies {
    // Android Player dependency
    implementation("com.intuit.playerui", "android", PLAYER_VERSION) {
        // J2V8 included for release versions
        exclude(group = "com.intuit.playerui", module = "j2v8-android")
        // Debuggable J2V8 included for canary versions
        exclude(group = "com.intuit.playerui", module = "j2v8-android-debug")
    }
    // Override with Hermes runtime
    implementation("com.intuit.playerui", "hermes-android", PLAYER_VERSION)
}

// Exclude J2V8 transitive dependency for all configurations in this module
configurations { 
    all {
        exclude(group = "com.intuit.playerui", module = "j2v8-android")
        // Debuggable J2V8 included for canary versions
        exclude(group = "com.intuit.playerui", module = "j2v8-android-debug")
    }
}

[!TIP]
If your application includes dependencies that may transitively depend on com.intuit.playerui:android, you would likely need to ensure the default runtime is transitively excluded from those as well, either manually or as a global strategy.

The AndroidPlayer will pick the first runtime it finds on the classpath - you can at least verify which runtime was used for the Player with a new log: Player created using $runtime. But that won't tell you for certain if the other runtimes were successfully excluded. You'll need to examine your APK, or your apps dependency tree, to tell for sure that redundant runtimes aren't unintentionally included.

Most of the setup for this integration is done simply by including the right dependency (and excluding the wrong one), however, the hermes-android integration also relies on the SoLoader for loading the native libraries. All that's needed is to initialize the SoLoader (should be on your classpath with the hermes-android dependency) with an Android Context somewhere before you use the AndroidPlayer, potentially in your activities onCreate:

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    SoLoader.init(this, false)
    // ...
}

🚀 Enhancement

🐛 Bug Fix

🏠 Internal

Authors: 7

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 91.77719% with 31 lines in your changes missing coverage. Please review.

Project coverage is 91.95%. Comparing base (ae9a118) to head (32b9c57).
Report is 35 commits behind head on main.

Files with missing lines Patch % Lines
ios/core/Sources/Types/Hooks/Hook.swift 55.55% 20 Missing ⚠️
...ins/async-node/ios/Tests/AsynNodePluginTests.swift 97.90% 6 Missing ⚠️
...ugins/async-node/ios/Sources/AsyncNodePlugin.swift 88.63% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #488      +/-   ##
==========================================
- Coverage   91.97%   91.95%   -0.03%     
==========================================
  Files         340      340              
  Lines       26960    27195     +235     
  Branches     1945     1945              
==========================================
+ Hits        24796    25006     +210     
- Misses       2150     2175      +25     
  Partials       14       14              

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

@sakuntala-motukuri sakuntala-motukuri changed the title Initial code commit jvm and ios-async-node-ability-to-remove-resolved-async-node Aug 13, 2024
@sakuntala-motukuri sakuntala-motukuri requested review from nancywu1 and removed request for nancywu1 August 13, 2024 23:44
sugarmanz
sugarmanz previously approved these changes Aug 26, 2024
@sakuntala-motukuri sakuntala-motukuri requested review from hborawski and sugarmanz and removed request for brocollie08 September 3, 2024 18:37
@sakuntala-motukuri sakuntala-motukuri marked this pull request as ready for review September 3, 2024 19:08
@sakuntala-motukuri sakuntala-motukuri merged commit 71c18c7 into main Sep 3, 2024
10 of 11 checks passed
@sakuntala-motukuri sakuntala-motukuri deleted the jvm-async-node-ability-to-remove-resolved-async-node branch September 3, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants