@cloudcare/hvigor-ohos-plugin 0.1.1 → 0.1.2-alpha.2
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 +15 -1
- package/README.md +53 -6
- package/hvigorCompile/ft-cold-launch-transform.ts +668 -121
- package/hvigorCompile/ft-console-log-transform.ts +90 -96
- package/hvigorCompile/ft-generated-names.ts +19 -0
- package/hvigorCompile/ft-lexical-scope.ts +65 -0
- package/hvigorCompile/ft-session-replay-transform.ts +381 -0
- package/hvigorCompile/ft-source-transform-host.ts +112 -23
- package/hvigorCompile/ft-transform-context.ts +91 -0
- package/hvigorCompile/ft-web-replay-transform.ts +61 -0
- package/index.js +5 -3
- package/package.json +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.2-alpha.2] - 2026-10-30
|
|
4
|
+
|
|
5
|
+
- Added build warnings with feature names, source paths, skip reasons and source locations for Console/HiLog, cold-launch lifecycle hooks, Session Replay root registration and ArkWeb binding.
|
|
6
|
+
- Fixed automatic Session Replay page registration being skipped on pages that use UI enum values or `ForEach`/`LazyForEach`/`Repeat` child blocks, which could leave native View/Action events without `session_has_replay`.
|
|
7
|
+
|
|
8
|
+
## [0.1.2-alpha.1] - 2026-10-19
|
|
9
|
+
|
|
10
|
+
- 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`.
|
|
11
|
+
- Added automatic recording of Router page-switch animations for Session Replay, including slide and fade effects. Default system animations may differ during playback.
|
|
12
|
+
- Fixed build/runtime errors and missing log arguments when automatic console/HiLog collection is enabled.
|
|
13
|
+
- Fixed cold-launch instrumentation for inherited UIAbilities and InsightIntent entries, preserving existing lifecycle callbacks. Apps without an AbilityStage now use approximate application-initialization timing.
|
|
14
|
+
- Fixed build errors and repeated execution of page `.id()` expressions caused by automatic Replay collection.
|
|
15
|
+
- 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.
|
|
16
|
+
- Fixed automatic logging, cold-launch or Replay code being omitted from some application modules when multiple HAP modules are built together.
|
|
17
|
+
|
|
3
18
|
## [0.1.1] - 2026-09-14
|
|
4
19
|
|
|
5
20
|
- Fixed console/HiLog instrumentation being skipped when cold-launch instrumentation is enabled in the same Hvigor plugin.
|
|
@@ -21,4 +36,3 @@
|
|
|
21
36
|
## [0.1.0-alpha.1] - 2026-09-11
|
|
22
37
|
|
|
23
38
|
- Prepared the initial npm prerelease of the console/HiLog and cold-launch instrumentation plugin.
|
|
24
|
-
|
package/README.md
CHANGED
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
|
|
3
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
|
+
|
|
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.
|
|
6
8
|
|
|
7
9
|
## Install
|
|
8
10
|
|
|
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
|
|
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:
|
|
10
12
|
|
|
11
13
|
```json5
|
|
12
14
|
{
|
|
13
15
|
"dependencies": {
|
|
14
|
-
"@cloudcare/hvigor-ohos-plugin": "
|
|
16
|
+
"@cloudcare/hvigor-ohos-plugin": "latest"
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
```
|
|
@@ -28,10 +30,55 @@ export default {
|
|
|
28
30
|
}
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
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.
|
|
48
|
+
|
|
49
|
+
## Build diagnostics
|
|
50
|
+
|
|
51
|
+
Search for `[GuanceBuild]` in DevEco Studio's Build output or `.hvigor/outputs/build-logs/build.log` to find instrumentation warnings. Each warning includes a feature name, source path, one-based line and column, skip reason, and explanation. These build-time warnings do not depend on `FTSDKConfig.setDebug(...)`.
|
|
52
|
+
|
|
53
|
+
| Filter | Feature | Feature-specific skip reasons |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| `[GuanceLog]` | Console/HiLog collection | `unsupported-log-call`: optional calls, missing HiLog arguments, or an unusable compiler source range |
|
|
56
|
+
| `[GuanceColdLaunch]` | AbilityStage/UIAbility/InsightIntent lifecycle and first-frame hooks | `unresolved-ability-base`: a declared module entry's platform base cannot be resolved; `unsupported-lifecycle`: no instrumentable method/function body; `unsupported-lifecycle-parameters`: unsupported launch or WindowStage parameters |
|
|
57
|
+
| `[GuanceReplay]` | Session Replay `@Entry` page root registration | `unsupported-parser`, `missing-build`, `unsupported-root` |
|
|
58
|
+
| `[GuanceWebReplay]` | ArkWeb controller binding | `unsupported-web-call`: a `Web` call is optional, has a spread argument, or does not have exactly one options argument |
|
|
59
|
+
|
|
60
|
+
All four features report `parse-error` when a relevant source file cannot be parsed, including the first compiler diagnostic and the number of additional parse errors. Unexpected transform exceptions report `transform-exception` and retain the original build failure. When an exception has no source position, its location is the file's `1:1`.
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
[GuanceBuild][GuanceReplay] /project/entry/src/main/ets/pages/Example.ets:12:19: feature=session-replay-root; reason=parse-error; TS1109: Expression expected.
|
|
64
|
+
[GuanceBuild][GuanceColdLaunch] /project/entry/src/main/ets/entryability/EntryAbility.ets:18:3: feature=cold-launch; reason=unsupported-lifecycle-parameters; onWindowStageCreate requires a named WindowStage parameter for automatic first-frame observation.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Warnings do not fail the build by themselves. Unsupported calls/hooks are left unchanged while other supported hooks can still be applied; a parse failure skips that feature's transformation for the file. Application files are never modified on disk. Locations refer to the original source when available; a warning explicitly identifies any location that refers to transformed source instead. Identical warnings are deduplicated per feature and source location within the active compilation.
|
|
68
|
+
|
|
69
|
+
Modules without the required runtime dependencies, files with no matching calls/classes/pages, and locally shadowed names are skipped without warnings. The plugin does not infer that an arbitrary unresolved business class is an Ability. After updating the plugin, rebuild the application so the source transforms execute again. Existing `ArkTS:WARN` compiler diagnostics remain independent of these plugin warnings.
|
|
32
70
|
|
|
33
71
|
## Compatibility
|
|
34
72
|
|
|
35
|
-
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).
|
|
73
|
+
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.
|
|
74
|
+
|
|
75
|
+
`@ohos/hvigor-ohos-plugin` is supplied by DevEco Studio's Hvigor runtime.
|
|
76
|
+
|
|
77
|
+
Each module that needs automatic collection must declare these SDK packages under `dependencies` in its own `oh-package.json5`:
|
|
78
|
+
|
|
79
|
+
- `@guancecloud/ft_sdk`: required for console/HiLog and cold-launch collection.
|
|
80
|
+
- `@guancecloud/ft_session_replay`: additionally required for Session Replay.
|
|
81
|
+
|
|
82
|
+
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.
|
|
36
83
|
|
|
37
|
-
|
|
84
|
+
Optional logging calls such as `console?.info(...)` and `hilog.info?.(...)` are not automatically collected and produce `unsupported-log-call` warnings.
|