player-ui / player

https://player-ui.github.io
MIT License
73 stars 47 forks source link

Async node android #469

Closed sakuntala-motukuri closed 3 months ago

sakuntala-motukuri commented 3 months ago

This PR accommodates to this requirement https://github.com/player-ui/player/issues/459 i.e Port internal async node plugin implementation to android

Change Type (required)

Indicate the type of change your pull request is: Added a new component as per the following plugins/async-node ├── core │ ├── BUILD │ ├── src │ └── package.json └── jvm ├── BUILD ├── deps.bzl ├── src/main/kotlin/com/intuit/playerui/plugins/asyncnode │ └── AsyncNodePlugin.kt └── src/test/kotlin/com/intuit/playerui/plugins/asyncnode └── AsyncNodePluginTest.kt

All tests are passing in local : image

Does your PR have any documentation updates?

Published prerelease version: 0.9.0-next.2

Changelog ### Release Notes #### Storybook Addon Fixes ([#449](https://github.com/player-ui/player/pull/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](https://github.com/player-ui/player/pull/410)) Initial integration with the [Hermes](https://github.com/facebook/hermes) JavaScript runtime. This shows a tremendous size improvement over the existing [J2V8](https://github.com/eclipsesource/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: ```kotlin 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) } ``` > [!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](https://github.com/facebook/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`: ```kotlin override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) SoLoader.init(this, false) // ... } ``` --- #### 🚀 Enhancement - Storybook Addon Fixes [#449](https://github.com/player-ui/player/pull/449) ([@adierkens](https://github.com/adierkens)) - [Hermes] Android integration [#410](https://github.com/player-ui/player/pull/410) ([@sugarmanz](https://github.com/sugarmanz) [@brocollie08](https://github.com/brocollie08)) #### 🐛 Bug Fix - Async node android [#469](https://github.com/player-ui/player/pull/469) ([@sakuntala-motukuri](https://github.com/sakuntala-motukuri)) #### Authors: 4 - [@brocollie08](https://github.com/brocollie08) - Adam Dierkens ([@adierkens](https://github.com/adierkens)) - Jeremiah Zucker ([@sugarmanz](https://github.com/sugarmanz)) - Niharika Motukuri ([@sakuntala-motukuri](https://github.com/sakuntala-motukuri))
codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.94%. Comparing base (0c12e2a) to head (a1bd8f6).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #469 +/- ## ======================================= Coverage 91.94% 91.94% ======================================= Files 340 340 Lines 26838 26838 Branches 1946 1946 ======================================= + Hits 24675 24677 +2 + Misses 2149 2147 -2 Partials 14 14 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.