@squide/firefly 12.0.4 → 13.0.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/honeycomb/activeSpan.d.ts +12 -0
  3. package/dist/honeycomb/activeSpan.js +105 -0
  4. package/dist/honeycomb/activeSpan.js.map +1 -0
  5. package/dist/honeycomb/canRegisterHoneycombInstrumentation.d.ts +1 -0
  6. package/dist/honeycomb/canRegisterHoneycombInstrumentation.js +11 -0
  7. package/dist/honeycomb/canRegisterHoneycombInstrumentation.js.map +1 -0
  8. package/dist/honeycomb/createTraceContextId.d.ts +1 -0
  9. package/dist/honeycomb/createTraceContextId.js +16 -0
  10. package/dist/honeycomb/createTraceContextId.js.map +1 -0
  11. package/dist/honeycomb/initializeHoneycomb.d.ts +2 -0
  12. package/dist/honeycomb/initializeHoneycomb.js +25 -0
  13. package/dist/honeycomb/initializeHoneycomb.js.map +1 -0
  14. package/dist/honeycomb/registerHoneycombInstrumentation.d.ts +3 -0
  15. package/dist/honeycomb/registerHoneycombInstrumentation.js +405 -0
  16. package/dist/honeycomb/registerHoneycombInstrumentation.js.map +1 -0
  17. package/dist/honeycomb/tracer.d.ts +1 -0
  18. package/dist/honeycomb/tracer.js +14 -0
  19. package/dist/honeycomb/tracer.js.map +1 -0
  20. package/dist/honeycomb/utils.d.ts +23 -0
  21. package/dist/honeycomb/utils.js +49 -0
  22. package/dist/honeycomb/utils.js.map +1 -0
  23. package/dist/initializeFirefly.js +12 -2
  24. package/dist/initializeFirefly.js.map +1 -1
  25. package/package.json +3 -1
  26. package/src/honeycomb/activeSpan.ts +131 -0
  27. package/src/honeycomb/canRegisterHoneycombInstrumentation.ts +5 -0
  28. package/src/honeycomb/createTraceContextId.ts +12 -0
  29. package/src/honeycomb/initializeHoneycomb.ts +22 -0
  30. package/src/honeycomb/registerHoneycombInstrumentation.ts +470 -0
  31. package/src/honeycomb/tracer.ts +6 -0
  32. package/src/honeycomb/utils.ts +64 -0
  33. package/src/initializeFirefly.ts +12 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # @squide/firefly
2
2
 
3
+ ## 13.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#279](https://github.com/workleap/wl-squide/pull/279) [`9d15afc`](https://github.com/workleap/wl-squide/commit/9d15afc8b75c69dc3f0239876fb25a1d72ed9b29) Thanks [@patricklafrance](https://github.com/patricklafrance)! - The `opentelemetry/api` package has been moved from an optional peer dependency to a regular peer dependency.
8
+
9
+ ## 13.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [#276](https://github.com/workleap/wl-squide/pull/276) [`e46df52`](https://github.com/workleap/wl-squide/commit/e46df52956a32e2487cf113bdc383033aac7a023) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Deprecated `@squide/firefly-honeycomb` and moved honeycomb features directly into `@squide/firefly`. Honeycomb instrumentation is now automatically registered when Squide detected that the host application has register Honeycomb instrumentation using the `@workleap/honeycomb` package.
14
+
15
+ Before:
16
+
17
+ ```ts
18
+ import { ConsoleLogger, initializeFirefly } from "@squide/firefly";
19
+ import { registerHoneycombInstrumentation } from "@squide/firefly-honeycomb";
20
+ import { register as registerMyLocalModule } from "@sample/local-module";
21
+ import { registerHost } from "./register.tsx";
22
+
23
+ const runtime = initializeFirefly({
24
+ localModules: [registerHost, registerMyLocalModule],
25
+ remotes: Remotes,
26
+ loggers: [(x) => new ConsoleLogger(x)],
27
+ });
28
+
29
+ registerHoneycombInstrumentation(
30
+ runtime,
31
+ "sample",
32
+ "squide-sample",
33
+ [/.+/g],
34
+ {
35
+ proxy: "https://my-proxy.com",
36
+ }
37
+ );
38
+ ```
39
+
40
+ After:
41
+
42
+ ```ts
43
+ import { ConsoleLogger, initializeFirefly } from "@squide/firefly";
44
+ import { registerHoneycombInstrumentation } from "@workleap/honeycomb";
45
+ import { register as registerMyLocalModule } from "@sample/local-module";
46
+ import { registerHost } from "./register.tsx";
47
+
48
+ // Register Honeycomb instrumentation BEFORE initializing Squide.
49
+ registerHoneycombInstrumentation("sample", "squide-sample", [/.+/g], {
50
+ proxy: "https://my-proxy.com",
51
+ });
52
+
53
+ const runtime = initializeFirefly({
54
+ localModules: [registerHost, registerMyLocalModule],
55
+ remotes: Remotes,
56
+ loggers: [(x) => new ConsoleLogger(x)],
57
+ });
58
+ ```
59
+
3
60
  ## 12.0.4
4
61
 
5
62
  ### Patch Changes
@@ -0,0 +1,12 @@
1
+ import type { Span } from "@opentelemetry/api";
2
+ import { type RuntimeLogger } from "@squide/core";
3
+ export type ActiveSpanId = string;
4
+ export interface ActiveSpan {
5
+ id: ActiveSpanId;
6
+ name: string;
7
+ instance: Span;
8
+ }
9
+ export declare function registerActiveSpanStack(): void;
10
+ export declare function setActiveSpan(name: string, span: Span): ActiveSpan;
11
+ export declare function popActiveSpan(span: ActiveSpan): void;
12
+ export declare function createOverrideFetchRequestSpanWithActiveSpanContext(logger: RuntimeLogger): (span: Span, request: Request | RequestInit) => true | undefined;
@@ -0,0 +1,105 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE__squide_core_7a405b8f__ from "@squide/core";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_uuid__ from "uuid";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__createTraceContextId_js_cda49537__ from "./createTraceContextId.js";
4
+
5
+ ;// CONCATENATED MODULE: external "@squide/core"
6
+
7
+ ;// CONCATENATED MODULE: external "uuid"
8
+
9
+ ;// CONCATENATED MODULE: external "./createTraceContextId.js"
10
+
11
+ ;// CONCATENATED MODULE: ./src/honeycomb/activeSpan.ts
12
+
13
+
14
+
15
+ // Using a stack because we want a Last In First Out implementation for this.
16
+ // https://github.com/open-telemetry/opentelemetry-js/issues/5084
17
+ // https://github.com/open-telemetry/opentelemetry-js/issues/3558#issuecomment-1760680244
18
+ class ActiveSpanStack {
19
+ #stack = [];
20
+ push(span) {
21
+ this.#stack.push(span);
22
+ }
23
+ pop(span) {
24
+ const head = this.#stack.pop();
25
+ if (!head) {
26
+ throw new Error("[squide] Unexpected pop, the active Honeycomb span stack is empty.");
27
+ }
28
+ if (head.id !== span.id) {
29
+ throw new Error(`[squide] The active Honeycomb span is not the expected span. Expected to pop span with name and id "${span.name} / ${span.id}" but found "${head.name} / ${head.id}". Did you forget to end an active span?`);
30
+ }
31
+ return head;
32
+ }
33
+ peek() {
34
+ if (this.#stack.length === 0) {
35
+ return undefined;
36
+ }
37
+ return this.#stack[this.#stack.length - 1];
38
+ }
39
+ }
40
+ const GlobalActiveSpanStackVariableName = "__SQUIDE_HONEYCOMB_ACTIVE_SPAN_STACK__";
41
+ function registerActiveSpanStack() {
42
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
43
+ // @ts-ignore
44
+ if (globalThis[GlobalActiveSpanStackVariableName]) {
45
+ throw new Error(`[squide] An ActiveSpanStack instance has already been registered to globalThis.${GlobalActiveSpanStackVariableName}. Did you register the Honeycomb instrumentation twice?`);
46
+ }
47
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
48
+ // @ts-ignore
49
+ globalThis[GlobalActiveSpanStackVariableName] = new ActiveSpanStack();
50
+ }
51
+ function getActiveSpanStack() {
52
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
53
+ // @ts-ignore
54
+ return globalThis[GlobalActiveSpanStackVariableName];
55
+ }
56
+ function getActiveSpan() {
57
+ const stack = getActiveSpanStack();
58
+ if (stack) {
59
+ return stack.peek();
60
+ }
61
+ }
62
+ function setActiveSpan(name, span) {
63
+ const activeSpan = {
64
+ id: (0,__WEBPACK_EXTERNAL_MODULE_uuid__.v4)(),
65
+ name: name,
66
+ instance: span
67
+ };
68
+ const stack = getActiveSpanStack();
69
+ if (stack) {
70
+ stack.push(activeSpan);
71
+ }
72
+ return activeSpan;
73
+ }
74
+ function popActiveSpan(span) {
75
+ const stack = getActiveSpanStack();
76
+ if (stack) {
77
+ stack.pop(span);
78
+ }
79
+ }
80
+ function createOverrideFetchRequestSpanWithActiveSpanContext(logger) {
81
+ return (span, request)=>{
82
+ const activeSpan = getActiveSpan();
83
+ if (activeSpan) {
84
+ const activeSpanContext = activeSpan.instance.spanContext();
85
+ const requestSpanContext = span.spanContext();
86
+ if (activeSpanContext) {
87
+ logger.debug("[squide] Found a Honeycomb active context to apply to the following fetch request: \r\n", "Request span context: ", requestSpanContext, "\r\n", "Active span context: ", activeSpanContext, "\r\n", "Request: ", request, "\r\n");
88
+ span.setAttribute("trace.trace_id", activeSpanContext.traceId);
89
+ span.setAttribute("trace.parent_id", activeSpanContext.spanId);
90
+ const traceParent = (0,__WEBPACK_EXTERNAL_MODULE__createTraceContextId_js_cda49537__.createTraceContextId)(activeSpanContext.traceId, requestSpanContext.spanId, requestSpanContext.traceFlags);
91
+ if (request instanceof Request) {
92
+ request.headers.set("traceparent", traceParent);
93
+ } else if ((0,__WEBPACK_EXTERNAL_MODULE__squide_core_7a405b8f__.isPlainObject)(request.headers)) {
94
+ request.headers["traceparent"] = traceParent;
95
+ }
96
+ // Indicates to not propagate the requests to the subsequent hooks.
97
+ return true;
98
+ }
99
+ }
100
+ };
101
+ }
102
+
103
+ export { createOverrideFetchRequestSpanWithActiveSpanContext, popActiveSpan, registerActiveSpanStack, setActiveSpan };
104
+
105
+ //# sourceMappingURL=activeSpan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honeycomb/activeSpan.js","sources":["webpack://@squide/firefly/./src/honeycomb/activeSpan.ts"],"sourcesContent":["import type { Span } from \"@opentelemetry/api\";\nimport { isPlainObject, type RuntimeLogger } from \"@squide/core\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { createTraceContextId } from \"./createTraceContextId.ts\";\n\nexport type ActiveSpanId = string;\n\nexport interface ActiveSpan {\n id: ActiveSpanId;\n name: string;\n instance: Span;\n}\n\n// Using a stack because we want a Last In First Out implementation for this.\n// https://github.com/open-telemetry/opentelemetry-js/issues/5084\n// https://github.com/open-telemetry/opentelemetry-js/issues/3558#issuecomment-1760680244\nclass ActiveSpanStack {\n readonly #stack: ActiveSpan[] = [];\n\n push(span: ActiveSpan) {\n this.#stack.push(span);\n }\n\n pop(span: ActiveSpan) {\n const head = this.#stack.pop();\n\n if (!head) {\n throw new Error(\"[squide] Unexpected pop, the active Honeycomb span stack is empty.\");\n }\n\n if (head.id !== span.id) {\n throw new Error(`[squide] The active Honeycomb span is not the expected span. Expected to pop span with name and id \"${span.name} / ${span.id}\" but found \"${head.name} / ${head.id}\". Did you forget to end an active span?`);\n }\n\n return head;\n }\n\n peek() {\n if (this.#stack.length === 0) {\n return undefined;\n }\n\n return this.#stack[this.#stack.length - 1];\n }\n}\n\nconst GlobalActiveSpanStackVariableName = \"__SQUIDE_HONEYCOMB_ACTIVE_SPAN_STACK__\";\n\nexport function registerActiveSpanStack() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (globalThis[GlobalActiveSpanStackVariableName]) {\n throw new Error(`[squide] An ActiveSpanStack instance has already been registered to globalThis.${GlobalActiveSpanStackVariableName}. Did you register the Honeycomb instrumentation twice?`);\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n globalThis[GlobalActiveSpanStackVariableName] = new ActiveSpanStack();\n}\n\nfunction getActiveSpanStack() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return globalThis[GlobalActiveSpanStackVariableName] as ActiveSpanStack;\n}\n\nfunction getActiveSpan() {\n const stack = getActiveSpanStack();\n\n if (stack) {\n return stack.peek();\n }\n}\n\nexport function setActiveSpan(name: string, span: Span) {\n const activeSpan: ActiveSpan = {\n id: uuidv4(),\n name: name,\n instance: span\n };\n\n const stack = getActiveSpanStack();\n\n if (stack) {\n stack.push(activeSpan);\n }\n\n return activeSpan;\n}\n\nexport function popActiveSpan(span: ActiveSpan) {\n const stack = getActiveSpanStack();\n\n if (stack) {\n stack.pop(span);\n }\n}\n\nexport function createOverrideFetchRequestSpanWithActiveSpanContext(logger: RuntimeLogger) {\n return (span: Span, request: Request | RequestInit) => {\n const activeSpan = getActiveSpan();\n\n if (activeSpan) {\n const activeSpanContext = activeSpan.instance.spanContext();\n const requestSpanContext = span.spanContext();\n\n if (activeSpanContext) {\n logger.debug(\n \"[squide] Found a Honeycomb active context to apply to the following fetch request: \\r\\n\",\n \"Request span context: \", requestSpanContext, \"\\r\\n\",\n \"Active span context: \", activeSpanContext, \"\\r\\n\",\n \"Request: \", request, \"\\r\\n\"\n );\n\n span.setAttribute(\"trace.trace_id\", activeSpanContext.traceId);\n span.setAttribute(\"trace.parent_id\", activeSpanContext.spanId);\n\n const traceParent = createTraceContextId(activeSpanContext.traceId, requestSpanContext.spanId, requestSpanContext.traceFlags);\n\n if (request instanceof Request) {\n request.headers.set(\"traceparent\", traceParent);\n } else if (isPlainObject(request.headers)) {\n request.headers[\"traceparent\"] = traceParent;\n }\n\n // Indicates to not propagate the requests to the subsequent hooks.\n return true;\n }\n }\n };\n}\n"],"names":["isPlainObject","v4","uuidv4","createTraceContextId","ActiveSpanStack","span","head","Error","undefined","GlobalActiveSpanStackVariableName","registerActiveSpanStack","globalThis","getActiveSpanStack","getActiveSpan","stack","setActiveSpan","name","activeSpan","popActiveSpan","createOverrideFetchRequestSpanWithActiveSpanContext","logger","request","activeSpanContext","requestSpanContext","traceParent","Request"],"mappings":";;;;;;;;;;;AACiE;AAC7B;AAC6B;AAUjE,6EAA6E;AAC7E,iEAAiE;AACjE,yFAAyF;AACzF,MAAMI;IACO,MAAM,GAAiB,EAAE,CAAC;IAEnC,KAAKC,IAAgB,EAAE;QACnB,IAAI,CAAC,MAAM,CAAC,IAAI,CAACA;IACrB;IAEA,IAAIA,IAAgB,EAAE;QAClB,MAAMC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG;QAE5B,IAAI,CAACA,MAAM;YACP,MAAM,IAAIC,MAAM;QACpB;QAEA,IAAID,KAAK,EAAE,KAAKD,KAAK,EAAE,EAAE;YACrB,MAAM,IAAIE,MAAM,CAAC,oGAAoG,EAAEF,KAAK,IAAI,CAAC,GAAG,EAAEA,KAAK,EAAE,CAAC,aAAa,EAAEC,KAAK,IAAI,CAAC,GAAG,EAAEA,KAAK,EAAE,CAAC,wCAAwC,CAAC;QACjO;QAEA,OAAOA;IACX;IAEA,OAAO;QACH,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,GAAG;YAC1B,OAAOE;QACX;QAEA,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE;IAC9C;AACJ;AAEA,MAAMC,oCAAoC;AAEnC,SAASC;IACZ,6DAA6D;IAC7D,aAAa;IACb,IAAIC,UAAU,CAACF,kCAAkC,EAAE;QAC/C,MAAM,IAAIF,MAAM,CAAC,+EAA+E,EAAEE,kCAAkC,uDAAuD,CAAC;IAChM;IAEA,6DAA6D;IAC7D,aAAa;IACbE,UAAU,CAACF,kCAAkC,GAAG,IAAIL;AACxD;AAEA,SAASQ;IACL,6DAA6D;IAC7D,aAAa;IACb,OAAOD,UAAU,CAACF,kCAAkC;AACxD;AAEA,SAASI;IACL,MAAMC,QAAQF;IAEd,IAAIE,OAAO;QACP,OAAOA,MAAM,IAAI;IACrB;AACJ;AAEO,SAASC,cAAcC,IAAY,EAAEX,IAAU;IAClD,MAAMY,aAAyB;QAC3B,IAAIf,uCAAMA;QACV,MAAMc;QACN,UAAUX;IACd;IAEA,MAAMS,QAAQF;IAEd,IAAIE,OAAO;QACPA,MAAM,IAAI,CAACG;IACf;IAEA,OAAOA;AACX;AAEO,SAASC,cAAcb,IAAgB;IAC1C,MAAMS,QAAQF;IAEd,IAAIE,OAAO;QACPA,MAAM,GAAG,CAACT;IACd;AACJ;AAEO,SAASc,oDAAoDC,MAAqB;IACrF,OAAO,CAACf,MAAYgB;QAChB,MAAMJ,aAAaJ;QAEnB,IAAII,YAAY;YACZ,MAAMK,oBAAoBL,WAAW,QAAQ,CAAC,WAAW;YACzD,MAAMM,qBAAqBlB,KAAK,WAAW;YAE3C,IAAIiB,mBAAmB;gBACnBF,OAAO,KAAK,CACR,2FACA,0BAA0BG,oBAAoB,QAC9C,yBAAyBD,mBAAmB,QAC5C,aAAaD,SAAS;gBAG1BhB,KAAK,YAAY,CAAC,kBAAkBiB,kBAAkB,OAAO;gBAC7DjB,KAAK,YAAY,CAAC,mBAAmBiB,kBAAkB,MAAM;gBAE7D,MAAME,cAAcrB,sFAAoBA,CAACmB,kBAAkB,OAAO,EAAEC,mBAAmB,MAAM,EAAEA,mBAAmB,UAAU;gBAE5H,IAAIF,mBAAmBI,SAAS;oBAC5BJ,QAAQ,OAAO,CAAC,GAAG,CAAC,eAAeG;gBACvC,OAAO,IAAIxB,mEAAaA,CAACqB,QAAQ,OAAO,GAAG;oBACvCA,QAAQ,OAAO,CAAC,cAAc,GAAGG;gBACrC;gBAEA,mEAAmE;gBACnE,OAAO;YACX;QACJ;IACJ;AACJ"}
@@ -0,0 +1 @@
1
+ export declare function canRegisterHoneycombInstrumentation(): boolean;
@@ -0,0 +1,11 @@
1
+
2
+ ;// CONCATENATED MODULE: ./src/honeycomb/canRegisterHoneycombInstrumentation.ts
3
+ function canRegisterHoneycombInstrumentation() {
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-ignore
6
+ return globalThis.__WLP_HONEYCOMB_INSTRUMENTATION_IS_REGISTERED__ === true;
7
+ }
8
+
9
+ export { canRegisterHoneycombInstrumentation };
10
+
11
+ //# sourceMappingURL=canRegisterHoneycombInstrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honeycomb/canRegisterHoneycombInstrumentation.js","sources":["webpack://@squide/firefly/./src/honeycomb/canRegisterHoneycombInstrumentation.ts"],"sourcesContent":["export function canRegisterHoneycombInstrumentation() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return globalThis.__WLP_HONEYCOMB_INSTRUMENTATION_IS_REGISTERED__ === true;\n}\n"],"names":["canRegisterHoneycombInstrumentation","globalThis"],"mappings":";;AAAO,SAASA;IACZ,6DAA6D;IAC7D,aAAa;IACb,OAAOC,WAAW,+CAA+C,KAAK;AAC1E"}
@@ -0,0 +1 @@
1
+ export declare function createTraceContextId(traceId: string, spanId: string, traceFlags: number): string;
@@ -0,0 +1,16 @@
1
+
2
+ ;// CONCATENATED MODULE: ./src/honeycomb/createTraceContextId.ts
3
+ // Creates the trace context id based on the following opentelemetry-js implementation: https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-core/src/trace/W3CTraceContextPropagator.ts
4
+ const VERSION = "00";
5
+ var createTraceContextId_TraceFlags = /*#__PURE__*/ (/* unused pure expression or super */ null && (function(TraceFlags) {
6
+ TraceFlags[TraceFlags["NONE"] = 0] = "NONE";
7
+ TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED";
8
+ return TraceFlags;
9
+ }(createTraceContextId_TraceFlags || {})));
10
+ function createTraceContextId(traceId, spanId, traceFlags) {
11
+ return `${VERSION}-${traceId}-${spanId}-0${Number(traceFlags || 0).toString(16)}`;
12
+ }
13
+
14
+ export { createTraceContextId };
15
+
16
+ //# sourceMappingURL=createTraceContextId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honeycomb/createTraceContextId.js","sources":["webpack://@squide/firefly/./src/honeycomb/createTraceContextId.ts"],"sourcesContent":["// Creates the trace context id based on the following opentelemetry-js implementation: https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-core/src/trace/W3CTraceContextPropagator.ts\n\nconst VERSION = \"00\";\n\nenum TraceFlags {\n NONE = 0x0,\n SAMPLED = 0x1 << 0\n}\n\nexport function createTraceContextId(traceId: string, spanId: string, traceFlags: number) {\n return `${VERSION}-${traceId}-${spanId}-0${Number(traceFlags || TraceFlags.NONE).toString(16)}`;\n}\n"],"names":["VERSION","TraceFlags","createTraceContextId","traceId","spanId","traceFlags","Number"],"mappings":";;AAAA,uNAAuN;AAEvN,MAAMA,UAAU;AAEhB,IAAKC,+BAAUA,iBAAVA,gDAAAA,SAAAA;;;WAAAA;EAAAA,+BAAUA,OAAVA,EAAAA;AAKE,SAASC,qBAAqBC,OAAe,EAAEC,MAAc,EAAEC,UAAkB;IACpF,OAAO,GAAGL,QAAQ,CAAC,EAAEG,QAAQ,CAAC,EAAEC,OAAO,EAAE,EAAEE,OAAOD,iBAA+B,QAAQ,CAAC,KAAK;AACnG"}
@@ -0,0 +1,2 @@
1
+ import type { FireflyRuntime } from "../FireflyRuntime.tsx";
2
+ export declare function initializeHoneycomb(runtime: FireflyRuntime): Promise<void>;
@@ -0,0 +1,25 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE__canRegisterHoneycombInstrumentation_js_50e78485__ from "./canRegisterHoneycombInstrumentation.js";
2
+
3
+ ;// CONCATENATED MODULE: external "./canRegisterHoneycombInstrumentation.js"
4
+
5
+ ;// CONCATENATED MODULE: ./src/honeycomb/initializeHoneycomb.ts
6
+
7
+ async function initializeHoneycomb(runtime) {
8
+ if ((0,__WEBPACK_EXTERNAL_MODULE__canRegisterHoneycombInstrumentation_js_50e78485__.canRegisterHoneycombInstrumentation)()) {
9
+ try {
10
+ // Dynamically import the Honeycomb instrumentation to prevent loading all the Honeycomb libraries
11
+ // if Honeycomb instrumentation is not registered by the hosting application.
12
+ const mod = await import("./registerHoneycombInstrumentation.js");
13
+ mod.registerHoneycombInstrumentation(runtime);
14
+ } catch (error) {
15
+ runtime.logger.error("[squide] Failed to register Honeycomb instrumentation. The \"./registerHoneycombInstrumentation.ts\" cannot be imported.");
16
+ throw error;
17
+ }
18
+ } else {
19
+ runtime.logger.debug("[squide] Cannot register Honeycomb instrumentation because the host application is not using the \"@workleap/honeycomb\" package.");
20
+ }
21
+ }
22
+
23
+ export { initializeHoneycomb };
24
+
25
+ //# sourceMappingURL=initializeHoneycomb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honeycomb/initializeHoneycomb.js","sources":["webpack://@squide/firefly/./src/honeycomb/initializeHoneycomb.ts"],"sourcesContent":["import type { FireflyRuntime } from \"../FireflyRuntime.tsx\";\nimport { canRegisterHoneycombInstrumentation } from \"./canRegisterHoneycombInstrumentation.ts\";\n\nexport async function initializeHoneycomb(runtime: FireflyRuntime) {\n if (canRegisterHoneycombInstrumentation()) {\n try {\n // Dynamically import the Honeycomb instrumentation to prevent loading all the Honeycomb libraries\n // if Honeycomb instrumentation is not registered by the hosting application.\n const mod = await import(\"./registerHoneycombInstrumentation.ts\");\n\n mod.registerHoneycombInstrumentation(runtime);\n } catch (error: unknown) {\n runtime.logger.error(\"[squide] Failed to register Honeycomb instrumentation. The \\\"./registerHoneycombInstrumentation.ts\\\" cannot be imported.\");\n\n throw error;\n }\n } else {\n runtime.logger.debug(\"[squide] Cannot register Honeycomb instrumentation because the host application is not using the \\\"@workleap/honeycomb\\\" package.\");\n }\n}\n\n\n"],"names":["canRegisterHoneycombInstrumentation","initializeHoneycomb","runtime","mod","error"],"mappings":";;;;;AAC+F;AAExF,eAAeC,oBAAoBC,OAAuB;IAC7D,IAAIF,oHAAmCA,IAAI;QACvC,IAAI;YACA,kGAAkG;YAClG,6EAA6E;YAC7E,MAAMG,MAAM,MAAM,+CAA+C;YAEjEA,IAAI,gCAAgC,CAACD;QACzC,EAAE,OAAOE,OAAgB;YACrBF,QAAQ,MAAM,CAAC,KAAK,CAAC;YAErB,MAAME;QACV;IACJ,OAAO;QACHF,QAAQ,MAAM,CAAC,KAAK,CAAC;IACzB;AACJ"}
@@ -0,0 +1,3 @@
1
+ import type { FireflyRuntime } from "../FireflyRuntime.tsx";
2
+ export declare function reduceDataFetchEvents(runtime: FireflyRuntime, onDataFetchingStarted: () => void, onDataReady: () => void, onPublicDataFetchStarted: () => void, onPublicDataReady: () => void, onProtectedDataFetchStarted: () => void, onProtectedDataReady: () => void): void;
3
+ export declare function registerHoneycombInstrumentation(runtime: FireflyRuntime): void;