@dcl/hooks 2.0.4-20261008193010.commit-84dea9e → 2.0.4-20261008202205.commit-b98aeae
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/esm/contexts/analytics/AnalyticsProvider.js +15 -8
- package/esm/contexts/analytics/AnalyticsProvider.js.map +1 -1
- package/esm/contexts/analytics/types.d.ts +19 -2
- package/esm/contexts/analytics/utils.d.ts +12 -1
- package/esm/contexts/analytics/utils.js +15 -1
- package/esm/contexts/analytics/utils.js.map +1 -1
- package/esm/contexts/index.d.ts +1 -0
- package/esm/contexts/index.js +2 -1
- package/esm/contexts/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
3
|
-
import { isbot } from "isbot";
|
|
4
3
|
import { registerAnalyticsInstance, unregisterAnalyticsInstance, } from "./registry";
|
|
5
|
-
import { resolveApiHost, resolveCdnUrl } from "./utils";
|
|
4
|
+
import { isBotClient, resolveApiHost, resolveCdnUrl } from "./utils";
|
|
6
5
|
// Integration key analytics-next reserves for its own ingestion plugin
|
|
7
6
|
const SEGMENT_IO = "Segment.io";
|
|
8
7
|
const KEEPALIVE_DELIVERY = {
|
|
@@ -11,8 +10,16 @@ const KEEPALIVE_DELIVERY = {
|
|
|
11
10
|
};
|
|
12
11
|
const AnalyticsContext = createContext(null);
|
|
13
12
|
const AnalyticsProvider = (props) => {
|
|
14
|
-
const { writeKey, userId, traits, cdnUrl, apiHost, children } = props;
|
|
13
|
+
const { writeKey, userId, traits, cdnUrl, apiHost, deliveryStrategy, children, } = props;
|
|
15
14
|
const analyticsRef = useRef(null);
|
|
15
|
+
// Kept out of the effect's dependencies: callers tend to pass it as an inline object, which would
|
|
16
|
+
// reload analytics on every render. It only matters at load time.
|
|
17
|
+
// Synced in an effect declared before the load effect, which runs first, so a render React discards
|
|
18
|
+
// never leaks its value into a load.
|
|
19
|
+
const deliveryStrategyRef = useRef(deliveryStrategy);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
deliveryStrategyRef.current = deliveryStrategy;
|
|
22
|
+
});
|
|
16
23
|
// Identifies the run that owns the instance. Advanced synchronously on every run AND on every
|
|
17
24
|
// cleanup, so a load still awaiting its import when the provider is reconfigured or unmounted sees a
|
|
18
25
|
// stale generation and abandons instead of taking over.
|
|
@@ -26,7 +33,7 @@ const AnalyticsProvider = (props) => {
|
|
|
26
33
|
if (!writeKey) {
|
|
27
34
|
console.log("[Analytics] No writeKey provided");
|
|
28
35
|
}
|
|
29
|
-
else if (
|
|
36
|
+
else if (isBotClient(navigator.userAgent)) {
|
|
30
37
|
console.log("[Analytics] Skipping load: bot detected");
|
|
31
38
|
}
|
|
32
39
|
else {
|
|
@@ -45,15 +52,15 @@ const AnalyticsProvider = (props) => {
|
|
|
45
52
|
if (resolvedCdnUrl) {
|
|
46
53
|
settings.cdnURL = resolvedCdnUrl;
|
|
47
54
|
}
|
|
48
|
-
// keepalive lets an event fired right before a navigation (a link click that
|
|
49
|
-
// page in the same tab) finish sending after the page unloads, instead of being
|
|
50
|
-
// with it. analytics-next leaves it off by default.
|
|
55
|
+
// keepalive, the default here, lets an event fired right before a navigation (a link click that
|
|
56
|
+
// loads the next page in the same tab) finish sending after the page unloads, instead of being
|
|
57
|
+
// cancelled with it. analytics-next leaves it off by default.
|
|
51
58
|
const resolvedApiHost = resolveApiHost(apiHost);
|
|
52
59
|
const options = {
|
|
53
60
|
integrations: {
|
|
54
61
|
[SEGMENT_IO]: {
|
|
55
62
|
...(resolvedApiHost ? { apiHost: resolvedApiHost } : {}),
|
|
56
|
-
deliveryStrategy: KEEPALIVE_DELIVERY,
|
|
63
|
+
deliveryStrategy: deliveryStrategyRef.current ?? KEEPALIVE_DELIVERY,
|
|
57
64
|
},
|
|
58
65
|
},
|
|
59
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsProvider.js","sourceRoot":"","sources":["../../../src/contexts/analytics/AnalyticsProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EACb,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AAMd,OAAO,
|
|
1
|
+
{"version":3,"file":"AnalyticsProvider.js","sourceRoot":"","sources":["../../../src/contexts/analytics/AnalyticsProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EACb,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AAMd,OAAO,EACL,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAOpE,uEAAuE;AACvE,MAAM,UAAU,GAAG,YAAY,CAAA;AAE/B,MAAM,kBAAkB,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;CACnB,CAAA;AAEV,MAAM,gBAAgB,GAAG,aAAa,CAA8B,IAAI,CAAC,CAAA;AAEzE,MAAM,iBAAiB,GAAqC,CAC1D,KAA6B,EAC7B,EAAE;IACF,MAAM,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,QAAQ,GACT,GAAG,KAAK,CAAA;IACT,MAAM,YAAY,GAAG,MAAM,CAA0B,IAAI,CAAC,CAAA;IAC1D,kGAAkG;IAClG,kEAAkE;IAClE,oGAAoG;IACpG,qCAAqC;IACrC,MAAM,mBAAmB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACpD,SAAS,CAAC,GAAG,EAAE;QACb,mBAAmB,CAAC,OAAO,GAAG,gBAAgB,CAAA;IAChD,CAAC,CAAC,CAAA;IACF,8FAA8F;IAC9F,qGAAqG;I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,EAAE,CAAC,EACtE,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAC/B,CAAA;IAED,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC3C,QAAQ,GACiB,CAC7B,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type { EventProperties } from "@segment/analytics-next";
|
|
1
|
+
import type { EventProperties, InitOptions } from "@segment/analytics-next";
|
|
2
|
+
type SegmentIoOptions = Exclude<NonNullable<NonNullable<InitOptions["integrations"]>["Segment.io"]>, boolean>;
|
|
3
|
+
/** How analytics-next's Segment.io integration sends events: standard (one request per event) or batching. */
|
|
4
|
+
type AnalyticsDeliveryStrategy = NonNullable<SegmentIoOptions["deliveryStrategy"]>;
|
|
2
5
|
type AnalyticsProviderProps = {
|
|
3
6
|
writeKey: string;
|
|
4
7
|
userId?: string;
|
|
@@ -18,6 +21,20 @@ type AnalyticsProviderProps = {
|
|
|
18
21
|
* The provider maps it to the `apiHost` setting of analytics-next's own `Segment.io` integration.
|
|
19
22
|
*/
|
|
20
23
|
apiHost?: string;
|
|
24
|
+
/**
|
|
25
|
+
* How events are delivered. Defaults to standard delivery with `keepalive`, so an event fired right before a
|
|
26
|
+
* same-tab navigation still goes out. Browsers cap all in-flight keepalive requests of a page at 64KB, so an app
|
|
27
|
+
* that sends large or very frequent events can pass its own strategy, e.g. `{ strategy: "batching" }`.
|
|
28
|
+
*
|
|
29
|
+
* A strategy replaces the default entirely: `{ strategy: "standard", config: { priority: "high" } }` turns
|
|
30
|
+
* keepalive off. Batching already flushes with keepalive when the page unloads, so it normally does not lose an event
|
|
31
|
+
* fired right before a navigation. The unload flush shares the same 64KB cap, though, so a large batch `size` or
|
|
32
|
+
* large payloads can still drop part of it; adding `keepalive: true` to batching makes every batch a keepalive
|
|
33
|
+
* request and brings the 64KB pressure back for the whole session.
|
|
34
|
+
*
|
|
35
|
+
* Read when analytics loads: changing it afterwards does not reload analytics.
|
|
36
|
+
*/
|
|
37
|
+
deliveryStrategy?: AnalyticsDeliveryStrategy;
|
|
21
38
|
children: React.ReactNode;
|
|
22
39
|
};
|
|
23
40
|
type TrackPayload = EventProperties;
|
|
@@ -34,4 +51,4 @@ type AnalyticsContextType = {
|
|
|
34
51
|
identify: (userId: string, traits?: Record<string, unknown>) => void;
|
|
35
52
|
page: (name: string, props?: Record<string, unknown>) => void;
|
|
36
53
|
};
|
|
37
|
-
export { type AnalyticsProviderProps, type TrackPayload, type AnalyticsContextType, };
|
|
54
|
+
export { type AnalyticsDeliveryStrategy, type AnalyticsProviderProps, type TrackPayload, type AnalyticsContextType, };
|
|
@@ -9,4 +9,15 @@ declare function resolveCdnUrl(cdnUrl?: string): string | undefined;
|
|
|
9
9
|
* Returns `undefined` when unset or invalid, which keeps the default.
|
|
10
10
|
*/
|
|
11
11
|
declare function resolveApiHost(apiHost?: string): string | undefined;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Whether the current client is a crawler or another bot, which the provider never loads analytics for. Exported so
|
|
14
|
+
* code that sends events without the provider (a beacon fired before analytics loads) applies the same rule instead
|
|
15
|
+
* of depending on `isbot` itself.
|
|
16
|
+
*
|
|
17
|
+
* The user agent is required and never read from the runtime: in a browser pass `navigator.userAgent`, on a server
|
|
18
|
+
* the request's header. A server fallback would read Node's own `Node.js/<major>` agent (Node 21+), which `isbot`
|
|
19
|
+
* flags. A missing user agent (`null`, `undefined` or empty) is not treated as a bot, stated here rather than left to
|
|
20
|
+
* whatever `isbot` returns for an empty string, which a minor release could change.
|
|
21
|
+
*/
|
|
22
|
+
declare function isBotClient(userAgent: string | null | undefined): boolean;
|
|
23
|
+
export { isBotClient, resolveApiHost, resolveCdnUrl };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isbot } from "isbot";
|
|
1
2
|
const PROTOCOL_PREFIX = /^[a-z][a-z0-9+.-]*:\/\//i;
|
|
2
3
|
const TRAILING_SLASHES = /\/+$/;
|
|
3
4
|
/**
|
|
@@ -47,5 +48,18 @@ function resolveApiHost(apiHost) {
|
|
|
47
48
|
return (resolved &&
|
|
48
49
|
`${resolved.host}${resolved.pathname}`.replace(TRAILING_SLASHES, ""));
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Whether the current client is a crawler or another bot, which the provider never loads analytics for. Exported so
|
|
53
|
+
* code that sends events without the provider (a beacon fired before analytics loads) applies the same rule instead
|
|
54
|
+
* of depending on `isbot` itself.
|
|
55
|
+
*
|
|
56
|
+
* The user agent is required and never read from the runtime: in a browser pass `navigator.userAgent`, on a server
|
|
57
|
+
* the request's header. A server fallback would read Node's own `Node.js/<major>` agent (Node 21+), which `isbot`
|
|
58
|
+
* flags. A missing user agent (`null`, `undefined` or empty) is not treated as a bot, stated here rather than left to
|
|
59
|
+
* whatever `isbot` returns for an empty string, which a minor release could change.
|
|
60
|
+
*/
|
|
61
|
+
function isBotClient(userAgent) {
|
|
62
|
+
return userAgent ? isbot(userAgent) : false;
|
|
63
|
+
}
|
|
64
|
+
export { isBotClient, resolveApiHost, resolveCdnUrl };
|
|
51
65
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/contexts/analytics/utils.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,0BAA0B,CAAA;AAClD,MAAM,gBAAgB,GAAG,MAAM,CAAA;AAE/B;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAY,EAAE,KAAa;IAC7C,IAAI,QAAa,CAAA;IAEjB,IAAI,CAAC;QACH,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACjD,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,OAAO,CAAC,IA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AAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,OAAO,EAAE,CAC/D,CAAA;IAED,OAAO,CACL,QAAQ;QACR,GAAG,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CACrE,CAAA;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,WAAW,CAAC,SAAoC;IACvD,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC7C,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,CAAA"}
|
package/esm/contexts/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./analytics/AnalyticsProvider";
|
|
2
2
|
export { getAnalytics } from "./analytics/registry";
|
|
3
|
+
export { isBotClient } from "./analytics/utils";
|
|
3
4
|
export type * from "./analytics/types";
|
|
4
5
|
export * from "./translation/TranslationContext";
|
|
5
6
|
export * from "./translation/TranslationProvider";
|
package/esm/contexts/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./analytics/AnalyticsProvider";
|
|
2
|
-
// Only the reader is public: registering is the provider's business.
|
|
2
|
+
// Only the registry's reader is public: registering is the provider's business.
|
|
3
3
|
export { getAnalytics } from "./analytics/registry";
|
|
4
|
+
export { isBotClient } from "./analytics/utils";
|
|
4
5
|
export * from "./translation/TranslationContext";
|
|
5
6
|
export * from "./translation/TranslationProvider";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,gFAAgF;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,cAAc,kCAAkC,CAAA;AAChD,cAAc,mCAAmC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/hooks",
|
|
3
|
-
"version": "2.0.4-
|
|
3
|
+
"version": "2.0.4-20261008202205.commit-b98aeae",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "esm/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"<rootDir>/test/setup.ts"
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
|
-
"commit": "
|
|
83
|
+
"commit": "b98aeae831cbc9a590e9505fc94f027c87ed43f1"
|
|
84
84
|
}
|