release(harmony): SDK 0.4.0 — axios integration and a network-stack-agnostic entry point - #22
Merged
Merged
Conversation
Bumps the four SDK packages to 0.4.0 and records the changes shipped since 0.3.2. The minor rather than the patch position: this release removes `FlashcatHttp.hostOf()`. A patch number would hide a removal from anyone who upgrades without reading the changelog. Version numbers live in three places — the oh-package manifests with their inter-package pins, Version.ets, and the test fixtures carrying the version string — and all three move together here.
Applications using axios had to copy an interceptor file into their own repository and keep it there. `@flashcatcloud/axios` makes the integration one call — `trackAxios(instance)` — with nothing to vendor and nothing to re-sync when the SDK changes. Its own package rather than part of trace: axios is a third-party dependency, and folding it into `@flashcatcloud/trace` would make every user of that package install axios whether or not they use it. This mirrors the Android SDK, which ships an integration module per third-party library rather than pulling them into the core. The package is a thin layer over `startTracedResource` — resolving the url axios will actually request, copying the returned headers onto the config, and carrying the resource key between the request and response interceptors. Every rule that matters stays in the SDK. Also here, because both ship with this release: - `flashcat-rum/README.md` called `FlashcatRum.startView()`, which does not exist on that class. READMEs travel inside the published package, so anyone following the quickstart hit a compile error. Corrected to `GlobalRumMonitor.get().startView()`. - The headless test runner learned the new module and how to resolve `@flashcatcloud/trace`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps the SDK packages to
0.4.0and adds a fifth published package.Why the minor position
This release removes
FlashcatHttp.hostOf(). A patch number would hide a removal from anyone who upgrades without reading the changelog.What ships
@flashcatcloud/axios— new package. Reports every request made through an@ohos/axiosinstance as a RUM resource, with the distributed-trace headers attached:axios routes through its own
@ohos.net.httpadapter, which neither the rcp interceptor norFlashcatHttpobserves. Applications previously had to copy an interceptor file into their own repository and keep it in sync. Its own package rather than part oftrace, because folding a third-party dependency in there would make every user of that package install axios — the same reason the Android SDK ships an integration module per library instead of pulling them into the core.@flashcatcloud/traceFlashcatTrace.startTracedResource(url, method, injectTrace?)+stopTracedResource/failTracedResource: report a request as a RUM resource from any network stack the SDK cannot instrument itself. Consent and first-party gating, sampled-only trace correlation and the decimal_dd.span_idencoding are handled inside the SDK. RequiressetTrackNetworkRequests(true), like every other network path. The axios package is a thin layer over this; ky and custom stacks use it directly.FlashcatHttpbuilds on the same entry point instead of duplicating the logic.FlashcatHttp.hostOf()removed — host parsing moved behind the first-party gate and the method had no callers left. It was a URL helper on a public class with no SDK state behind it.@flashcatcloud/rum—README.mdcalledFlashcatRum.startView(), which does not exist on that class. READMEs travel inside the published package, so anyone following the quickstart hit a compile error. Corrected toGlobalRumMonitor.get().startView().coreandcrashare lockstep bumps.Verification
assembleHapclean.@flashcatcloud/axiosas a package rather than a local file: two requests, two resources with the full url and statuses 200 and 404. Each_dd.span_idis the decimal form of the span in thetraceparentthe device actually sent, each trace flagged sampled, and no network error event for the 404.sdk_version:0.4.0.Version strings live in three places — the oh-package manifests with their inter-package pins,
Version.ets, and the test fixtures — and all move together here.HARMONY_MODULESin the publish workflow gainedflashcat_axios.Publishing is a separate manual step.