apps 0.0.1-beta.48 → 0.0.1-beta.54
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/framework-reference.json +1 -1
- package/js/client.js +19 -5
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/telemetry/src/browser.d.ts +6 -1
package/js/client.js
CHANGED
|
@@ -476,6 +476,8 @@ var browserTelemetryLayer = (settings) => Layer_exports.unwrap(
|
|
|
476
476
|
const onError = (event) => error("ui.error", event.error ?? new Error(event.message));
|
|
477
477
|
const onRejection = (event) => error("ui.unhandled-rejection", event.reason);
|
|
478
478
|
const onHidden = () => {
|
|
479
|
+
if (navigation !== void 0 && document.visibilityState === "hidden")
|
|
480
|
+
navigation.hidden = true;
|
|
479
481
|
run(
|
|
480
482
|
document.visibilityState === "hidden" ? performance.pause.pipe(Effect_exports.andThen(flush)) : performance.resume
|
|
481
483
|
);
|
|
@@ -503,15 +505,27 @@ var browserTelemetryLayer = (settings) => Layer_exports.unwrap(
|
|
|
503
505
|
return {
|
|
504
506
|
flush,
|
|
505
507
|
navigation: (event) => Effect_exports.sync(() => {
|
|
508
|
+
if (event.type === "load") return;
|
|
506
509
|
if (event.type === "end") {
|
|
507
|
-
if (navigation !== void 0) Deferred_exports.doneUnsafe(navigation, Effect_exports.void);
|
|
510
|
+
if (navigation !== void 0) Deferred_exports.doneUnsafe(navigation.done, Effect_exports.void);
|
|
508
511
|
navigation = void 0;
|
|
509
512
|
return;
|
|
510
513
|
}
|
|
511
|
-
if (navigation !== void 0)
|
|
512
|
-
|
|
514
|
+
if (navigation !== void 0)
|
|
515
|
+
Deferred_exports.doneUnsafe(navigation.done, Effect_exports.interrupt);
|
|
516
|
+
const current = {
|
|
517
|
+
done: Deferred_exports.makeUnsafe(),
|
|
518
|
+
hidden: document.visibilityState === "hidden"
|
|
519
|
+
};
|
|
520
|
+
navigation = current;
|
|
513
521
|
run(
|
|
514
|
-
Deferred_exports.await(
|
|
522
|
+
Deferred_exports.await(current.done).pipe(
|
|
523
|
+
// Record visibility however the navigation ends, including when a later one interrupts it.
|
|
524
|
+
Effect_exports.ensuring(
|
|
525
|
+
Effect_exports.suspend(
|
|
526
|
+
() => Effect_exports.annotateCurrentSpan("executor.navigation.hidden", current.hidden)
|
|
527
|
+
)
|
|
528
|
+
),
|
|
515
529
|
Effect_exports.withSpan("ui.navigation", {
|
|
516
530
|
root: true,
|
|
517
531
|
attributes: { "url.path": event.path }
|
|
@@ -521,7 +535,7 @@ var browserTelemetryLayer = (settings) => Layer_exports.unwrap(
|
|
|
521
535
|
);
|
|
522
536
|
}).pipe(
|
|
523
537
|
Effect_exports.andThen(
|
|
524
|
-
event.type === "
|
|
538
|
+
event.type === "end" ? Effect_exports.void : performance.navigation(event.path)
|
|
525
539
|
)
|
|
526
540
|
)
|
|
527
541
|
};
|