@cloudcare/hvigor-ohos-plugin 0.1.0 → 0.1.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -2
- package/README.md +32 -17
- package/hvigorCompile/ft-cold-launch-transform.ts +595 -192
- package/hvigorCompile/ft-console-log-transform.ts +72 -176
- package/hvigorCompile/ft-generated-names.ts +19 -0
- package/hvigorCompile/ft-lexical-scope.ts +65 -0
- package/hvigorCompile/ft-session-replay-transform.ts +363 -0
- package/hvigorCompile/ft-source-transform-host.ts +135 -0
- package/hvigorCompile/ft-transform-context.ts +36 -0
- package/hvigorCompile/ft-web-replay-transform.ts +51 -0
- package/index.js +7 -7
- package/package.json +13 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.2-alpha.1] - 2026-10-19
|
|
4
|
+
|
|
5
|
+
- Added automatic Session Replay integration for supported ArkUI `@Entry` pages, ArkWeb components and touch events, without manual page registration or event forwarding. Requires `@guancecloud/ft_session_replay` in the HAP and Replay initialization; touch coordinates require `TouchPrivacy.SHOW`.
|
|
6
|
+
- Added automatic recording of Router page-switch animations for Session Replay, including slide and fade effects. Default system animations may differ during playback.
|
|
7
|
+
- Fixed build/runtime errors and missing log arguments when automatic console/HiLog collection is enabled.
|
|
8
|
+
- Fixed cold-launch instrumentation for inherited UIAbilities and InsightIntent entries, preserving existing lifecycle callbacks. Apps without an AbilityStage now use approximate application-initialization timing.
|
|
9
|
+
- Fixed build errors and repeated execution of page `.id()` expressions caused by automatic Replay collection.
|
|
10
|
+
- Changed automatic collection to run only in modules that declare the required SDK packages in their own `oh-package.json5` `dependencies`; other modules are left unchanged.
|
|
11
|
+
- Fixed automatic logging, cold-launch or Replay code being omitted from some application modules when multiple HAP modules are built together.
|
|
12
|
+
|
|
13
|
+
## [0.1.1] - 2026-09-14
|
|
14
|
+
|
|
15
|
+
- Fixed console/HiLog instrumentation being skipped when cold-launch instrumentation is enabled in the same Hvigor plugin.
|
|
16
|
+
|
|
3
17
|
## [0.1.0] - 2026-09-14
|
|
4
18
|
|
|
5
19
|
- Added compiler instrumentation for automatic console/HiLog collection.
|
|
@@ -17,5 +31,3 @@
|
|
|
17
31
|
## [0.1.0-alpha.1] - 2026-09-11
|
|
18
32
|
|
|
19
33
|
- Prepared the initial npm prerelease of the console/HiLog and cold-launch instrumentation plugin.
|
|
20
|
-
|
|
21
|
-
|
package/README.md
CHANGED
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
# Guance HarmonyOS Hvigor Plugin
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@cloudcare/hvigor-ohos-plugin)
|
|
4
4
|
|
|
5
|
-
`@cloudcare/hvigor-ohos-plugin`
|
|
5
|
+
`@cloudcare/hvigor-ohos-plugin` adds automatic console/HiLog collection, cold-launch tracking, and Session Replay support for eligible ArkUI `@Entry` pages. Application files are not modified on disk.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
This is a Hvigor tool package, so declare it in the project-level `hvigor/hvigor-config.json5` rather than a module `oh-package.json5`:
|
|
7
|
+
The plugin adds build-time instrumentation but does not enable collection by itself. Enable console/HiLog collection with `FTLoggerConfig.setEnableConsoleLog(true)`. To use Session Replay, declare `@guancecloud/ft_session_replay` and initialize `FTSessionReplay` after the core SDK and RUM; the plugin then connects supported page visibility, touch, Router transition, and ArkWeb events to Replay automatically.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@cloudcare/hvigor-ohos-plugin": "0.1.0"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
```
|
|
9
|
+
## Install
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
This is a Hvigor tool package, so declare it in the project-level `hvigor/hvigor-config.json5` rather than a module `oh-package.json5`. Replace `<latest-version>` with the latest published version that supports the features you use, including a prerelease when needed:
|
|
20
12
|
|
|
21
13
|
```json5
|
|
22
14
|
{
|
|
23
15
|
"dependencies": {
|
|
24
|
-
"@cloudcare/hvigor-ohos-plugin": "
|
|
16
|
+
"@cloudcare/hvigor-ohos-plugin": "latest"
|
|
25
17
|
}
|
|
26
18
|
}
|
|
27
19
|
```
|
|
@@ -38,10 +30,33 @@ export default {
|
|
|
38
30
|
}
|
|
39
31
|
```
|
|
40
32
|
|
|
41
|
-
The plugin preserves the original console/HiLog output
|
|
33
|
+
The plugin preserves the original console/HiLog output, reports its installed version through `sdk_pkg_info.track`, and collects cold-launch timing automatically. Do not add manual cold-launch timing calls to application code.
|
|
34
|
+
|
|
35
|
+
Configure an `AbilityStage` as the HAP module's `srcEntry` for accurate application-initialization timing. Without an `AbilityStage`, initialization timing is approximate.
|
|
36
|
+
|
|
37
|
+
## Automatic Session Replay
|
|
38
|
+
|
|
39
|
+
When the HAP declares `@guancecloud/ft_session_replay`, the plugin automatically registers supported `@Entry` pages and tracks their visibility. Existing root IDs and callbacks are preserved. Session Replay collection is not enabled when the Replay package is absent.
|
|
40
|
+
|
|
41
|
+
When both `@guancecloud/ft_sdk` and `@guancecloud/ft_session_replay` are declared, the plugin automatically associates ArkUI `Web` components with their controllers so supported ArkWeb content is linked to the correct Replay page. No manual Web component ID or controller registration is required.
|
|
42
|
+
|
|
43
|
+
Replay initialization, sampling, privacy settings, and page-change notifications are documented in the `@guancecloud/ft_session_replay` README.
|
|
44
|
+
|
|
45
|
+
The plugin automatically captures page touch events without changing existing `onTouch` behavior. Touch coordinates are recorded only when `TouchPrivacy.SHOW` is configured.
|
|
46
|
+
|
|
47
|
+
Router page changes and explicit `PageTransitionEnter/Exit` slide and opacity animations are captured automatically. Existing transition callbacks are preserved; playback of default system transitions may be approximate.
|
|
42
48
|
|
|
43
49
|
## Compatibility
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
The plugin is verified with Node.js 18 or newer, Hvigor and `@ohos/hvigor-ohos-plugin` 6.23.5, and HarmonyOS SDK 6.0.2 (API 22). Console/HiLog and cold-launch instrumentation require `@guancecloud/ft_sdk` `0.1.17` or later. Automatic Session Replay additionally requires `@guancecloud/ft_sdk` `0.1.18` or later and `@guancecloud/ft_session_replay` `0.1.0` or later.
|
|
52
|
+
|
|
53
|
+
`@ohos/hvigor-ohos-plugin` is supplied by DevEco Studio's Hvigor runtime.
|
|
54
|
+
|
|
55
|
+
Each module that needs automatic collection must declare these SDK packages under `dependencies` in its own `oh-package.json5`:
|
|
56
|
+
|
|
57
|
+
- `@guancecloud/ft_sdk`: required for console/HiLog and cold-launch collection.
|
|
58
|
+
- `@guancecloud/ft_session_replay`: additionally required for Session Replay.
|
|
59
|
+
|
|
60
|
+
The plugin checks SDK dependencies in the `oh-package.json5` of the module that contains each source file (HAP, HAR or HSP). Declaring an SDK only in the project-root `oh-package.json5`, another module, or `devDependencies` does not enable automatic collection for that source file.
|
|
46
61
|
|
|
47
|
-
|
|
62
|
+
Optional logging calls such as `console?.info(...)` and `hilog.info?.(...)` are not automatically collected.
|