@squide/firefly 16.0.3 → 16.1.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.
- package/CHANGELOG.md +22 -0
- package/dist/AppRouter.js +1 -1
- package/dist/AppRouter.js.map +1 -1
- package/dist/AppRouterContext.js +2 -2
- package/dist/AppRouterContext.js.map +1 -1
- package/dist/AppRouterReducer.d.ts +3 -1
- package/dist/AppRouterReducer.js +35 -4
- package/dist/AppRouterReducer.js.map +1 -1
- package/dist/AppRouterStore.js +8 -0
- package/dist/AppRouterStore.js.map +1 -1
- package/dist/FireflyRuntime.d.ts +32 -16
- package/dist/FireflyRuntime.js +61 -19
- package/dist/FireflyRuntime.js.map +1 -1
- package/dist/honeycomb/activeSpan.js +2 -2
- package/dist/honeycomb/activeSpan.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/initializeFirefly.d.ts +4 -2
- package/dist/initializeFirefly.js +15 -4
- package/dist/initializeFirefly.js.map +1 -1
- package/dist/useCanUpdateDeferredRegistrations.js +2 -2
- package/dist/useCanUpdateDeferredRegistrations.js.map +1 -1
- package/dist/useDeferredRegistrations.d.ts +1 -1
- package/dist/useDeferredRegistrations.js +6 -5
- package/dist/useDeferredRegistrations.js.map +1 -1
- package/dist/useRegisterDeferredRegistrations.d.ts +1 -2
- package/dist/useRegisterDeferredRegistrations.js +9 -2
- package/dist/useRegisterDeferredRegistrations.js.map +1 -1
- package/dist/useStrictRegistrationMode.js +10 -8
- package/dist/useStrictRegistrationMode.js.map +1 -1
- package/dist/useUpdateDeferredRegistrations.d.ts +1 -2
- package/dist/useUpdateDeferredRegistrations.js +7 -1
- package/dist/useUpdateDeferredRegistrations.js.map +1 -1
- package/package.json +19 -17
- package/src/AppRouter.tsx +1 -1
- package/src/AppRouterContext.ts +1 -1
- package/src/AppRouterReducer.ts +38 -3
- package/src/AppRouterStore.ts +8 -0
- package/src/FireflyRuntime.tsx +85 -30
- package/src/honeycomb/activeSpan.ts +1 -1
- package/src/index.ts +18 -2
- package/src/initializeFirefly.ts +38 -27
- package/src/useCanUpdateDeferredRegistrations.ts +3 -1
- package/src/useDeferredRegistrations.ts +15 -6
- package/src/useRegisterDeferredRegistrations.ts +5 -3
- package/src/useStrictRegistrationMode.ts +11 -11
- package/src/useUpdateDeferredRegistrations.ts +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FireflyRuntime.js","sources":["../src/FireflyRuntime.tsx"],"sourcesContent":["import type { RegisterRouteOptions, RuntimeMethodOptions, RuntimeOptions } from \"@squide/core\";\nimport { EnvironmentVariableKey, EnvironmentVariables, EnvironmentVariableValue, getEnvironmentVariablesPlugin } from \"@squide/env-vars\";\nimport { getMswPlugin, MswPluginName, MswState } from \"@squide/msw\";\nimport { type IReactRouterRuntime, ReactRouterRuntime, ReactRouterRuntimeScope, type Route } from \"@squide/react-router\";\nimport type { HoneycombInstrumentationPartialClient } from \"@workleap-telemetry/core\";\nimport type { Logger } from \"@workleap/logging\";\nimport type { RequestHandler } from \"msw\";\nimport { type AppRouterStore, createAppRouterStore } from \"./AppRouterStore.ts\";\n\nexport interface FireflyRuntimeOptions<TRuntime extends FireflyRuntime = FireflyRuntime> extends RuntimeOptions<TRuntime> {\n honeycombInstrumentationClient?: HoneycombInstrumentationPartialClient;\n}\n\nexport interface RegisterRequestHandlersOptions extends RuntimeMethodOptions {}\n\nexport interface IFireflyRuntime extends IReactRouterRuntime {\n getMswState(): MswState;\n registerRequestHandlers: (handlers: RequestHandler[]) => void;\n get requestHandlers(): RequestHandler[];\n get isMswEnabled(): boolean;\n registerEnvironmentVariable(key: EnvironmentVariableKey, value: EnvironmentVariableValue): void;\n registerEnvironmentVariables(variables: Partial<EnvironmentVariables>): void;\n getEnvironmentVariable(key: EnvironmentVariableKey): EnvironmentVariableValue;\n getEnvironmentVariables(): EnvironmentVariables;\n get appRouterStore(): AppRouterStore;\n get honeycombInstrumentationClient(): HoneycombInstrumentationPartialClient | undefined;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class FireflyRuntime<TRuntime extends FireflyRuntime = any> extends ReactRouterRuntime<TRuntime> implements IFireflyRuntime {\n protected _appRouterStore: AppRouterStore;\n protected _honeycombInstrumentationClient: HoneycombInstrumentationPartialClient | undefined;\n\n constructor(options: FireflyRuntimeOptions = {}) {\n const {\n honeycombInstrumentationClient\n } = options;\n\n super(options);\n\n this._appRouterStore = createAppRouterStore(this._logger);\n this._honeycombInstrumentationClient = honeycombInstrumentationClient;\n }\n\n registerRoute(route: Route, options: RegisterRouteOptions = {}) {\n if (this.moduleManager.getAreModulesRegistered()) {\n throw new Error(\"[squide] Cannot register a route once the modules are registered. Are you trying to register a route in a deferred registration function? Only navigation items can be registered in a deferred registration function.\");\n }\n\n super.registerRoute(route, options);\n }\n\n getMswState() {\n const plugin = getMswPlugin(this);\n\n return plugin.mswState;\n }\n\n registerRequestHandlers(handlers: RequestHandler[], options: RegisterRequestHandlersOptions = {}) {\n const logger = this._getLogger(options);\n const plugin = getMswPlugin(this);\n\n if (this.moduleManager.getAreModulesRegistered()) {\n throw new Error(\"[squide] Cannot register an MSW request handlers once the modules are registered. Are you trying to register an MSW request handler in a deferred registration function? Only navigation items can be registered in a deferred registration function.\");\n }\n\n plugin.registerRequestHandlers(handlers, {\n logger\n });\n }\n\n // Must define a return type otherwise we get an \"error TS2742: The inferred type of 'requestHandlers' cannot be named\" error.\n get requestHandlers(): RequestHandler[] {\n const plugin = getMswPlugin(this);\n\n return plugin.requestHandlers;\n }\n\n get isMswEnabled() {\n return this._plugins.some(x => x.name === MswPluginName);\n }\n\n getEnvironmentVariable(key: EnvironmentVariableKey) {\n const plugin = getEnvironmentVariablesPlugin(this);\n\n return plugin.getVariable(key);\n }\n\n getEnvironmentVariables() {\n const plugin = getEnvironmentVariablesPlugin(this);\n\n return plugin.getVariables();\n }\n\n registerEnvironmentVariable(key: EnvironmentVariableKey, value: EnvironmentVariableValue) {\n const plugin = getEnvironmentVariablesPlugin(this);\n\n return plugin.registerVariable(key, value);\n }\n\n registerEnvironmentVariables(variables: Partial<EnvironmentVariables>) {\n const plugin = getEnvironmentVariablesPlugin(this);\n\n return plugin.registerVariables(variables);\n }\n\n get appRouterStore() {\n return this._appRouterStore;\n }\n\n get honeycombInstrumentationClient() {\n return this._honeycombInstrumentationClient;\n }\n\n startScope(logger: Logger): TRuntime {\n return (new FireflyRuntimeScope(this, logger) as unknown) as TRuntime;\n }\n}\n\nexport class FireflyRuntimeScope<TRuntime extends FireflyRuntime = FireflyRuntime> extends ReactRouterRuntimeScope<TRuntime> implements IFireflyRuntime {\n getMswState() {\n return this._runtime.getMswState();\n }\n\n registerRequestHandlers(handlers: RequestHandler[], options: RegisterRequestHandlersOptions = {}) {\n this._runtime.registerRequestHandlers(handlers, {\n ...options,\n logger: this._getLogger(options)\n });\n }\n\n // Must define a return type otherwise we get an \"error TS2742: The inferred type of 'requestHandlers' cannot be named\" error.\n get requestHandlers(): RequestHandler[] {\n return this._runtime.requestHandlers;\n }\n\n get isMswEnabled() {\n return this._runtime.isMswEnabled;\n }\n\n getEnvironmentVariables() {\n return this._runtime.getEnvironmentVariables();\n }\n\n getEnvironmentVariable(key: EnvironmentVariableKey) {\n return this._runtime.getEnvironmentVariable(key);\n }\n\n registerEnvironmentVariable(key: EnvironmentVariableKey, value: EnvironmentVariableValue) {\n this._runtime.registerEnvironmentVariable(key, value);\n }\n\n registerEnvironmentVariables(variables: Partial<EnvironmentVariables>) {\n this._runtime.registerEnvironmentVariables(variables);\n }\n\n get appRouterStore(): AppRouterStore {\n throw new Error(\"[squide] Cannot retrieve the app router store from a runtime scope instance.\");\n }\n\n get honeycombInstrumentationClient(): HoneycombInstrumentationPartialClient {\n throw new Error(\"[squide] Cannot retrieve the Honeycomb instrumentation client from a runtime scope instance.\");\n }\n}\n"],"names":["getEnvironmentVariablesPlugin","getMswPlugin","MswPluginName","ReactRouterRuntime","ReactRouterRuntimeScope","createAppRouterStore","FireflyRuntime","options","honeycombInstrumentationClient","route","Error","plugin","handlers","logger","x","key","value","variables","FireflyRuntimeScope"],"mappings":";;;;;;;;;;;;;;AACyI;AACrE;AACqD;AAIzC;AAqBhF,8DAA8D;AACvD,MAAMM,uBAA8DH,kBAAkBA;IAC/E,gBAAgC;IAChC,gCAAmF;IAE7F,YAAYI,UAAiC,CAAC,CAAC,CAAE;QAC7C,MAAM,EACFC,8BAA8B,EACjC,GAAGD;QAEJ,KAAK,CAACA;QAEN,IAAI,CAAC,eAAe,GAAGF,oBAAoBA,CAAC,IAAI,CAAC,OAAO;QACxD,IAAI,CAAC,+BAA+B,GAAGG;IAC3C;IAEA,cAAcC,KAAY,EAAEF,UAAgC,CAAC,CAAC,EAAE;QAC5D,IAAI,IAAI,CAAC,aAAa,CAAC,uBAAuB,IAAI;YAC9C,MAAM,IAAIG,MAAM;QACpB;QAEA,KAAK,CAAC,cAAcD,OAAOF;IAC/B;IAEA,cAAc;QACV,MAAMI,SAASV,YAAYA,CAAC,IAAI;QAEhC,OAAOU,OAAO,QAAQ;IAC1B;IAEA,wBAAwBC,QAA0B,EAAEL,UAA0C,CAAC,CAAC,EAAE;QAC9F,MAAMM,SAAS,IAAI,CAAC,UAAU,CAACN;QAC/B,MAAMI,SAASV,YAAYA,CAAC,IAAI;QAEhC,IAAI,IAAI,CAAC,aAAa,CAAC,uBAAuB,IAAI;YAC9C,MAAM,IAAIS,MAAM;QACpB;QAEAC,OAAO,uBAAuB,CAACC,UAAU;YACrCC;QACJ;IACJ;IAEA,8HAA8H;IAC9H,IAAI,kBAAoC;QACpC,MAAMF,SAASV,YAAYA,CAAC,IAAI;QAEhC,OAAOU,OAAO,eAAe;IACjC;IAEA,IAAI,eAAe;QACf,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAACG,CAAAA,IAAKA,EAAE,IAAI,KAAKZ,aAAaA;IAC3D;IAEA,uBAAuBa,GAA2B,EAAE;QAChD,MAAM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IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAACD,KAAKC;IACnD;IAEA,6BAA6BC,SAAwC,EAAE;QACnE,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAACA;IAC/C;IAEA,IAAI,iBAAiC;QACjC,MAAM,IAAIP,MAAM;IACpB;IAEA,IAAI,iCAAwE;QACxE,MAAM,IAAIA,MAAM;IACpB;AACJ"}
|
|
1
|
+
{"version":3,"file":"FireflyRuntime.js","sources":["../src/FireflyRuntime.tsx"],"sourcesContent":["import type { RegisterRouteOptions, RuntimeMethodOptions, RuntimeOptions } from \"@squide/core\";\nimport { EnvironmentVariableKey, EnvironmentVariables, getEnvironmentVariablesPlugin } from \"@squide/env-vars\";\nimport { FeatureFlagKey, FeatureFlags, FeatureFlagSetSnapshot, getLaunchDarklyPlugin, LaunchDarklyPluginName } from \"@squide/launch-darkly\";\nimport { getMswPlugin, MswPluginName, MswState } from \"@squide/msw\";\nimport { type IReactRouterRuntime, ReactRouterRuntime, ReactRouterRuntimeScope, type Route } from \"@squide/react-router\";\nimport type { HoneycombInstrumentationPartialClient } from \"@workleap-telemetry/core\";\nimport type { Logger } from \"@workleap/logging\";\nimport { LDClient } from \"launchdarkly-js-client-sdk\";\nimport type { RequestHandler } from \"msw\";\nimport { type AppRouterStore, createAppRouterStore } from \"./AppRouterStore.ts\";\n\nexport interface FireflyRuntimeOptions<TRuntime extends FireflyRuntime = FireflyRuntime> extends RuntimeOptions<TRuntime> {\n honeycombInstrumentationClient?: HoneycombInstrumentationPartialClient;\n}\n\nexport interface RegisterRequestHandlersOptions extends RuntimeMethodOptions {}\n\nexport interface IFireflyRuntime extends IReactRouterRuntime {\n get isMswEnabled(): boolean;\n get mswState(): MswState;\n registerRequestHandlers: (handlers: RequestHandler[]) => void;\n get requestHandlers(): RequestHandler[];\n registerEnvironmentVariable<T extends EnvironmentVariableKey>(key: T, value: EnvironmentVariables[T]): void;\n registerEnvironmentVariables(variables: Partial<EnvironmentVariables>): void;\n getEnvironmentVariable<T extends EnvironmentVariableKey>(key: T): EnvironmentVariables[T];\n get environmentVariables(): EnvironmentVariables;\n get appRouterStore(): AppRouterStore;\n get honeycombInstrumentationClient(): HoneycombInstrumentationPartialClient | undefined;\n get isLaunchDarklyEnabled(): boolean;\n get launchDarklyClient(): LDClient;\n get featureFlags(): FeatureFlags;\n getFeatureFlag(key: string, defaultValue?: unknown): unknown;\n get featureFlagSetSnapshot(): FeatureFlagSetSnapshot;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class FireflyRuntime<TRuntime extends FireflyRuntime = any> extends ReactRouterRuntime<TRuntime> implements IFireflyRuntime {\n readonly #appRouterStore: AppRouterStore;\n readonly #honeycombInstrumentationClient: HoneycombInstrumentationPartialClient | undefined;\n readonly #isMswEnabled: boolean;\n readonly #isLaunchDarklyEnabled: boolean;\n\n constructor(options: FireflyRuntimeOptions = {}) {\n const {\n honeycombInstrumentationClient\n } = options;\n\n super(options);\n\n this.#appRouterStore = createAppRouterStore(this._logger);\n this.#honeycombInstrumentationClient = honeycombInstrumentationClient;\n this.#isMswEnabled = this._plugins.some(x => x.name === MswPluginName);\n this.#isLaunchDarklyEnabled = this._plugins.some(x => x.name === LaunchDarklyPluginName);\n }\n\n registerRoute(route: Route, options: RegisterRouteOptions = {}) {\n if (this.moduleManager.getAreModulesRegistered()) {\n throw new Error(\"[squide] Cannot register a route once the modules are registered. Are you trying to register a route in a deferred registration function? Only navigation items can be registered in a deferred registration function.\");\n }\n\n super.registerRoute(route, options);\n }\n\n get isMswEnabled() {\n return this.#isMswEnabled;\n }\n\n get mswState() {\n const plugin = getMswPlugin(this);\n\n return plugin.mswState;\n }\n\n registerRequestHandlers(handlers: RequestHandler[], options: RegisterRequestHandlersOptions = {}) {\n const logger = this._getLogger(options);\n const plugin = getMswPlugin(this);\n\n if (this.moduleManager.getAreModulesRegistered()) {\n throw new Error(\"[squide] Cannot register an MSW request handlers once the modules are registered. Are you trying to register an MSW request handler in a deferred registration function? Only navigation items can be registered in a deferred registration function.\");\n }\n\n plugin.registerRequestHandlers(handlers, {\n logger\n });\n }\n\n // Must define a return type otherwise we get an \"error TS2742: The inferred type of 'requestHandlers' cannot be named\" error.\n get requestHandlers(): RequestHandler[] {\n const plugin = getMswPlugin(this);\n\n return plugin.requestHandlers;\n }\n\n getEnvironmentVariable(key: EnvironmentVariableKey) {\n const plugin = getEnvironmentVariablesPlugin(this);\n\n return plugin.getVariable(key);\n }\n\n get environmentVariables() {\n const plugin = getEnvironmentVariablesPlugin(this);\n\n return plugin.getVariables();\n }\n\n registerEnvironmentVariable<T extends EnvironmentVariableKey>(key: T, value: EnvironmentVariables[T]) {\n const plugin = getEnvironmentVariablesPlugin(this);\n\n return plugin.registerVariable(key, value);\n }\n\n registerEnvironmentVariables(variables: Partial<EnvironmentVariables>) {\n const plugin = getEnvironmentVariablesPlugin(this);\n\n return plugin.registerVariables(variables);\n }\n\n get appRouterStore() {\n return this.#appRouterStore;\n }\n\n get honeycombInstrumentationClient() {\n return this.#honeycombInstrumentationClient;\n }\n\n get isLaunchDarklyEnabled() {\n return this.#isLaunchDarklyEnabled;\n }\n\n get launchDarklyClient() {\n return getLaunchDarklyPlugin(this).client;\n }\n\n get featureFlags() {\n return this.featureFlagSetSnapshot.value;\n }\n\n getFeatureFlag<T extends FeatureFlagKey>(key: T, defaultValue?: FeatureFlags[T]) {\n return getLaunchDarklyPlugin(this).getFeatureFlag(key, defaultValue);\n }\n\n get featureFlagSetSnapshot() {\n return getLaunchDarklyPlugin(this).featureFlagSetSnapshot;\n }\n\n startScope(logger: Logger): TRuntime {\n return (new FireflyRuntimeScope(this, logger) as unknown) as TRuntime;\n }\n}\n\nexport class FireflyRuntimeScope<TRuntime extends FireflyRuntime = FireflyRuntime> extends ReactRouterRuntimeScope<TRuntime> implements IFireflyRuntime {\n get isMswEnabled() {\n return this._runtime.isMswEnabled;\n }\n\n get mswState() {\n return this._runtime.mswState;\n }\n\n registerRequestHandlers(handlers: RequestHandler[], options: RegisterRequestHandlersOptions = {}) {\n this._runtime.registerRequestHandlers(handlers, {\n ...options,\n logger: this._getLogger(options)\n });\n }\n\n // Must define a return type otherwise we get an \"error TS2742: The inferred type of 'requestHandlers' cannot be named\" error.\n get requestHandlers(): RequestHandler[] {\n return this._runtime.requestHandlers;\n }\n\n getEnvironmentVariable(key: EnvironmentVariableKey) {\n return this._runtime.getEnvironmentVariable(key);\n }\n\n get environmentVariables() {\n return this._runtime.environmentVariables;\n }\n\n registerEnvironmentVariable<T extends EnvironmentVariableKey>(key: T, value: EnvironmentVariables[T]) {\n this._runtime.registerEnvironmentVariable(key, value);\n }\n\n registerEnvironmentVariables(variables: Partial<EnvironmentVariables>) {\n this._runtime.registerEnvironmentVariables(variables);\n }\n\n get appRouterStore(): AppRouterStore {\n throw new Error(\"[squide] Cannot retrieve the app router store from a runtime scope instance.\");\n }\n\n get honeycombInstrumentationClient(): HoneycombInstrumentationPartialClient {\n throw new Error(\"[squide] Cannot retrieve the Honeycomb instrumentation client from a runtime scope instance.\");\n }\n\n get isLaunchDarklyEnabled() {\n return this._runtime.isLaunchDarklyEnabled;\n }\n\n get launchDarklyClient() {\n return this._runtime.launchDarklyClient;\n }\n\n get featureFlags() {\n return this._runtime.featureFlags;\n }\n\n getFeatureFlag<T extends FeatureFlagKey>(key: T, defaultValue?: FeatureFlags[T]) {\n // The error is because the FeatureFlags interface is empty as it is expected to be augmented by the\n // consumer application.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return this._runtime.getFeatureFlag(key, defaultValue);\n }\n\n get featureFlagSetSnapshot() {\n return this._runtime.featureFlagSetSnapshot;\n }\n}\n"],"names":["getEnvironmentVariablesPlugin","getLaunchDarklyPlugin","LaunchDarklyPluginName","getMswPlugin","MswPluginName","ReactRouterRuntime","ReactRouterRuntimeScope","createAppRouterStore","FireflyRuntime","options","honeycombInstrumentationClient","x","route","Error","plugin","handlers","logger","key","value","variables","defaultValue","FireflyRuntimeScope"],"mappings":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 -1,8 +1,8 @@
|
|
|
1
|
-
import { isPlainObject } from "@squide/core";
|
|
1
|
+
import { isPlainObject } from "@squide/core/internal";
|
|
2
2
|
import { v4 } from "uuid";
|
|
3
3
|
import { createTraceContextId } from "./createTraceContextId.js";
|
|
4
4
|
|
|
5
|
-
;// CONCATENATED MODULE: external "@squide/core"
|
|
5
|
+
;// CONCATENATED MODULE: external "@squide/core/internal"
|
|
6
6
|
|
|
7
7
|
;// CONCATENATED MODULE: external "uuid"
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeycomb/activeSpan.js","sources":["../../src/honeycomb/activeSpan.ts"],"sourcesContent":["import type { Span } from \"@opentelemetry/api\";\nimport { isPlainObject } from \"@squide/core\";\nimport type { Logger } from \"@workleap/logging\";\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: Logger) {\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\n .withText(\"[squide] Found a Honeycomb active context to apply to the following fetch request:\")\n .withLineChange()\n .withText(\"Request span context:\")\n .withObject(requestSpanContext)\n .withLineChange()\n .withText(\"Active span context:\")\n .withObject(activeSpanContext)\n .withLineChange()\n .withText(\"Request:\")\n .withObject(request)\n .debug();\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":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"honeycomb/activeSpan.js","sources":["../../src/honeycomb/activeSpan.ts"],"sourcesContent":["import type { Span } from \"@opentelemetry/api\";\nimport { isPlainObject } from \"@squide/core/internal\";\nimport type { Logger } from \"@workleap/logging\";\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: Logger) {\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\n .withText(\"[squide] Found a Honeycomb active context to apply to the following fetch request:\")\n .withLineChange()\n .withText(\"Request span context:\")\n .withObject(requestSpanContext)\n .withLineChange()\n .withText(\"Active span context:\")\n .withObject(activeSpanContext)\n .withLineChange()\n .withText(\"Request:\")\n .withObject(request)\n .debug();\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":";;;;;;;;;;;AACsD;AAElB;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,aA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mBAAmB,UAAU;gBAE5H,IAAIF,mBAAmBI,SAAS;oBAC5BJ,QAAQ,OAAO,CAAC,GAAG,CAAC,eAAeG;gBACvC,OAAO,IAAIxB,aAAaA,CAACqB,QAAQ,OAAO,GAAG;oBACvCA,QAAQ,OAAO,CAAC,cAAc,GAAGG;gBACrC;gBAEA,mEAAmE;gBACnE,OAAO;YACX;QACJ;IACJ;AACJ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "@squide/core";
|
|
2
|
-
export { EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, getEnvironmentVariablesPlugin, useEnvironmentVariable, useEnvironmentVariables, type EnvironmentVariableKey, type EnvironmentVariables, type EnvironmentVariablesPluginOptions
|
|
2
|
+
export { EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, getEnvironmentVariablesPlugin, useEnvironmentVariable, useEnvironmentVariables, type EnvironmentVariableKey, type EnvironmentVariables, type EnvironmentVariablesPluginOptions } from "@squide/env-vars";
|
|
3
|
+
export { FeatureFlagSetSnapshot, getFeatureFlag, getLaunchDarklyPlugin, InMemoryLaunchDarklyClient, LaunchDarklyClientNotifier, LaunchDarklyPlugin, LaunchDarklyPluginName, useFeatureFlag, useFeatureFlags, useLaunchDarklyClient, type FeatureFlagKey, type FeatureFlags, type FeatureFlagSetSnapshotChangedListener, type InMemoryLaunchDarklyClientOptions, type LaunchDarklyClientListener } from "@squide/launch-darkly";
|
|
3
4
|
export { getMswPlugin, MswPlugin, MswPluginName, MswState, type MswPluginOptions, type MswPluginRegisterRequestHandlersOptions, type MswReadyListener, type MswStateOptions } from "@squide/msw";
|
|
4
5
|
export * from "@squide/react-router";
|
|
5
6
|
export type { FireflyPlugin } from "./FireflyPlugin.ts";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, getEnvironmentVariablesPlugin, useEnvironmentVariable, useEnvironmentVariables } from "@squide/env-vars";
|
|
2
|
+
import { FeatureFlagSetSnapshot, InMemoryLaunchDarklyClient, LaunchDarklyClientNotifier, LaunchDarklyPlugin, LaunchDarklyPluginName, getFeatureFlag, getLaunchDarklyPlugin, useFeatureFlag, useFeatureFlags, useLaunchDarklyClient } from "@squide/launch-darkly";
|
|
2
3
|
import { MswPlugin, MswPluginName, MswState, getMswPlugin } from "@squide/msw";
|
|
3
4
|
import { ActiveRouteIsProtectedEvent, ActiveRouteIsPublicEvent, ApplicationBoostrappedEvent, DeferredRegistrationsUpdatedEvent, ModulesReadyEvent, ModulesRegisteredEvent, MswReadyEvent, ProtectedDataReadyEvent, ProtectedDataUpdatedEvent, PublicDataReadyEvent, PublicDataUpdatedEvent } from "./AppRouterReducer.js";
|
|
4
5
|
export * from "@squide/core";
|
|
@@ -27,6 +28,8 @@ export * from "./initializeFirefly.js";
|
|
|
27
28
|
|
|
28
29
|
;// CONCATENATED MODULE: external "@squide/env-vars"
|
|
29
30
|
|
|
31
|
+
;// CONCATENATED MODULE: external "@squide/launch-darkly"
|
|
32
|
+
|
|
30
33
|
;// CONCATENATED MODULE: external "@squide/msw"
|
|
31
34
|
|
|
32
35
|
;// CONCATENATED MODULE: external "./AppRouterReducer.js"
|
|
@@ -59,6 +62,7 @@ export * from "./initializeFirefly.js";
|
|
|
59
62
|
|
|
60
63
|
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
|
|
66
|
+
export { ActiveRouteIsProtectedEvent, ActiveRouteIsPublicEvent, ApplicationBoostrappedEvent, DeferredRegistrationsUpdatedEvent, EnvironmentVariablesPlugin, EnvironmentVariablesPluginName, FeatureFlagSetSnapshot, InMemoryLaunchDarklyClient, LaunchDarklyClientNotifier, LaunchDarklyPlugin, LaunchDarklyPluginName, ModulesReadyEvent, ModulesRegisteredEvent, MswPlugin, MswPluginName, MswReadyEvent, MswState, ProtectedDataReadyEvent, ProtectedDataUpdatedEvent, PublicDataReadyEvent, PublicDataUpdatedEvent, getEnvironmentVariablesPlugin, getFeatureFlag, getLaunchDarklyPlugin, getMswPlugin, useEnvironmentVariable, useEnvironmentVariables, useFeatureFlag, useFeatureFlags, useLaunchDarklyClient };
|
|
63
67
|
|
|
64
68
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export * from \"@squide/core\";\nexport {\n EnvironmentVariablesPlugin,\n EnvironmentVariablesPluginName,\n getEnvironmentVariablesPlugin,\n useEnvironmentVariable,\n useEnvironmentVariables,\n type EnvironmentVariableKey,\n type EnvironmentVariables,\n type EnvironmentVariablesPluginOptions,\n type
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export * from \"@squide/core\";\nexport {\n EnvironmentVariablesPlugin,\n EnvironmentVariablesPluginName,\n getEnvironmentVariablesPlugin,\n useEnvironmentVariable,\n useEnvironmentVariables,\n type EnvironmentVariableKey,\n type EnvironmentVariables,\n type EnvironmentVariablesPluginOptions\n} from \"@squide/env-vars\";\nexport {\n FeatureFlagSetSnapshot,\n getFeatureFlag,\n getLaunchDarklyPlugin,\n InMemoryLaunchDarklyClient,\n LaunchDarklyClientNotifier,\n LaunchDarklyPlugin,\n LaunchDarklyPluginName,\n useFeatureFlag,\n useFeatureFlags,\n useLaunchDarklyClient,\n type FeatureFlagKey,\n type FeatureFlags,\n type FeatureFlagSetSnapshotChangedListener,\n type InMemoryLaunchDarklyClientOptions,\n type LaunchDarklyClientListener\n} from \"@squide/launch-darkly\";\nexport {\n getMswPlugin,\n MswPlugin,\n MswPluginName,\n MswState,\n type MswPluginOptions,\n type MswPluginRegisterRequestHandlersOptions,\n type MswReadyListener,\n type MswStateOptions\n} from \"@squide/msw\";\nexport * from \"@squide/react-router\";\n\nexport type { FireflyPlugin } from \"./FireflyPlugin.ts\";\nexport * from \"./FireflyProvider.tsx\";\nexport * from \"./FireflyRuntime.tsx\";\n\nexport * from \"./AppRouter.tsx\";\nexport {\n ActiveRouteIsProtectedEvent,\n ActiveRouteIsPublicEvent,\n ApplicationBoostrappedEvent,\n DeferredRegistrationsUpdatedEvent,\n ModulesReadyEvent,\n ModulesRegisteredEvent,\n MswReadyEvent,\n ProtectedDataReadyEvent,\n ProtectedDataUpdatedEvent,\n PublicDataReadyEvent,\n PublicDataUpdatedEvent\n} from \"./AppRouterReducer.ts\";\n\nexport * from \"./AppRouterStore.ts\";\nexport * from \"./GlobalDataQueriesError.ts\";\nexport * from \"./useCanFetchProtectedData.ts\";\nexport * from \"./useCanFetchPublicData.ts\";\nexport * from \"./useCanRegisterDeferredRegistrations.ts\";\nexport * from \"./useCanUpdateDeferredRegistrations.ts\";\nexport * from \"./useDeferredRegistrations.ts\";\nexport * from \"./useIsActiveRouteProtected.ts\";\nexport * from \"./useIsBootstrapping.ts\";\nexport * from \"./useNavigationItems.ts\";\nexport * from \"./useProtectedDataHandler.ts\";\nexport * from \"./useProtectedDataQueries.ts\";\nexport * from \"./usePublicDataHandler.ts\";\nexport * from \"./usePublicDataQueries.ts\";\nexport * from \"./useRegisterDeferredRegistrations.ts\";\nexport * from \"./useStrictRegistrationMode.ts\";\nexport * from \"./useUpdateDeferredRegistrations.ts\";\n\nexport * from \"./initializeFirefly.ts\";\n\n"],"names":["EnvironmentVariablesPlugin","EnvironmentVariablesPluginName","getEnvironmentVariablesPlugin","useEnvironmentVariable","useEnvironmentVariables","FeatureFlagSetSnapshot","getFeatureFlag","getLaunchDarklyPlugin","InMemoryLaunchDarklyClient","LaunchDarklyClientNotifier","LaunchDarklyPlugin","LaunchDarklyPluginName","useFeatureFlag","useFeatureFlags","useLaunchDarklyClient","getMswPlugin","MswPlugin","MswPluginName","MswState","ActiveRouteIsProtectedEvent","ActiveRouteIsPublicEvent","ApplicationBoostrappedEvent","DeferredRegistrationsUpdatedEvent","ModulesReadyEvent","ModulesRegisteredEvent","MswReadyEvent","ProtectedDataReadyEvent","ProtectedDataUpdatedEvent","PublicDataReadyEvent","PublicDataUpdatedEvent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA6B;AAUH;AAiBK;AAUV;AACgB;AAGC;AACD;AAEL;AAaD;AAEK;AACQ;AACE;AACH;AACc;AACF;AACT;AACC;AACP;AACA;AACK;AACA;AACH;AACA;AACY;AACP;AACK;AAEb"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { ModuleDefinition, type ModuleRegisterFunction, type RegisterModulesOptions } from "@squide/core";
|
|
2
2
|
import { EnvironmentVariables } from "@squide/env-vars";
|
|
3
3
|
import type { HoneycombInstrumentationPartialClient } from "@workleap-telemetry/core";
|
|
4
|
+
import { LDClient } from "launchdarkly-js-client-sdk";
|
|
4
5
|
import { FireflyRuntime, type FireflyRuntimeOptions } from "./FireflyRuntime.tsx";
|
|
5
6
|
export declare const ApplicationBootstrappingStartedEvent = "squide-app-bootstrapping-started";
|
|
6
7
|
export type OnInitializationErrorFunction = (error: unknown) => void;
|
|
7
8
|
export type StartMswFunction<TRuntime = FireflyRuntime> = (runtime: TRuntime) => Promise<void>;
|
|
8
9
|
export interface InitializeFireflyOptions<TRuntime extends FireflyRuntime, TContext = unknown, TData = unknown> extends RegisterModulesOptions<TContext>, FireflyRuntimeOptions {
|
|
9
|
-
localModules?: ModuleRegisterFunction<TRuntime, TContext, TData>[];
|
|
10
|
+
localModules?: (ModuleRegisterFunction<TRuntime, TContext, TData> | undefined)[];
|
|
10
11
|
moduleDefinitions?: ModuleDefinition<TRuntime, TContext, TData>[];
|
|
11
12
|
useMsw?: boolean;
|
|
12
13
|
environmentVariables?: Partial<EnvironmentVariables>;
|
|
13
14
|
honeycombInstrumentationClient?: HoneycombInstrumentationPartialClient;
|
|
15
|
+
launchDarklyClient?: LDClient;
|
|
14
16
|
startMsw?: StartMswFunction<FireflyRuntime>;
|
|
15
17
|
onError?: OnInitializationErrorFunction;
|
|
16
18
|
}
|
|
17
|
-
export declare function bootstrap<TRuntime extends FireflyRuntime = FireflyRuntime, TContext = unknown, TData = unknown>(runtime: TRuntime, modulesDefinitions: ModuleDefinition<TRuntime, TContext, TData>[], options?: Omit<InitializeFireflyOptions<TRuntime, TContext, TData>, "localModules" | "moduleDefinitions">): void;
|
|
19
|
+
export declare function bootstrap<TRuntime extends FireflyRuntime = FireflyRuntime, TContext = unknown, TData = unknown>(runtime: TRuntime, modulesDefinitions: (ModuleDefinition<TRuntime, TContext, TData> | undefined)[], options?: Omit<InitializeFireflyOptions<TRuntime, TContext, TData>, "localModules" | "moduleDefinitions">): void;
|
|
18
20
|
export declare function __resetHasExecutedGuard(): void;
|
|
19
21
|
export declare function initializeFirefly<TContext = unknown, TData = unknown>(options?: InitializeFireflyOptions<FireflyRuntime, TContext, TData>): FireflyRuntime<any>;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toLocalModuleDefinitions } from "@squide/core";
|
|
2
|
+
import { isFunction } from "@squide/core/internal";
|
|
2
3
|
import { EnvironmentVariablesPlugin } from "@squide/env-vars";
|
|
4
|
+
import { LaunchDarklyPlugin } from "@squide/launch-darkly";
|
|
3
5
|
import { MswPlugin } from "@squide/msw";
|
|
4
6
|
import { FireflyRuntime } from "./FireflyRuntime.js";
|
|
5
7
|
import { initializeHoneycomb } from "./honeycomb/initializeHoneycomb.js";
|
|
6
8
|
|
|
7
9
|
;// CONCATENATED MODULE: external "@squide/core"
|
|
8
10
|
|
|
11
|
+
;// CONCATENATED MODULE: external "@squide/core/internal"
|
|
12
|
+
|
|
9
13
|
;// CONCATENATED MODULE: external "@squide/env-vars"
|
|
10
14
|
|
|
15
|
+
;// CONCATENATED MODULE: external "@squide/launch-darkly"
|
|
16
|
+
|
|
11
17
|
;// CONCATENATED MODULE: external "@squide/msw"
|
|
12
18
|
|
|
13
19
|
;// CONCATENATED MODULE: external "./FireflyRuntime.js"
|
|
@@ -20,11 +26,13 @@ import { initializeHoneycomb } from "./honeycomb/initializeHoneycomb.js";
|
|
|
20
26
|
|
|
21
27
|
|
|
22
28
|
|
|
29
|
+
|
|
30
|
+
|
|
23
31
|
const ApplicationBootstrappingStartedEvent = "squide-app-bootstrapping-started";
|
|
24
32
|
function bootstrap(runtime, modulesDefinitions, options = {}) {
|
|
25
33
|
const { startMsw, onError, context } = options;
|
|
26
34
|
runtime.eventBus.dispatch(ApplicationBootstrappingStartedEvent);
|
|
27
|
-
runtime.moduleManager.registerModules(modulesDefinitions, {
|
|
35
|
+
runtime.moduleManager.registerModules(modulesDefinitions.filter((x)=>Boolean(x)), {
|
|
28
36
|
context
|
|
29
37
|
}).then((results)=>{
|
|
30
38
|
if (runtime.isMswEnabled) {
|
|
@@ -33,7 +41,7 @@ function bootstrap(runtime, modulesDefinitions, options = {}) {
|
|
|
33
41
|
}
|
|
34
42
|
startMsw(runtime).then(()=>{
|
|
35
43
|
if (runtime.isMswEnabled) {
|
|
36
|
-
runtime.
|
|
44
|
+
runtime.mswState.setAsReady();
|
|
37
45
|
}
|
|
38
46
|
}).catch((error)=>{
|
|
39
47
|
runtime.logger.withText("[squide] An error occured while starting MSW.").withError(error).error();
|
|
@@ -52,7 +60,7 @@ function __resetHasExecutedGuard() {
|
|
|
52
60
|
hasExecuted = false;
|
|
53
61
|
}
|
|
54
62
|
function initializeFirefly(options = {}) {
|
|
55
|
-
const { mode, localModules = [], moduleDefinitions = [], useMsw, plugins = [], environmentVariables, honeycombInstrumentationClient, loggers, onError } = options;
|
|
63
|
+
const { mode, localModules = [], moduleDefinitions = [], useMsw, plugins = [], environmentVariables, honeycombInstrumentationClient, launchDarklyClient, loggers, onError } = options;
|
|
56
64
|
if (hasExecuted) {
|
|
57
65
|
throw new Error("[squide] A squide application can only be initialized once. Did you call the \"initializeSquide\" function twice?");
|
|
58
66
|
}
|
|
@@ -60,6 +68,9 @@ function initializeFirefly(options = {}) {
|
|
|
60
68
|
if (useMsw) {
|
|
61
69
|
plugins.push((x)=>new MswPlugin(x));
|
|
62
70
|
}
|
|
71
|
+
if (launchDarklyClient) {
|
|
72
|
+
plugins.push((x)=>new LaunchDarklyPlugin(x, launchDarklyClient));
|
|
73
|
+
}
|
|
63
74
|
const runtime = new FireflyRuntime({
|
|
64
75
|
mode,
|
|
65
76
|
honeycombInstrumentationClient,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeFirefly.js","sources":["../src/initializeFirefly.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"initializeFirefly.js","sources":["../src/initializeFirefly.ts"],"sourcesContent":["import { ModuleDefinition, toLocalModuleDefinitions, type ModuleRegisterFunction, type RegisterModulesOptions } from \"@squide/core\";\nimport { isFunction } from \"@squide/core/internal\";\nimport { EnvironmentVariables, EnvironmentVariablesPlugin } from \"@squide/env-vars\";\nimport { LaunchDarklyPlugin } from \"@squide/launch-darkly\";\nimport { MswPlugin } from \"@squide/msw\";\nimport type { HoneycombInstrumentationPartialClient } from \"@workleap-telemetry/core\";\nimport { LDClient } from \"launchdarkly-js-client-sdk\";\nimport { FireflyRuntime, type FireflyRuntimeOptions } from \"./FireflyRuntime.tsx\";\nimport { initializeHoneycomb } from \"./honeycomb/initializeHoneycomb.ts\";\n\nexport const ApplicationBootstrappingStartedEvent = \"squide-app-bootstrapping-started\";\n\nexport type OnInitializationErrorFunction = (error: unknown) => void;\n\nexport type StartMswFunction<TRuntime = FireflyRuntime> = (runtime: TRuntime) => Promise<void>;\n\nexport interface InitializeFireflyOptions<TRuntime extends FireflyRuntime, TContext = unknown, TData = unknown> extends RegisterModulesOptions<TContext>, FireflyRuntimeOptions {\n localModules?: (ModuleRegisterFunction<TRuntime, TContext, TData> | undefined)[];\n moduleDefinitions?: ModuleDefinition<TRuntime, TContext, TData>[];\n useMsw?: boolean;\n environmentVariables?: Partial<EnvironmentVariables>;\n honeycombInstrumentationClient?: HoneycombInstrumentationPartialClient;\n launchDarklyClient?: LDClient;\n startMsw?: StartMswFunction<FireflyRuntime>;\n onError?: OnInitializationErrorFunction;\n}\n\nexport function bootstrap<TRuntime extends FireflyRuntime = FireflyRuntime, TContext = unknown, TData = unknown>(\n runtime: TRuntime,\n modulesDefinitions: (ModuleDefinition<TRuntime, TContext, TData> | undefined)[],\n options: Omit<InitializeFireflyOptions<TRuntime, TContext, TData>, \"localModules\" | \"moduleDefinitions\"> = {}\n) {\n const {\n startMsw,\n onError,\n context\n } = options;\n\n runtime.eventBus.dispatch(ApplicationBootstrappingStartedEvent);\n\n runtime.moduleManager.registerModules(\n modulesDefinitions.filter((x): x is ModuleDefinition => Boolean(x)),\n { context }\n ).then(results => {\n if (runtime.isMswEnabled) {\n if (!isFunction(startMsw)) {\n throw new Error(\"[squide] When MSW is enabled, the \\\"startMsw\\\" function must be provided.\");\n }\n\n startMsw(runtime)\n .then(() => {\n if (runtime.isMswEnabled) {\n runtime.mswState.setAsReady();\n }\n })\n .catch((error: unknown) => {\n runtime.logger\n .withText(\"[squide] An error occured while starting MSW.\")\n .withError(error as Error)\n .error();\n });\n }\n\n if (onError) {\n results.forEach(error => {\n onError(error);\n });\n }\n });\n}\n\nlet hasExecuted = false;\n\n// Should only be used by tests.\nexport function __resetHasExecutedGuard() {\n hasExecuted = false;\n}\n\nexport function initializeFirefly<TContext = unknown, TData = unknown>(options: InitializeFireflyOptions<FireflyRuntime, TContext, TData> = {}) {\n const {\n mode,\n localModules = [],\n moduleDefinitions = [],\n useMsw,\n plugins = [],\n environmentVariables,\n honeycombInstrumentationClient,\n launchDarklyClient,\n loggers,\n onError\n } = options;\n\n if (hasExecuted) {\n throw new Error(\"[squide] A squide application can only be initialized once. Did you call the \\\"initializeSquide\\\" function twice?\");\n }\n\n hasExecuted = true;\n\n if (useMsw) {\n plugins.push(x => new MswPlugin(x));\n }\n\n if (launchDarklyClient) {\n plugins.push(x => new LaunchDarklyPlugin(x, launchDarklyClient));\n }\n\n const runtime = new FireflyRuntime({\n mode,\n honeycombInstrumentationClient,\n loggers,\n plugins: [\n x => new EnvironmentVariablesPlugin(x, {\n variables: environmentVariables\n }),\n ...plugins\n ]\n });\n\n initializeHoneycomb(runtime)\n .catch((error: unknown) => {\n if (onError) {\n onError(error);\n }\n })\n .finally(() => {\n bootstrap(\n runtime,\n [...moduleDefinitions, ...toLocalModuleDefinitions(localModules)],\n options\n );\n });\n\n return runtime;\n}\n"],"names":["toLocalModuleDefinitions","isFunction","EnvironmentVariablesPlugin","LaunchDarklyPlugin","MswPlugin","FireflyRuntime","initializeHoneycomb","ApplicationBootstrappingStartedEvent","bootstrap","runtime","modulesDefinitions","options","startMsw","onError","context","x","Boolean","results","Error","error","hasExecuted","__resetHasExecutedGuard","initializeFirefly","mode","localModules","moduleDefinitions","useMsw","plugins","environmentVariables","honeycombInstrumentationClient","launchDarklyClient","loggers"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAoI;AACjF;AACiC;AACzB;AACnB;AAG0C;AACT;AAElE,MAAMO,uCAAuC,mCAAmC;AAiBhF,SAASC,UACZC,OAAiB,EACjBC,kBAA+E,EAC/EC,UAA2G,CAAC,CAAC;IAE7G,MAAM,EACFC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACV,GAAGH;IAEJF,QAAQ,QAAQ,CAAC,QAAQ,CAACF;IAE1BE,QAAQ,aAAa,CAAC,eAAe,CACjCC,mBAAmB,MAAM,CAAC,CAACK,IAA6BC,QAAQD,KAChE;QAAED;IAAQ,GACZ,IAAI,CAACG,CAAAA;QACH,IAAIR,QAAQ,YAAY,EAAE;YACtB,IAAI,CAACR,UAAUA,CAACW,WAAW;gBACvB,MAAM,IAAIM,MAAM;YACpB;YAEAN,SAASH,SACJ,IAAI,CAAC;gBACF,IAAIA,QAAQ,YAAY,EAAE;oBACtBA,QAAQ,QAAQ,CAAC,UAAU;gBAC/B;YACJ,GACC,KAAK,CAAC,CAACU;gBACJV,QAAQ,MAAM,CACT,QAAQ,CAAC,iDACT,SAAS,CAACU,OACV,KAAK;YACd;QACR;QAEA,IAAIN,SAAS;YACTI,QAAQ,OAAO,CAACE,CAAAA;gBACZN,QAAQM;YACZ;QACJ;IACJ;AACJ;AAEA,IAAIC,cAAc;AAElB,gCAAgC;AACzB,SAASC;IACZD,cAAc;AAClB;AAEO,SAASE,kBAAuDX,UAAqE,CAAC,CAAC;IAC1I,MAAM,EACFY,IAAI,EACJC,eAAe,EAAE,EACjBC,oBAAoB,EAAE,EACtBC,MAAM,EACNC,UAAU,EAAE,EACZC,oBAAoB,EACpBC,8BAA8B,EAC9BC,kBAAkB,EAClBC,OAAO,EACPlB,OAAO,EACV,GAAGF;IAEJ,IAAIS,aAAa;QACb,MAAM,IAAIF,MAAM;IACpB;IAEAE,cAAc;IAEd,IAAIM,QAAQ;QACRC,QAAQ,IAAI,CAACZ,CAAAA,IAAK,IAAIX,SAASA,CAACW;IACpC;IAEA,IAAIe,oBAAoB;QACpBH,QAAQ,IAAI,CAACZ,CAAAA,IAAK,IAAIZ,kBAAkBA,CAACY,GAAGe;IAChD;IAEA,MAAMrB,UAAU,IAAIJ,cAAcA,CAAC;QAC/BkB;QACAM;QACAE;QACA,SAAS;YACLhB,CAAAA,IAAK,IAAIb,0BAA0BA,CAACa,GAAG;oBACnC,WAAWa;gBACf;eACGD;SACN;IACL;IAEArB,mBAAmBA,CAACG,SACf,KAAK,CAAC,CAACU;QACJ,IAAIN,SAAS;YACTA,QAAQM;QACZ;IACJ,GACC,OAAO,CAAC;QACLX,UACIC,SACA;eAAIgB;eAAsBzB,wBAAwBA,CAACwB;SAAc,EACjEb;IAER;IAEJ,OAAOF;AACX"}
|
|
@@ -5,10 +5,10 @@ import { useAppRouterState } from "./AppRouterContext.js";
|
|
|
5
5
|
;// CONCATENATED MODULE: ./src/useCanUpdateDeferredRegistrations.ts
|
|
6
6
|
|
|
7
7
|
function useCanUpdateDeferredRegistrations() {
|
|
8
|
-
const { areModulesReady, publicDataUpdatedAt, protectedDataUpdatedAt, deferredRegistrationsUpdatedAt } = useAppRouterState();
|
|
8
|
+
const { areModulesReady, publicDataUpdatedAt, protectedDataUpdatedAt, featureFlagsUpdatedAt, deferredRegistrationsUpdatedAt } = useAppRouterState();
|
|
9
9
|
return(// Do not trigger an update if the deferred registrations has not been registered yet (if there are deferred registrations, once they are
|
|
10
10
|
// registered, the modules will be marked as ready).
|
|
11
|
-
areModulesReady && deferredRegistrationsUpdatedAt && (publicDataUpdatedAt && publicDataUpdatedAt > deferredRegistrationsUpdatedAt || protectedDataUpdatedAt && protectedDataUpdatedAt > deferredRegistrationsUpdatedAt));
|
|
11
|
+
areModulesReady && deferredRegistrationsUpdatedAt && (publicDataUpdatedAt && publicDataUpdatedAt > deferredRegistrationsUpdatedAt || protectedDataUpdatedAt && protectedDataUpdatedAt > deferredRegistrationsUpdatedAt || featureFlagsUpdatedAt && featureFlagsUpdatedAt > deferredRegistrationsUpdatedAt));
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export { useCanUpdateDeferredRegistrations };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCanUpdateDeferredRegistrations.js","sources":["../src/useCanUpdateDeferredRegistrations.ts"],"sourcesContent":["import { useAppRouterState } from \"./AppRouterContext.ts\";\n\nexport function useCanUpdateDeferredRegistrations() {\n const {\n areModulesReady,\n publicDataUpdatedAt,\n protectedDataUpdatedAt,\n deferredRegistrationsUpdatedAt\n } = useAppRouterState();\n\n return (\n // Do not trigger an update if the deferred registrations has not been registered yet (if there are deferred registrations, once they are\n // registered, the modules will be marked as ready).\n areModulesReady\n // Make sure the apps is actually having deferred registrations.\n && deferredRegistrationsUpdatedAt\n // If either the public data or the protected data has been updated, update the deferred registrations.\n && (\n (publicDataUpdatedAt && publicDataUpdatedAt > deferredRegistrationsUpdatedAt) ||\n (protectedDataUpdatedAt && protectedDataUpdatedAt > deferredRegistrationsUpdatedAt)\n )\n );\n}\n"],"names":["useAppRouterState","useCanUpdateDeferredRegistrations","areModulesReady","publicDataUpdatedAt","protectedDataUpdatedAt","deferredRegistrationsUpdatedAt"],"mappings":";;;;;AAA0D;AAEnD,SAASC;IACZ,MAAM,EACFC,eAAe,EACfC,mBAAmB,EACnBC,sBAAsB,EACtBC,8BAA8B,EACjC,
|
|
1
|
+
{"version":3,"file":"useCanUpdateDeferredRegistrations.js","sources":["../src/useCanUpdateDeferredRegistrations.ts"],"sourcesContent":["import { useAppRouterState } from \"./AppRouterContext.ts\";\n\nexport function useCanUpdateDeferredRegistrations() {\n const {\n areModulesReady,\n publicDataUpdatedAt,\n protectedDataUpdatedAt,\n featureFlagsUpdatedAt,\n deferredRegistrationsUpdatedAt\n } = useAppRouterState();\n\n return (\n // Do not trigger an update if the deferred registrations has not been registered yet (if there are deferred registrations, once they are\n // registered, the modules will be marked as ready).\n areModulesReady\n // Make sure the apps is actually having deferred registrations.\n && deferredRegistrationsUpdatedAt\n // If either the public data or the protected data has been updated, update the deferred registrations.\n && (\n (publicDataUpdatedAt && publicDataUpdatedAt > deferredRegistrationsUpdatedAt) ||\n (protectedDataUpdatedAt && protectedDataUpdatedAt > deferredRegistrationsUpdatedAt) ||\n (featureFlagsUpdatedAt && featureFlagsUpdatedAt > deferredRegistrationsUpdatedAt)\n )\n );\n}\n"],"names":["useAppRouterState","useCanUpdateDeferredRegistrations","areModulesReady","publicDataUpdatedAt","protectedDataUpdatedAt","featureFlagsUpdatedAt","deferredRegistrationsUpdatedAt"],"mappings":";;;;;AAA0D;AAEnD,SAASC;IACZ,MAAM,EACFC,eAAe,EACfC,mBAAmB,EACnBC,sBAAsB,EACtBC,qBAAqB,EACrBC,8BAA8B,EACjC,GAAGN,iBAAiBA;IAErB,OACI,yIAAyI;IACzI,oDAAoD;IACpDE,mBAEGI,kCAGC,CAACH,uBAAuBA,sBAAsBG,kCAC7CF,0BAA0BA,yBAAyBE,kCACnDD,yBAAyBA,wBAAwBC,8BAA8B;AAG5F"}
|
|
@@ -3,4 +3,4 @@ export type DeferredRegistrationsErrorCallback = (errors: ModuleRegistrationErro
|
|
|
3
3
|
export interface UseDeferredRegistrationsOptions {
|
|
4
4
|
onError?: DeferredRegistrationsErrorCallback;
|
|
5
5
|
}
|
|
6
|
-
export declare function useDeferredRegistrations(data
|
|
6
|
+
export declare function useDeferredRegistrations(data?: unknown, { onError }?: UseDeferredRegistrationsOptions): void;
|
|
@@ -33,7 +33,7 @@ function useDeferredRegistrations(data, { onError } = {}) {
|
|
|
33
33
|
useEffect(()=>{
|
|
34
34
|
if (canRegisterDeferredRegistrations) {
|
|
35
35
|
const register = async ()=>{
|
|
36
|
-
const errors = await registerDeferredRegistrations(data
|
|
36
|
+
const errors = await registerDeferredRegistrations(data);
|
|
37
37
|
if (errors.length > 0 && onError) {
|
|
38
38
|
onError(errors);
|
|
39
39
|
}
|
|
@@ -44,13 +44,12 @@ function useDeferredRegistrations(data, { onError } = {}) {
|
|
|
44
44
|
canRegisterDeferredRegistrations,
|
|
45
45
|
registerDeferredRegistrations,
|
|
46
46
|
data,
|
|
47
|
-
onError
|
|
48
|
-
runtime
|
|
47
|
+
onError
|
|
49
48
|
]);
|
|
50
49
|
useEffect(()=>{
|
|
51
50
|
if (canUpdateDeferredRegistrations) {
|
|
52
51
|
const update = async ()=>{
|
|
53
|
-
const errors = await updateDeferredRegistrations(data
|
|
52
|
+
const errors = await updateDeferredRegistrations(data);
|
|
54
53
|
if (errors.length > 0 && onError) {
|
|
55
54
|
onError(errors);
|
|
56
55
|
}
|
|
@@ -62,7 +61,9 @@ function useDeferredRegistrations(data, { onError } = {}) {
|
|
|
62
61
|
updateDeferredRegistrations,
|
|
63
62
|
data,
|
|
64
63
|
onError,
|
|
65
|
-
|
|
64
|
+
// Trigger this closure when the feature flags changed. Using the timestamp because the
|
|
65
|
+
// actual feature flags are not forwarded to the deferred registrations.
|
|
66
|
+
runtime.appRouterStore.state.featureFlagsUpdatedAt
|
|
66
67
|
]);
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeferredRegistrations.js","sources":["../src/useDeferredRegistrations.ts"],"sourcesContent":["import { useRuntime, type ModuleRegistrationError } from \"@squide/core\";\nimport { useEffect } from \"react\";\nimport { useCanRegisterDeferredRegistrations } from \"./useCanRegisterDeferredRegistrations.ts\";\nimport { useCanUpdateDeferredRegistrations } from \"./useCanUpdateDeferredRegistrations.ts\";\nimport { useRegisterDeferredRegistrations } from \"./useRegisterDeferredRegistrations.ts\";\nimport { useUpdateDeferredRegistrations } from \"./useUpdateDeferredRegistrations.ts\";\n\nexport type DeferredRegistrationsErrorCallback = (errors: ModuleRegistrationError[]) => void;\n\nexport interface UseDeferredRegistrationsOptions {\n onError?: DeferredRegistrationsErrorCallback;\n}\n\nexport function useDeferredRegistrations(data
|
|
1
|
+
{"version":3,"file":"useDeferredRegistrations.js","sources":["../src/useDeferredRegistrations.ts"],"sourcesContent":["import { useRuntime, type ModuleRegistrationError } from \"@squide/core\";\nimport { useEffect } from \"react\";\nimport { FireflyRuntime } from \"./FireflyRuntime.tsx\";\nimport { useCanRegisterDeferredRegistrations } from \"./useCanRegisterDeferredRegistrations.ts\";\nimport { useCanUpdateDeferredRegistrations } from \"./useCanUpdateDeferredRegistrations.ts\";\nimport { useRegisterDeferredRegistrations } from \"./useRegisterDeferredRegistrations.ts\";\nimport { useUpdateDeferredRegistrations } from \"./useUpdateDeferredRegistrations.ts\";\n\nexport type DeferredRegistrationsErrorCallback = (errors: ModuleRegistrationError[]) => void;\n\nexport interface UseDeferredRegistrationsOptions {\n onError?: DeferredRegistrationsErrorCallback;\n}\n\nexport function useDeferredRegistrations(data?: unknown, { onError }: UseDeferredRegistrationsOptions = {}) {\n const runtime = useRuntime() as FireflyRuntime;\n\n const canRegisterDeferredRegistrations = useCanRegisterDeferredRegistrations();\n const canUpdateDeferredRegistrations = useCanUpdateDeferredRegistrations();\n\n const registerDeferredRegistrations = useRegisterDeferredRegistrations();\n const updateDeferredRegistrations = useUpdateDeferredRegistrations();\n\n useEffect(() => {\n if (canRegisterDeferredRegistrations) {\n const register = async () => {\n const errors = await registerDeferredRegistrations(data);\n\n if (errors.length > 0 && onError) {\n onError(errors);\n }\n };\n\n register();\n }\n }, [canRegisterDeferredRegistrations, registerDeferredRegistrations, data, onError]);\n\n useEffect(() => {\n if (canUpdateDeferredRegistrations) {\n const update = async () => {\n const errors = await updateDeferredRegistrations(data);\n\n if (errors.length > 0 && onError) {\n onError(errors);\n }\n };\n\n update();\n }\n }, [\n canUpdateDeferredRegistrations,\n updateDeferredRegistrations,\n data,\n onError,\n // Trigger this closure when the feature flags changed. Using the timestamp because the\n // actual feature flags are not forwarded to the deferred registrations.\n runtime.appRouterStore.state.featureFlagsUpdatedAt\n ]);\n}\n"],"names":["useRuntime","useEffect","useCanRegisterDeferredRegistrations","useCanUpdateDeferredRegistrations","useRegisterDeferredRegistrations","useUpdateDeferredRegistrations","useDeferredRegistrations","data","onError","runtime","canRegisterDeferredRegistrations","canUpdateDeferredRegistrations","registerDeferredRegistrations","updateDeferredRegistrations","register","errors","update"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAwE;AACtC;AAE6D;AACJ;AACF;AACJ;AAQ9E,SAASM,yBAAyBC,IAAc,EAAE,EAAEC,OAAO,EAAmC,GAAG,CAAC,CAAC;IACtG,MAAMC,UAAUT,UAAUA;IAE1B,MAAMU,mCAAmCR,mCAAmCA;IAC5E,MAAMS,iCAAiCR,iCAAiCA;IAExE,MAAMS,gCAAgCR,gCAAgCA;IACtE,MAAMS,8BAA8BR,8BAA8BA;IAElEJ,SAASA,CAAC;QACN,IAAIS,kCAAkC;YAClC,MAAMI,WAAW;gBACb,MAAMC,SAAS,MAAMH,8BAA8BL;gBAEnD,IAAIQ,OAAO,MAAM,GAAG,KAAKP,SAAS;oBAC9BA,QAAQO;gBACZ;YACJ;YAEAD;QACJ;IACJ,GAAG;QAACJ;QAAkCE;QAA+BL;QAAMC;KAAQ;IAEnFP,SAASA,CAAC;QACN,IAAIU,gCAAgC;YAChC,MAAMK,SAAS;gBACX,MAAMD,SAAS,MAAMF,4BAA4BN;gBAEjD,IAAIQ,OAAO,MAAM,GAAG,KAAKP,SAAS;oBAC9BA,QAAQO;gBACZ;YACJ;YAEAC;QACJ;IACJ,GAAG;QACCL;QACAE;QACAN;QACAC;QACA,uFAAuF;QACvF,wEAAwE;QACxEC,QAAQ,cAAc,CAAC,KAAK,CAAC,qBAAqB;KACrD;AACL"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function useRegisterDeferredRegistrations(): <TData = unknown, TRuntime extends Runtime = Runtime<unknown, unknown, any>>(data: TData, runtime: TRuntime) => Promise<import("@squide/core").ModuleRegistrationError[]>;
|
|
1
|
+
export declare function useRegisterDeferredRegistrations(): <TData = unknown>(data?: TData) => Promise<import("@squide/core").ModuleRegistrationError[]>;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import { useRuntime } from "@squide/core";
|
|
1
2
|
import { useCallback } from "react";
|
|
2
3
|
|
|
4
|
+
;// CONCATENATED MODULE: external "@squide/core"
|
|
5
|
+
|
|
3
6
|
;// CONCATENATED MODULE: external "react"
|
|
4
7
|
|
|
5
8
|
;// CONCATENATED MODULE: ./src/useRegisterDeferredRegistrations.ts
|
|
6
9
|
|
|
10
|
+
|
|
7
11
|
function useRegisterDeferredRegistrations() {
|
|
8
|
-
|
|
12
|
+
const runtime = useRuntime();
|
|
13
|
+
return useCallback((data)=>{
|
|
9
14
|
return runtime.moduleManager.registerDeferredRegistrations(data);
|
|
10
|
-
}, [
|
|
15
|
+
}, [
|
|
16
|
+
runtime
|
|
17
|
+
]);
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
export { useRegisterDeferredRegistrations };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRegisterDeferredRegistrations.js","sources":["../src/useRegisterDeferredRegistrations.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"useRegisterDeferredRegistrations.js","sources":["../src/useRegisterDeferredRegistrations.ts"],"sourcesContent":["import { useRuntime } from \"@squide/core\";\nimport { useCallback } from \"react\";\n\nexport function useRegisterDeferredRegistrations() {\n const runtime = useRuntime();\n\n return useCallback(<TData = unknown>(data?: TData) => {\n return runtime.moduleManager.registerDeferredRegistrations(data);\n }, [runtime]);\n}\n"],"names":["useRuntime","useCallback","useRegisterDeferredRegistrations","runtime","data"],"mappings":";;;;;;;;AAA0C;AACN;AAE7B,SAASE;IACZ,MAAMC,UAAUH,UAAUA;IAE1B,OAAOC,WAAWA,CAAC,CAAkBG;QACjC,OAAOD,QAAQ,aAAa,CAAC,6BAA6B,CAACC;IAC/D,GAAG;QAACD;KAAQ;AAChB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRuntime } from "@squide/core";
|
|
2
|
-
import { useEffect, useSyncExternalStore } from "react";
|
|
2
|
+
import { useCallback, useEffect, useSyncExternalStore } from "react";
|
|
3
3
|
|
|
4
4
|
;// CONCATENATED MODULE: external "@squide/core"
|
|
5
5
|
|
|
@@ -8,17 +8,19 @@ import { useEffect, useSyncExternalStore } from "react";
|
|
|
8
8
|
;// CONCATENATED MODULE: ./src/useStrictRegistrationMode.ts
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
function subscribeToModulesReady(runtime) {
|
|
12
|
-
return (callback)=>{
|
|
13
|
-
runtime.moduleManager.registerModulesReadyListener(callback);
|
|
14
|
-
return ()=>runtime.moduleManager.removeModulesReadyListener(callback);
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
11
|
function useStrictRegistrationMode(options = {}) {
|
|
18
12
|
const { isEnabled = true } = options;
|
|
19
13
|
const runtime = useRuntime();
|
|
14
|
+
const subscribe = useCallback((callback)=>{
|
|
15
|
+
runtime.moduleManager.registerModulesReadyListener(callback);
|
|
16
|
+
return ()=>{
|
|
17
|
+
runtime.moduleManager.removeModulesReadyListener(callback);
|
|
18
|
+
};
|
|
19
|
+
}, [
|
|
20
|
+
runtime
|
|
21
|
+
]);
|
|
20
22
|
// This listener is only executed if the modules are ready.
|
|
21
|
-
const areModulesReady = useSyncExternalStore(
|
|
23
|
+
const areModulesReady = useSyncExternalStore(subscribe, ()=>runtime.moduleManager.getAreModulesReady());
|
|
22
24
|
useEffect(()=>{
|
|
23
25
|
if (areModulesReady && isEnabled) {
|
|
24
26
|
runtime._validateRegistrations();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStrictRegistrationMode.js","sources":["../src/useStrictRegistrationMode.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"useStrictRegistrationMode.js","sources":["../src/useStrictRegistrationMode.ts"],"sourcesContent":["import { useRuntime } from \"@squide/core\";\nimport { useCallback, useEffect, useSyncExternalStore } from \"react\";\n\nexport interface UseStrictRegistrationModeOptions {\n isEnabled?: boolean;\n}\n\nexport function useStrictRegistrationMode(options: UseStrictRegistrationModeOptions = {}) {\n const {\n isEnabled = true\n } = options;\n\n const runtime = useRuntime();\n\n const subscribe = useCallback((callback: () => void) => {\n runtime.moduleManager.registerModulesReadyListener(callback);\n\n return () => {\n runtime.moduleManager.removeModulesReadyListener(callback);\n };\n }, [runtime]);\n\n // This listener is only executed if the modules are ready.\n const areModulesReady = useSyncExternalStore(subscribe, () => runtime.moduleManager.getAreModulesReady());\n\n useEffect(() => {\n if (areModulesReady && isEnabled) {\n runtime._validateRegistrations();\n }\n }, [runtime, areModulesReady, isEnabled]);\n}\n"],"names":["useRuntime","useCallback","useEffect","useSyncExternalStore","useStrictRegistrationMode","options","isEnabled","runtime","subscribe","callback","areModulesReady"],"mappings":";;;;;;;;AAA0C;AAC2B;AAM9D,SAASI,0BAA0BC,UAA4C,CAAC,CAAC;IACpF,MAAM,EACFC,YAAY,IAAI,EACnB,GAAGD;IAEJ,MAAME,UAAUP,UAAUA;IAE1B,MAAMQ,YAAYP,WAAWA,CAAC,CAACQ;QAC3BF,QAAQ,aAAa,CAAC,4BAA4B,CAACE;QAEnD,OAAO;YACHF,QAAQ,aAAa,CAAC,0BAA0B,CAACE;QACrD;IACJ,GAAG;QAACF;KAAQ;IAEZ,2DAA2D;IAC3D,MAAMG,kBAAkBP,oBAAoBA,CAACK,WAAW,IAAMD,QAAQ,aAAa,CAAC,kBAAkB;IAEtGL,SAASA,CAAC;QACN,IAAIQ,mBAAmBJ,WAAW;YAC9BC,QAAQ,sBAAsB;QAClC;IACJ,GAAG;QAACA;QAASG;QAAiBJ;KAAU;AAC5C"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Runtime } from "@squide/core";
|
|
2
1
|
export declare const DeferredRegistrationsUpdateStartedEvent = "squide-deferred-registrations-update-started";
|
|
3
2
|
export declare const DeferredRegistrationsUpdateCompletedEvent = "squide-deferred-registrations-update-completed-started";
|
|
4
|
-
export declare function useUpdateDeferredRegistrations(): <TData = unknown
|
|
3
|
+
export declare function useUpdateDeferredRegistrations(): <TData = unknown>(data?: TData) => Promise<import("@squide/core").ModuleRegistrationError[]>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { useRuntime } from "@squide/core";
|
|
1
2
|
import { useCallback } from "react";
|
|
2
3
|
import { useAppRouterDispatcher } from "./AppRouterContext.js";
|
|
3
4
|
|
|
5
|
+
;// CONCATENATED MODULE: external "@squide/core"
|
|
6
|
+
|
|
4
7
|
;// CONCATENATED MODULE: external "react"
|
|
5
8
|
|
|
6
9
|
;// CONCATENATED MODULE: external "./AppRouterContext.js"
|
|
@@ -8,11 +11,13 @@ import { useAppRouterDispatcher } from "./AppRouterContext.js";
|
|
|
8
11
|
;// CONCATENATED MODULE: ./src/useUpdateDeferredRegistrations.ts
|
|
9
12
|
|
|
10
13
|
|
|
14
|
+
|
|
11
15
|
const DeferredRegistrationsUpdateStartedEvent = "squide-deferred-registrations-update-started";
|
|
12
16
|
const DeferredRegistrationsUpdateCompletedEvent = "squide-deferred-registrations-update-completed-started";
|
|
13
17
|
function useUpdateDeferredRegistrations() {
|
|
18
|
+
const runtime = useRuntime();
|
|
14
19
|
const dispatch = useAppRouterDispatcher();
|
|
15
|
-
return useCallback(async (data
|
|
20
|
+
return useCallback(async (data)=>{
|
|
16
21
|
runtime.eventBus.dispatch(DeferredRegistrationsUpdateStartedEvent);
|
|
17
22
|
const errors = await runtime.moduleManager.updateDeferredRegistrations(data);
|
|
18
23
|
dispatch({
|
|
@@ -21,6 +26,7 @@ function useUpdateDeferredRegistrations() {
|
|
|
21
26
|
runtime.eventBus.dispatch(DeferredRegistrationsUpdateCompletedEvent);
|
|
22
27
|
return errors;
|
|
23
28
|
}, [
|
|
29
|
+
runtime,
|
|
24
30
|
dispatch
|
|
25
31
|
]);
|
|
26
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateDeferredRegistrations.js","sources":["../src/useUpdateDeferredRegistrations.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"useUpdateDeferredRegistrations.js","sources":["../src/useUpdateDeferredRegistrations.ts"],"sourcesContent":["import { useRuntime } from \"@squide/core\";\nimport { useCallback } from \"react\";\nimport { useAppRouterDispatcher } from \"./AppRouterContext.ts\";\n\nexport const DeferredRegistrationsUpdateStartedEvent = \"squide-deferred-registrations-update-started\";\nexport const DeferredRegistrationsUpdateCompletedEvent = \"squide-deferred-registrations-update-completed-started\";\n\nexport function useUpdateDeferredRegistrations() {\n const runtime = useRuntime();\n const dispatch = useAppRouterDispatcher();\n\n return useCallback(async <TData = unknown>(data?: TData) => {\n runtime.eventBus.dispatch(DeferredRegistrationsUpdateStartedEvent);\n\n const errors = await runtime.moduleManager.updateDeferredRegistrations(data);\n\n dispatch({ type: \"deferred-registrations-updated\" });\n\n runtime.eventBus.dispatch(DeferredRegistrationsUpdateCompletedEvent);\n\n return errors;\n }, [runtime, dispatch]);\n}\n"],"names":["useRuntime","useCallback","useAppRouterDispatcher","DeferredRegistrationsUpdateStartedEvent","DeferredRegistrationsUpdateCompletedEvent","useUpdateDeferredRegistrations","runtime","dispatch","data","errors"],"mappings":";;;;;;;;;;;AAA0C;AACN;AAC2B;AAExD,MAAMG,0CAA0C,+CAA+C;AAC/F,MAAMC,4CAA4C,yDAAyD;AAE3G,SAASC;IACZ,MAAMC,UAAUN,UAAUA;IAC1B,MAAMO,WAAWL,sBAAsBA;IAEvC,OAAOD,WAAWA,CAAC,OAAwBO;QACvCF,QAAQ,QAAQ,CAAC,QAAQ,CAACH;QAE1B,MAAMM,SAAS,MAAMH,QAAQ,aAAa,CAAC,2BAA2B,CAACE;QAEvED,SAAS;YAAE,MAAM;QAAiC;QAElDD,QAAQ,QAAQ,CAAC,QAAQ,CAACF;QAE1B,OAAOK;IACX,GAAG;QAACH;QAASC;KAAS;AAC1B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squide/firefly",
|
|
3
3
|
"author": "Workleap",
|
|
4
|
-
"version": "16.
|
|
4
|
+
"version": "16.1.1",
|
|
5
5
|
"description": "Squide bundle for the firefly technology stack.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -33,11 +33,12 @@
|
|
|
33
33
|
],
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@opentelemetry/api": "^1.9.0",
|
|
36
|
-
"@tanstack/react-query": "^5.90.
|
|
37
|
-
"
|
|
36
|
+
"@tanstack/react-query": "^5.90.12",
|
|
37
|
+
"launchdarkly-js-client-sdk": "^3.9.0",
|
|
38
|
+
"msw": "^2.12.4",
|
|
38
39
|
"react": "^18.0.0 || ^19.0.0",
|
|
39
40
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
40
|
-
"react-router": "^7.
|
|
41
|
+
"react-router": "^7.10.1"
|
|
41
42
|
},
|
|
42
43
|
"peerDependenciesMeta": {
|
|
43
44
|
"@opentelemetry/api": {
|
|
@@ -45,31 +46,32 @@
|
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@workleap-telemetry/core": "^1.0.
|
|
49
|
+
"@workleap-telemetry/core": "^1.0.5",
|
|
49
50
|
"@workleap/logging": "^1.3.2",
|
|
50
51
|
"uuid": "^13.0.0",
|
|
51
|
-
"@squide/core": "6.1.
|
|
52
|
-
"@squide/env-vars": "1.4.
|
|
53
|
-
"@squide/
|
|
54
|
-
"@squide/
|
|
52
|
+
"@squide/core": "6.1.7",
|
|
53
|
+
"@squide/env-vars": "1.4.10",
|
|
54
|
+
"@squide/launch-darkly": "1.0.1",
|
|
55
|
+
"@squide/msw": "4.0.8",
|
|
56
|
+
"@squide/react-router": "8.1.7"
|
|
55
57
|
},
|
|
56
58
|
"devDependencies": {
|
|
57
59
|
"@eslint/js": "9.39.1",
|
|
58
|
-
"@rsbuild/core": "1.6.
|
|
59
|
-
"@rslib/core": "0.18.
|
|
60
|
+
"@rsbuild/core": "1.6.14",
|
|
61
|
+
"@rslib/core": "0.18.4",
|
|
60
62
|
"@testing-library/react": "16.3.0",
|
|
61
63
|
"@types/react": "19.2.7",
|
|
62
64
|
"@types/react-dom": "19.2.3",
|
|
63
|
-
"@typescript-eslint/parser": "8.
|
|
64
|
-
"@vitejs/plugin-react": "5.1.
|
|
65
|
-
"@workleap/eslint-configs": "1.1.
|
|
65
|
+
"@typescript-eslint/parser": "8.49.0",
|
|
66
|
+
"@vitejs/plugin-react": "5.1.2",
|
|
67
|
+
"@workleap/eslint-configs": "1.1.6",
|
|
66
68
|
"@workleap/rslib-configs": "1.1.3",
|
|
67
69
|
"@workleap/typescript-configs": "3.0.7",
|
|
68
70
|
"eslint": "9.39.1",
|
|
69
|
-
"happy-dom": "20.0.
|
|
71
|
+
"happy-dom": "20.0.11",
|
|
70
72
|
"typescript": "5.9.3",
|
|
71
|
-
"typescript-eslint": "8.
|
|
72
|
-
"vitest": "4.0.
|
|
73
|
+
"typescript-eslint": "8.49.0",
|
|
74
|
+
"vitest": "4.0.15"
|
|
73
75
|
},
|
|
74
76
|
"sideEffects": false,
|
|
75
77
|
"scripts": {
|
package/src/AppRouter.tsx
CHANGED