@marktiderman/genesis-native 0.4.3 → 0.5.0
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/README.md +98 -6
- package/dist/{block-Onqx7NiK.d.ts → block-DFnC8j5U.d.ts} +53 -3
- package/dist/{blocks-C2RDpvaN.d.ts → blocks-CyXjSGwV.d.ts} +12 -93
- package/dist/{chunk-75YP72G6.js → chunk-6L36FQBX.js} +95 -7
- package/dist/chunk-6L36FQBX.js.map +1 -0
- package/dist/chunk-C54LIT4N.js +73 -0
- package/dist/chunk-C54LIT4N.js.map +1 -0
- package/dist/chunk-MFHOHSEQ.js +249 -0
- package/dist/chunk-MFHOHSEQ.js.map +1 -0
- package/dist/chunk-VIC2KXMA.js +35 -0
- package/dist/chunk-VIC2KXMA.js.map +1 -0
- package/dist/devtools.d.ts +5 -4
- package/dist/devtools.js +3 -1
- package/dist/devtools.js.map +1 -1
- package/dist/index.d.ts +28 -4
- package/dist/index.js +13 -192
- package/dist/index.js.map +1 -1
- package/dist/observability.d.ts +33 -7
- package/dist/observability.js +20 -7
- package/dist/observability.js.map +1 -1
- package/dist/persist.d.ts +2 -1
- package/dist/persist.js +1 -1
- package/dist/push.d.ts +3 -3
- package/dist/query-DobJyRvs.d.ts +208 -0
- package/dist/screen-boundary-BlT6KBpa.d.ts +43 -0
- package/dist/updates.d.ts +2 -2
- package/dist/updates.js +3 -0
- package/dist/updates.js.map +1 -1
- package/dist/web-handoff.d.ts +88 -0
- package/dist/web-handoff.js +78 -0
- package/dist/web-handoff.js.map +1 -0
- package/package.json +10 -5
- package/src/app.tsx +16 -2
- package/src/errors.tsx +46 -7
- package/src/index.ts +24 -0
- package/src/observability/block.tsx +132 -5
- package/src/observability/index.ts +2 -0
- package/src/observability/sentry.ts +41 -6
- package/src/observability/sink.ts +30 -1
- package/src/query.ts +67 -1
- package/src/reload.ts +56 -0
- package/src/screen-boundary.tsx +116 -0
- package/src/updates/channels.ts +3 -0
- package/src/updates/checker.ts +3 -0
- package/src/web-handoff.ts +165 -0
- package/dist/chunk-75YP72G6.js.map +0 -1
- package/dist/chunk-VTJDIKFC.js +0 -39
- package/dist/chunk-VTJDIKFC.js.map +0 -1
- package/dist/query-DUmVAfsF.d.ts +0 -70
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/boot.tsx","../src/errors.tsx","../src/held-link.ts","../src/app.tsx","../src/hydration-gate.ts"],"names":["jsx","useSyncExternalStore","View","Text","useRef","useEffect","client","persistence","session","boot","FatalFallback"],"mappings":";;;;;;;;;;;;;;;;;AA6DO,IAAM,gBAAA,GAAN,cAA+B,KAAA,CAAM;AAAA,EACjC,IAAA;AAAA,EACT,WAAA,CAAY,IAAA,EAAc,EAAA,EAAY,MAAA,GAAS,gBAAA,EAAkB;AAC/D,IAAA,KAAA,CAAM,cAAc,IAAI,CAAA,EAAA,EAAK,MAAM,CAAA,QAAA,EAAW,EAAE,CAAA,IAAA,CAAM,CAAA;AACtD,IAAA,IAAA,CAAK,IAAA,GAAO,kBAAA;AACZ,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AACF;AAEA,IAAM,kBAAA,GAAqB,GAAA;AAEpB,SAAS,QAAQ,KAAA,EAAuB;AAC7C,EAAA,IAAI,KAAA,YAAiB,OAAO,OAAO,KAAA;AACnC,EAAA,OAAO,IAAI,KAAA,CAAM,OAAO,KAAA,KAAU,QAAA,GAAW,QAAQ,eAAA,EAAiB,EAAE,KAAA,EAAO,KAAA,EAAO,CAAA;AACxF;AAGA,SAAS,aAAA,CAAc,SAA2B,EAAA,EAA4C;AAC5F,EAAA,IAAI,KAAA;AACJ,EAAA,OAAO,QAAQ,IAAA,CAAK;AAAA,IAClB,OAAA,CAAQ,IAAA;AAAA,MACN,MAAM,SAAA;AAAA,MACN,MAAM;AAAA,KACR;AAAA,IACA,IAAI,OAAA,CAAmB,CAAC,OAAA,KAAY;AAClC,MAAA,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A,IACH;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT","file":"index.js","sourcesContent":["/**\n * Boot: the async work an app must finish before its first screen (wipe a\n * session left by a reinstall, hydrate stores, load fonts, restore the query\n * cache, read the session).\n *\n * Steps run once each, in order. A step that finished is never run again, so\n * \"try again\" after a failure resumes at the step that failed. Each step has a\n * timeout (10 seconds by default), so a hung step ends in the fatal screen with\n * retry instead of trapping the splash. A minimum keeps a fast boot from\n * flashing the splash.\n *\n * `createBoot` is the controller (no React); `BootProvider` + `useBoot()` read\n * it from components.\n */\nimport { createContext, useContext, useSyncExternalStore, type ReactNode } from \"react\";\n\nexport interface BootStepContext {\n /**\n * Aborted when the step times out. Stop work when it fires: a retry waits\n * for a timed-out run to settle before running the step again.\n */\n signal: AbortSignal;\n}\n\nexport interface BootStep {\n /** Unique within the list; names the step in errors. */\n id: string;\n run: (context: BootStepContext) => Promise<unknown> | unknown;\n /** Overrides the boot's `timeoutMs` for this step. */\n timeoutMs?: number;\n}\n\nexport type BootStatus = \"idle\" | \"booting\" | \"ready\" | \"failed\";\n\nexport interface BootState {\n status: BootStatus;\n /** Set when `status` is `\"failed\"`. */\n error: Error | null;\n /** The id of the step that failed. */\n failedStep: string | null;\n /** Ids of the steps that have finished, in order. */\n completed: readonly string[];\n}\n\nexport interface BootOptions {\n /** Shortest time the boot takes, so the splash doesn't flash. Default 0. */\n minimumMs?: number;\n /** Longest time one step may take. Default 10 000. */\n timeoutMs?: number;\n}\n\nexport interface BootController {\n getState(): BootState;\n subscribe(listener: () => void): () => void;\n /** Run the steps not yet finished. Calling it while a run is in flight returns that run. */\n start(): Promise<void>;\n /** After a failure: run again from the step that failed. */\n retry(): Promise<void>;\n}\n\n/** Thrown when a step takes longer than its timeout. */\nexport class BootTimeoutError extends Error {\n readonly step: string;\n constructor(step: string, ms: number, reason = \"did not finish\") {\n super(`Boot step \"${step}\" ${reason} within ${ms} ms.`);\n this.name = \"BootTimeoutError\";\n this.step = step;\n }\n}\n\nconst DEFAULT_TIMEOUT_MS = 10_000;\n\nexport function toError(value: unknown): Error {\n if (value instanceof Error) return value;\n return new Error(typeof value === \"string\" ? value : \"Unknown error\", { cause: value });\n}\n\n/** Resolves \"settled\" when `promise` settles, \"pending\" after `ms`. */\nfunction settledWithin(promise: Promise<unknown>, ms: number): Promise<\"settled\" | \"pending\"> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n return Promise.race([\n promise.then(\n () => \"settled\" as const,\n () => \"settled\" as const,\n ),\n new Promise<\"pending\">((resolve) => {\n timer = setTimeout(() => resolve(\"pending\"), ms);\n }),\n ]).finally(() => clearTimeout(timer));\n}\n\n/** The boot controller: runs `steps` once each, in order, with a timeout per step. */\nexport function createBoot(steps: readonly BootStep[], options: BootOptions = {}): BootController {\n const seen = new Set<string>();\n for (const step of steps) {\n if (seen.has(step.id)) throw new Error(`Boot step \"${step.id}\" is listed twice.`);\n seen.add(step.id);\n }\n const { minimumMs = 0, timeoutMs = DEFAULT_TIMEOUT_MS } = options;\n const listeners = new Set<() => void>();\n let state: BootState = { status: \"idle\", error: null, failedStep: null, completed: [] };\n let inFlight: Promise<void> | null = null;\n // A step that timed out keeps running (JavaScript can't stop it; `signal`\n // asks it to). A retry waits for it rather than running it twice at once.\n const abandoned = new Map<string, Promise<\"ok\" | \"failed\">>();\n\n const runStep = async (step: BootStep, ms: number): Promise<void> => {\n const previous = abandoned.get(step.id);\n if (previous) {\n if ((await settledWithin(previous, ms)) === \"pending\") {\n throw new BootTimeoutError(step.id, ms, \"is still running from the last attempt\");\n }\n abandoned.delete(step.id);\n // The abandoned run finished after all: it counts.\n if ((await previous) === \"ok\") return;\n }\n const controller = new AbortController();\n const running = Promise.resolve().then(() => step.run({ signal: controller.signal }));\n if ((await settledWithin(running, ms)) === \"pending\") {\n controller.abort();\n abandoned.set(step.id, running.then(() => \"ok\" as const, () => \"failed\" as const));\n throw new BootTimeoutError(step.id, ms);\n }\n await running;\n };\n\n const set = (next: Partial<BootState>) => {\n state = { ...state, ...next };\n for (const listener of listeners) listener();\n };\n\n const run = async () => {\n const started = Date.now();\n set({ status: \"booting\", error: null, failedStep: null });\n for (const step of steps) {\n if (state.completed.includes(step.id)) continue;\n try {\n await runStep(step, step.timeoutMs ?? timeoutMs);\n } catch (error) {\n set({ status: \"failed\", error: toError(error), failedStep: step.id });\n return;\n }\n set({ completed: [...state.completed, step.id] });\n }\n const wait = minimumMs - (Date.now() - started);\n if (wait > 0) await new Promise((resolve) => setTimeout(resolve, wait));\n set({ status: \"ready\" });\n };\n\n const start = () => {\n if (state.status === \"ready\") return Promise.resolve();\n if (!inFlight) {\n inFlight = run().finally(() => {\n inFlight = null;\n });\n }\n return inFlight;\n };\n\n return {\n getState: () => state,\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n start,\n retry: start,\n };\n}\n\nconst BootContext = createContext<BootController | null>(null);\n\n/** Makes a boot readable with `useBoot()`. */\nexport function BootProvider({ boot, children }: { boot: BootController; children: ReactNode }) {\n return <BootContext.Provider value={boot}>{children}</BootContext.Provider>;\n}\n\nexport interface UseBootReturn extends BootState {\n retry: () => void;\n}\n\n/** The boot's status, and `retry` after a failure. Inside `GenesisNativeApp` or a `BootProvider`. */\nexport function useBoot(): UseBootReturn {\n const boot = useContext(BootContext);\n if (!boot) throw new Error(\"useBoot must be used inside <GenesisNativeApp> or <BootProvider>.\");\n const state = useSyncExternalStore(boot.subscribe, boot.getState, boot.getState);\n return { ...state, retry: () => void boot.retry() };\n}\n","/**\n * Errors: a boundary per screen tree, and handlers for errors React never sees\n * (a fatal global error from `ErrorUtils`, an unhandled promise rejection).\n * All of them report through one `onError` (wire Sentry there) and show the\n * fatal screen instead of letting the app die; its \"Try again\" remounts the\n * tree with fresh state.\n */\nimport { Component, type ComponentType, type ErrorInfo, type ReactNode } from \"react\";\nimport { Pressable, Text, View } from \"react-native\";\nimport { NativeButton, NativeEmptyState } from \"@marktiderman/genesis-ui-native/components\";\nimport { toError } from \"./boot\";\n\nexport interface FatalScreenProps {\n error: Error;\n /** Clears the error and remounts the app below the shell (and re-runs a failed boot). */\n retry: () => void;\n}\n\n/** The default fatal screen: what went wrong and \"Try again\". */\nexport function FatalScreen({ error, retry }: FatalScreenProps) {\n return (\n <NativeEmptyState\n variant=\"error\"\n title=\"Something went wrong\"\n body=\"The app hit a problem. Try again, and if it keeps happening, close and reopen the app.\"\n details={error.message}\n primaryAction={\n <NativeButton onPress={retry} testID=\"genesis-fatal-retry\">\n Try again\n </NativeButton>\n }\n testID=\"genesis-fatal\"\n />\n );\n}\n\n/**\n * The last-resort fatal screen: React Native primitives only, no theme, no\n * context, nothing that can itself fail. Shown when the providers could not\n * start, or when the `fatal` slot threw.\n */\nexport function PlainFatalScreen({ error, retry }: FatalScreenProps) {\n return (\n <View testID=\"genesis-fatal-plain\" style={{ flex: 1, justifyContent: \"center\", alignItems: \"center\", padding: 24, gap: 12 }}>\n <Text accessibilityRole=\"header\" style={{ fontSize: 17, fontWeight: \"600\" }}>\n Something went wrong\n </Text>\n <Text style={{ textAlign: \"center\" }}>{error.message}</Text>\n <Pressable accessibilityRole=\"button\" onPress={retry} testID=\"genesis-fatal-plain-retry\" style={{ padding: 12 }}>\n <Text style={{ fontSize: 17 }}>Try again</Text>\n </Pressable>\n </View>\n );\n}\n\nexport interface ErrorReport {\n /** True when the app could not go on (a render error, a failed boot, a fatal global error). */\n fatal: boolean;\n source: \"boundary\" | \"global\" | \"boot\" | \"rejection\";\n componentStack?: string;\n}\n\nexport type OnError = (error: Error, report: ErrorReport) => void;\n\nexport interface GenesisErrorBoundaryProps {\n children?: ReactNode;\n /** What to render instead of the tree that threw. */\n fallback: ComponentType<FatalScreenProps>;\n onError?: OnError;\n /** Change it to clear a caught error (the tree remounts). */\n resetKey?: unknown;\n /** Called by the fallback's retry, after the error is cleared. */\n onRetry?: () => void;\n}\n\ninterface BoundaryState {\n error: Error | null;\n}\n\n/** An error boundary whose fallback gets `{ error, retry }`. */\nexport class GenesisErrorBoundary extends Component<GenesisErrorBoundaryProps, BoundaryState> {\n override state: BoundaryState = { error: null };\n\n static getDerivedStateFromError(error: unknown): BoundaryState {\n return { error: toError(error) };\n }\n\n override componentDidCatch(error: unknown, info: ErrorInfo) {\n this.props.onError?.(toError(error), { fatal: true, source: \"boundary\", componentStack: info.componentStack ?? undefined });\n }\n\n override componentDidUpdate(previous: GenesisErrorBoundaryProps) {\n if (this.state.error && previous.resetKey !== this.props.resetKey) this.setState({ error: null });\n }\n\n retry = () => {\n this.setState({ error: null });\n this.props.onRetry?.();\n };\n\n override render() {\n const { error } = this.state;\n if (!error) return this.props.children ?? null;\n const Fallback = this.props.fallback;\n return <Fallback error={error} retry={this.retry} />;\n }\n}\n\n/** React Native's `ErrorUtils` (a global in every RN app), or a stand-in. */\nexport interface ErrorUtilsLike {\n getGlobalHandler(): ((error: unknown, isFatal?: boolean) => void) | undefined;\n setGlobalHandler(handler: (error: unknown, isFatal?: boolean) => void): void;\n}\n\nexport interface GlobalErrorHandlerOptions {\n errorUtils: ErrorUtilsLike;\n onError?: OnError;\n /** A fatal error: show the fatal screen. The previous handler (which would end the app) is not called. */\n onFatal: (error: Error) => void;\n /**\n * True while a fatal screen is already up. Another fatal error then goes to\n * the previous handler, which ends the app (it restarts clean) rather than\n * leaving it stuck behind a screen that may itself be broken.\n */\n alreadyFatal?: () => boolean;\n}\n\n/**\n * Route global errors to `onError`. A fatal one goes to `onFatal` instead of\n * React Native's default handler, which would close the app; a non-fatal one\n * still reaches the previous handler (LogBox in development). Returns a\n * function that puts the previous handler back.\n */\nexport function installGlobalErrorHandler({ errorUtils, onError, onFatal, alreadyFatal }: GlobalErrorHandlerOptions): () => void {\n const previous = errorUtils.getGlobalHandler();\n errorUtils.setGlobalHandler((raw, isFatal) => {\n const error = toError(raw);\n try {\n onError?.(error, { fatal: Boolean(isFatal), source: \"global\" });\n } catch {\n // A failing reporter must not take the handler down with it.\n }\n if (isFatal && !alreadyFatal?.()) onFatal(error);\n else previous?.(raw, isFatal);\n });\n return () => {\n // With no previous handler, leave one that only logs, never ours (it would call an unmounted app).\n errorUtils.setGlobalHandler(previous ?? ((error) => console.error(error)));\n };\n}\n\n/** `globalThis.ErrorUtils` in a React Native runtime, undefined elsewhere. */\nexport function defaultErrorUtils(): ErrorUtilsLike | undefined {\n const candidate = (globalThis as { ErrorUtils?: ErrorUtilsLike }).ErrorUtils;\n return candidate && typeof candidate.setGlobalHandler === \"function\" ? candidate : undefined;\n}\n\n/** Hermes's `HermesInternal.enablePromiseRejectionTracker`, or a stand-in. */\nexport type EnableRejectionTracker = (options: {\n allRejections: boolean;\n onUnhandled: (id: number, rejection: unknown) => void;\n onHandled: (id: number) => void;\n}) => void;\n\n/**\n * Hermes's rejection tracker, when the app runs on Hermes. React Native sends\n * unhandled rejections to `ExceptionsManager` (LogBox in development), never\n * to `ErrorUtils`' global handler, so without this they never reach `onError`.\n */\nexport function defaultRejectionTracker(): EnableRejectionTracker | undefined {\n const hermes = (globalThis as { HermesInternal?: { enablePromiseRejectionTracker?: EnableRejectionTracker } }).HermesInternal;\n const enable = hermes?.enablePromiseRejectionTracker;\n return typeof enable === \"function\" ? enable.bind(hermes) : undefined;\n}\n\n/**\n * Report unhandled promise rejections to `onError` (non-fatal). This replaces\n * React Native's own tracker, so each rejection is also written with\n * `console.warn`, which LogBox shows in development as before.\n */\nexport function installRejectionTracker({ enable, onError }: { enable: EnableRejectionTracker; onError: OnError }): void {\n enable({\n allRejections: true,\n onUnhandled: (id, rejection) => {\n const error = toError(rejection);\n console.warn(`Uncaught (in promise, id: ${id}): ${error.message}`);\n try {\n onError(error, { fatal: false, source: \"rejection\" });\n } catch {\n // A failing reporter must not throw inside the promise machinery.\n }\n },\n onHandled: () => {},\n });\n}\n","/**\n * Hold a deep link until sign-in completes.\n *\n * expo-router opens every incoming link itself. For a signed-in user that is\n * all that should happen. For a signed-out user, the auth layout redirects to\n * sign-in and the link is lost; holding it lets the app go there once the user\n * has signed in. The hold lives outside React, because expo-router's\n * `+native-intent` runs before any component:\n *\n * // lib/links.ts\n * export const linkHold = createLinkHold();\n * // app/+native-intent.ts\n * export function redirectSystemPath({ path }) {\n * const to = normalizeLink(path, links);\n * if (to && to !== \"/\") linkHold.hold(to);\n * return to;\n * }\n *\n * `useHeldLink` follows a held link only if the user was seen signed out\n * while it was held. A link that arrives while signed in, or at a cold start\n * that turns out signed in, is dropped, since the router already opened it.\n * `GenesisNativeApp` runs it for you (`links.onRelease`).\n */\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nexport interface LinkHold {\n /** Hold `path`, replacing any held one. */\n hold(path: string): void;\n peek(): string | null;\n /** Return the held path and forget it. */\n take(): string | null;\n clear(): void;\n subscribe(listener: () => void): () => void;\n}\n\n/** A place to hold one deep link until sign-in completes; lives outside React. */\nexport function createLinkHold(): LinkHold {\n let held: string | null = null;\n const listeners = new Set<() => void>();\n const set = (next: string | null) => {\n if (held === next) return;\n held = next;\n for (const listener of listeners) listener();\n };\n return {\n hold: (path) => set(path),\n peek: () => held,\n take() {\n const path = held;\n set(null);\n return path;\n },\n clear: () => set(null),\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n\n/** `\"pending\"` while booting or reading the session. */\nexport type HeldLinkAuth = \"pending\" | \"signedOut\" | \"signedIn\";\n\nexport interface UseHeldLinkOptions {\n auth: HeldLinkAuth;\n /** Go there, e.g. `(path) => router.replace(path)`. Called once per link held across a sign-in. */\n onRelease: (path: string) => void;\n}\n\n/** Follow the held link after a sign-in, drop it otherwise; returns the link still held. */\nexport function useHeldLink(hold: LinkHold, { auth, onRelease }: UseHeldLinkOptions): string | null {\n const held = useSyncExternalStore(hold.subscribe, hold.peek, hold.peek);\n const release = useRef(onRelease);\n release.current = onRelease;\n // Was the user signed out while this link was held?\n const waitedForSignIn = useRef(false);\n useEffect(() => {\n if (held === null) {\n waitedForSignIn.current = false;\n return;\n }\n if (auth === \"signedOut\") waitedForSignIn.current = true;\n if (auth !== \"signedIn\") return;\n const path = hold.take();\n const follow = waitedForSignIn.current;\n waitedForSignIn.current = false;\n if (path !== null && follow) release.current(path);\n }, [auth, held, hold]);\n return held;\n}\n","/**\n * `<GenesisNativeApp>`: everything above an Expo app's screens, so the root\n * `_layout.tsx` is a few lines.\n *\n * last-resort boundary (React Native primitives only)\n * └ theme (GenesisThemeProvider, owning the platform color scheme)\n * └ keyboard (`keyboardProvider`, once, then `keyboardScroll` for form screens)\n * └ toasts (`NativeToastProvider`, so `useToast()` works on every screen; `toast={null}` drops it)\n * └ data (GenesisProvider over the Supabase client, the QueryClient)\n * └ session + boot (splash held until both are known)\n * └ blocks' roots (with `blocks`, e.g. updates: force upgrade, maintenance, banner, what's new)\n * └ errorBoundary → `bottomSheet`'s provider, if given → your screens (or `signedOut`)\n *\n * Every error the shell catches goes to each block's `onError` (the\n * observability block reports it) and then to the app's own `onError`.\n *\n * `blocks` (`defineBlock` declarations a native shell can run) are resolved\n * once: requirements checked, boot steps run behind the splash, roots\n * mounted, slot fills put under your `slots`, Settings rows handed to\n * `useBlockSettings`.\n * Global errors, render errors and a failed boot show the `fatal` slot with\n * \"Try again\". Every part is a slot (`slots` / `slotProps`, `null` drops it)\n * and is also exported on its own.\n */\nimport { useEffect, useRef, useState, useSyncExternalStore, type ComponentType, type ReactNode } from \"react\";\nimport { Text, View } from \"react-native\";\nimport type { QueryClient, QueryClientConfig } from \"@tanstack/react-query\";\nimport { GenesisThemeProvider } from \"@marktiderman/genesis-design-system/theme\";\nimport type { CanonicalBrand } from \"@marktiderman/genesis-design-system\";\nimport { GenesisProvider, createSupabaseProvider, type DataProvider, type SupabaseClientInput } from \"@marktiderman/genesis-core/provider\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { KeyboardScrollProvider, type KeyboardScrollProps, type KeyboardToolbarProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport {\n GenesisModulesProvider,\n NativeSheetProvider,\n NativeToastProvider,\n type GenesisModules,\n type NativeSheetLibrary,\n type NativeToastProviderProps,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { BootProvider, createBoot, type BootOptions, type BootStatus, type BootStep } from \"./boot\";\nimport {\n FatalScreen,\n GenesisErrorBoundary,\n PlainFatalScreen,\n defaultErrorUtils,\n defaultRejectionTracker,\n installGlobalErrorHandler,\n installRejectionTracker,\n type EnableRejectionTracker,\n type ErrorUtilsLike,\n type FatalScreenProps,\n type GenesisErrorBoundaryProps,\n type OnError,\n} from \"./errors\";\nimport { SessionProvider, createSessionStore, type AuthClientLike } from \"./auth\";\nimport { useHeldLink, type HeldLinkAuth, type LinkHold } from \"./held-link\";\nimport { connectQueryLifecycle, createNativeQueryClient, type QueryLifecycleOptions, type QueryPersistence } from \"./query\";\nimport { resolveBlocks } from \"@marktiderman/genesis-features/blocks\";\nimport { BlocksProvider, reportToBlocks, type NativeBlock } from \"./blocks\";\nimport type { DevtoolsSlots } from \"./devtools/slots\";\n// Types only: the block's code is in the `/updates` entry and arrives with the `updates` prop.\nimport type { UpdatesBlock, UpdatesSlots } from \"./updates/block\";\n// Types only, likewise: the push block (`/push`) arrives in `blocks`.\nimport type { PushSlots } from \"./push/block\";\n\n/** `expo-splash-screen`, or a stand-in. Call `preventAutoHideAsync()` at module scope yourself too. */\nexport interface SplashModule {\n preventAutoHideAsync?: () => Promise<unknown>;\n hideAsync: () => Promise<unknown>;\n}\n\nexport interface BootScreenProps {\n status: BootStatus;\n}\n\nexport interface SignedOutProps {\n /** Your screens. The default renders them, for an expo-router layout that redirects. */\n children: ReactNode;\n}\n\n// A type, not an interface, so it fits the slots contract's Record constraint.\n// The updates block's slots (`forceUpgrade`, `maintenance`, `updateBanner`,\n// `whatsNew`) render only when the `updates` prop is given.\nexport type NativeAppSlots = UpdatesSlots &\n PushSlots &\n DevtoolsSlots & {\n /** Shown while booting: under the splash at launch, on its own after \"Try again\". Default `BootScreen`. */\n boot: BootScreenProps;\n /** A failed boot, a fatal global error or a render error. Default `FatalScreen`. */\n fatal: FatalScreenProps;\n /** The boundary around your screens. Default `GenesisErrorBoundary`. */\n errorBoundary: GenesisErrorBoundaryProps;\n /** What a signed-out user sees. Default your screens (gate them with `useSession`). */\n signedOut: SignedOutProps;\n};\n\nexport interface NativeQueryClientOptions {\n /** Your own client. Default `createNativeQueryClient(config)`. */\n client?: QueryClient;\n config?: QueryClientConfig;\n}\n\nexport interface GenesisNativeAppProps {\n brand: CanonicalBrand;\n /** A Supabase client (from `createGenesisSupabase` in `@marktiderman/genesis-supabase`). */\n supabase: AuthClientLike & SupabaseClientInput;\n /** The data provider. Default `createSupabaseProvider(supabase)`. */\n provider?: DataProvider;\n queryClient?: NativeQueryClientOptions;\n /**\n * Save queries to the phone: `persistQueries({ storage, keys, buster })`\n * from `@marktiderman/genesis-native/persist`. The saved cache belongs to\n * one user: it is restored only for that user and cleared when the user\n * changes (sign-out, a session that ended while the app was closed, an\n * account switch).\n */\n persist?: (client: QueryClient) => QueryPersistence;\n /** `expo-splash-screen`: hidden once boot has finished and the session is known. */\n splash?: SplashModule;\n /**\n * `KeyboardProvider` from react-native-keyboard-controller, mounted once\n * around the app. Its keyboard views (`keyboardScroll` included) do nothing\n * without it: give both or neither. Read once: it wraps the whole app, so\n * a different component later would remount everything below it. To pass\n * it props, define the wrapper at module scope, not inline.\n */\n keyboardProvider?: ComponentType<{ children: ReactNode }>;\n /** `KeyboardAwareScrollView` from react-native-keyboard-controller, for form screens. Needs `keyboardProvider`. */\n keyboardScroll?: ComponentType<KeyboardScrollProps>;\n /**\n * `KeyboardToolbar` from react-native-keyboard-controller: previous / next /\n * done above the keyboard on Genesis's form layouts. Needs `keyboardScroll`\n * (and so `keyboardProvider`); without them it is ignored.\n */\n keyboardToolbar?: ComponentType<KeyboardToolbarProps>;\n /**\n * The optional native modules the app installed, for Genesis components to\n * use (`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`):\n * FlashList, expo-image, Reanimated, expo-glass-effect, expo-symbols, a\n * lucide icon set, the @expo/ui date picker. Each one left out falls back\n * to plain React Native. Read once.\n */\n modules?: GenesisModules;\n /**\n * `@gorhom/bottom-sheet` v5, to opt every `NativeSheet` into it (snap\n * points, drag between heights): `import * as BottomSheet from \"@gorhom/bottom-sheet\"`,\n * then `bottomSheet={BottomSheet}`. The app mounts `NativeSheetProvider`\n * (and so the library's `BottomSheetModalProvider`) for you; the app's root\n * must still be inside gesture-handler's `GestureHandlerRootView`, with\n * Reanimated set up. Leave it out and sheets are React Native's own modal\n * (an iOS page sheet), which needs neither. Read once.\n */\n bottomSheet?: NativeSheetLibrary;\n /**\n * Toasts (`useToast()` from `@marktiderman/genesis-ui-native`): `NativeToastProvider` is\n * mounted around the screens, at the top of the screen by default (a bottom toast would sit on\n * a tab bar). Pass its options to place it, or `null` to mount your own. Read once.\n */\n toast?: Pick<NativeToastProviderProps, \"position\" | \"disableAnimation\"> | null;\n /** Follow a link held while signed out, once the user signs in. */\n links?: { hold: LinkHold; onRelease: (path: string) => void };\n /** Run before first render, in order (wipe-on-reinstall, hydrate stores, fonts). Read once. */\n steps?: readonly BootStep[];\n bootOptions?: BootOptions;\n /** Longest wait for Supabase's `getSession()` before using the stored session (offline). Default 5000 ms. */\n sessionWaitMs?: number;\n /** Default `globalThis.ErrorUtils`. */\n errorUtils?: ErrorUtilsLike;\n /** Report unhandled promise rejections to `onError`. Default Hermes's tracker; `null` turns it off. */\n rejectionTracker?: EnableRejectionTracker | null;\n /** `AppState` and NetInfo, so queries refetch on focus and know the network. */\n lifecycle?: QueryLifecycleOptions;\n /**\n * Every caught error, after the blocks' own `onError` (the observability\n * block, `createObservability` from `/observability`, reports to Sentry\n * there). A throwing reporter is ignored.\n */\n onError?: OnError;\n /** After a signed-in user signs out, once the query cache is cleared. */\n onSignedOut?: () => void;\n /**\n * The updates block: `createUpdates(…)` from `@marktiderman/genesis-native/updates`\n * (force upgrade, maintenance, the update banner, what's new). Its policy\n * loads behind the splash for at most `policyTimeoutMs` and never fails the\n * boot. Read once; leave it out to turn the block off.\n */\n updates?: UpdatesBlock;\n /**\n * Blocks to run (`createUpdates(…)` is one). Resolved once at start: a\n * block whose requirement is missing, or two blocks contributing the same\n * slot, nav entry or Settings row, shows the fatal screen and reports a\n * `BlockError` to `onError`. Read once.\n */\n blocks?: readonly NativeBlock[];\n /**\n * Your features (FeatureIds) that blocks may require but that aren't\n * blocks. A block requiring anything that is neither one of `blocks` nor\n * listed here is a `BlockError`. Read once.\n */\n appFeatures?: readonly string[];\n slots?: Slots<NativeAppSlots>;\n slotProps?: SlotPropsFor<NativeAppSlots>;\n children?: ReactNode;\n}\n\n/** The default boot slot: a plain loading view (the splash covers it at launch). */\nexport function BootScreen(_props: BootScreenProps) {\n return (\n <View testID=\"genesis-boot\" accessibilityRole=\"progressbar\" style={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}>\n <Text>Loading…</Text>\n </View>\n );\n}\n\nconst PassThrough: ComponentType<SignedOutProps> = ({ children }) => <>{children}</>;\n\n// The web provider's types don't list the native-only prop; Metro resolves the native provider.\nconst ThemeProvider = GenesisThemeProvider as ComponentType<{\n brand: CanonicalBrand;\n syncNativeAppearance?: boolean;\n children: ReactNode;\n}>;\n\n/**\n * The root of an Expo app: theme, keyboard, data, boot behind the splash, errors, session and held links.\n *\n * @stability Beta\n */\nexport function GenesisNativeApp(props: GenesisNativeAppProps) {\n // Above every provider: if one of them (or the shell's own set-up) throws,\n // this shows a screen made of nothing that can fail, and retry starts over.\n const [rootKey, setRootKey] = useState(0);\n const onErrorRef = useRef(props.onError);\n onErrorRef.current = props.onError;\n // The blocks as given, before they are resolved: an error here may come from resolving them.\n const blocksRef = useRef(givenBlocks(props));\n const splashRef = useRef(props.splash);\n splashRef.current = props.splash;\n return (\n <GenesisErrorBoundary\n key={rootKey}\n fallback={PlainFatalScreen}\n onError={(e, r) => {\n reportToBlocks(blocksRef.current, e, r);\n try {\n onErrorRef.current?.(e, r);\n } catch {\n // A failing reporter must not stop the fatal screen.\n }\n // The shell (which hides the splash) never mounted: hide it here, or the screen stays behind it.\n splashRef.current?.hideAsync().catch(() => {});\n }}\n onRetry={() => setRootKey((key) => key + 1)}\n >\n <ThemedShell {...props} />\n </GenesisErrorBoundary>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\n\nconst MISSING_KEYBOARD_PROVIDER =\n \"GenesisNativeApp: `keyboardScroll` was given without `keyboardProvider`, so form screens won't move above the keyboard. \" +\n 'Pass `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nconst TOOLBAR_WITHOUT_SCROLL =\n \"GenesisNativeApp: `keyboardToolbar` was given without `keyboardScroll`, so it is ignored. \" +\n 'Pass `keyboardScroll={KeyboardAwareScrollView}` and `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nfunction ThemedShell(props: GenesisNativeAppProps) {\n const { brand, keyboardScroll, keyboardToolbar } = props;\n // Frozen: a new component type here (an inline wrapper) would remount the shell and reset the app.\n const [Keyboard] = useState(() => props.keyboardProvider);\n // Frozen too: an inline object would hand every component a new module set each render.\n const [modules] = useState(() => props.modules);\n const [toast] = useState(() => (props.toast === null ? null : { position: \"top\" as const, ...props.toast }));\n const missingProvider = Boolean(keyboardScroll) && !Keyboard;\n const toolbarWithoutScroll = Boolean(keyboardToolbar) && !keyboardScroll;\n useEffect(() => {\n if (typeof __DEV__ === \"undefined\" || !__DEV__) return;\n if (missingProvider) console.error(MISSING_KEYBOARD_PROVIDER);\n if (toolbarWithoutScroll) console.error(TOOLBAR_WITHOUT_SCROLL);\n }, [missingProvider, toolbarWithoutScroll]);\n let body = <Shell {...props} />;\n // Inside the modules: a toast animates with Reanimated and draws Liquid Glass when the app gave them.\n if (toast) body = <NativeToastProvider {...toast}>{body}</NativeToastProvider>;\n if (modules) body = <GenesisModulesProvider modules={modules}>{body}</GenesisModulesProvider>;\n if (keyboardScroll) body = <KeyboardScrollProvider component={keyboardScroll} toolbar={keyboardToolbar}>{body}</KeyboardScrollProvider>;\n if (Keyboard) body = <Keyboard>{body}</Keyboard>;\n return (\n <ThemeProvider brand={brand} syncNativeAppearance>\n {body}\n </ThemeProvider>\n );\n}\n\nconst SESSION_STEP_MARGIN_MS = 15_000;\n\nfunction Shell(props: GenesisNativeAppProps) {\n const { supabase, provider, queryClient: queryOptions, persist, splash, links, steps = [], bootOptions, sessionWaitMs = 5000 } = props;\n const { errorUtils, rejectionTracker, lifecycle, slotProps, children } = props;\n const latest = useRef(props);\n latest.current = props;\n const [blockList] = useState(() => givenBlocks(props));\n // Read once, like the keyboard provider: a different module later would remount the screens.\n const [bottomSheet] = useState(() => props.bottomSheet);\n const onError: OnError = (error, report) => {\n reportToBlocks(blockList, error, report);\n try {\n latest.current.onError?.(error, report);\n } catch {\n // A failing reporter must not take the shell down with it.\n }\n };\n // How many fatal screens are up (the global handler lets a second fatal error end the app).\n const fatalShown = useRef(0);\n\n // Created once: the shell's parts live as long as the app.\n const [parts] = useState(() => {\n const list = blockList;\n const blocks = resolveBlocks(list, props.appFeatures ? [...list.map((b) => b.id), ...props.appFeatures] : undefined, {\n platform: \"native\",\n slots: NATIVE_APP_SLOT_NAMES,\n });\n const client = queryOptions?.client ?? createNativeQueryClient(queryOptions?.config);\n const persistence = persist ? persist(client) : null;\n const session = createSessionStore(supabase, {\n waitMs: sessionWaitMs,\n // Another user (or nobody) now: nothing of the last user's may show or stay on disk.\n onUserChange: (previous, next) => {\n client.clear();\n void persistence?.clear();\n if (previous !== null && next === null) latest.current.onSignedOut?.();\n },\n });\n const boot = createBoot(\n [\n ...steps,\n // Blocks' steps, in dependency order (the updates block's settles within its own timeout and never throws).\n ...blocks.blocks.flatMap((block) => block.bootSteps ?? []),\n { id: \"genesis:session\", run: () => session.load(), timeoutMs: sessionWaitMs + SESSION_STEP_MARGIN_MS },\n // After the session, so only the cache saved for this user is restored.\n ...(persistence ? [{ id: \"genesis:query-cache\", run: () => persistence.restore(session.getState().userId ?? \"\") }] : []),\n ],\n bootOptions,\n );\n // One component type for the life of the app, so a re-render never remounts a visible fatal screen.\n function FatalFallback(fallbackProps: FatalScreenProps) {\n useEffect(() => {\n fatalShown.current++;\n return () => {\n fatalShown.current--;\n };\n }, []);\n const { slotProps: sp } = latest.current;\n const s = withBlockSlots(blocks.slots, latest.current.slots);\n return (\n // A `fatal` slot that throws falls back to the plain screen.\n <GenesisErrorBoundary fallback={PlainFatalScreen} onError={onError} onRetry={fallbackProps.retry}>\n {renderSlot(FatalScreen, s?.fatal, fallbackProps, sp?.fatal)}\n </GenesisErrorBoundary>\n );\n }\n return { client, persistence, session, boot, FatalFallback, blocks, provider: provider ?? createSupabaseProvider(supabase) };\n });\n const { boot, session, persistence, client, FatalFallback } = parts;\n const slots = withBlockSlots(parts.blocks.slots, props.slots);\n const bootState = useSyncExternalStore(boot.subscribe, boot.getState, boot.getState);\n const sessionState = useSyncExternalStore(session.subscribe, session.getState, session.getState);\n const [fatal, setFatal] = useState<Error | null>(null);\n const [resetKey, setResetKey] = useState(0);\n\n useEffect(() => session.start(), [session]);\n useEffect(() => {\n void boot.start();\n }, [boot]);\n useEffect(() => {\n if (bootState.status === \"failed\" && bootState.error) onError(bootState.error, { fatal: true, source: \"boot\" });\n }, [bootState.status, bootState.error]);\n useEffect(() => {\n if (bootState.status === \"ready\" && persistence) return persistence.subscribe(sessionState.userId ?? \"\");\n }, [bootState.status, persistence, sessionState.userId]);\n useEffect(() => {\n const utils = errorUtils ?? defaultErrorUtils();\n if (!utils) return;\n return installGlobalErrorHandler({ errorUtils: utils, onError, onFatal: setFatal, alreadyFatal: () => fatalShown.current > 0 });\n }, [errorUtils]);\n useEffect(() => {\n const enable = rejectionTracker === null ? undefined : (rejectionTracker ?? defaultRejectionTracker());\n if (enable) installRejectionTracker({ enable, onError });\n }, [rejectionTracker]);\n useEffect(() => (lifecycle ? connectQueryLifecycle(lifecycle) : undefined), [lifecycle]);\n\n // Splash: up until boot has finished (the session step included), or failed.\n const settled = bootState.status === \"ready\" || bootState.status === \"failed\" || fatal !== null;\n const splashHidden = useRef(false);\n useEffect(() => {\n if (!settled || !splash || splashHidden.current) return;\n splashHidden.current = true;\n splash.hideAsync().catch(() => {});\n }, [settled, splash]);\n\n const auth: HeldLinkAuth = bootState.status !== \"ready\" || sessionState.status === \"loading\" ? \"pending\" : sessionState.status;\n useHeldLink(links?.hold ?? NO_HOLD, { auth: links ? auth : \"pending\", onRelease: (path) => links?.onRelease(path) });\n\n const retry = () => {\n setFatal(null);\n setResetKey((key) => key + 1);\n if (boot.getState().status === \"failed\") void boot.retry();\n };\n\n let content: ReactNode;\n if (fatal) {\n content = <FatalFallback error={fatal} retry={retry} />;\n } else if (bootState.status === \"failed\" && bootState.error) {\n content = <FatalFallback error={bootState.error} retry={retry} />;\n } else if (bootState.status !== \"ready\") {\n content = renderSlot(BootScreen, slots?.boot, { status: bootState.status }, slotProps?.boot);\n } else {\n const screens =\n sessionState.status === \"signedOut\" ? renderSlot(PassThrough, slots?.signedOut, { children }, slotProps?.signedOut) : children;\n const guarded = renderSlot(\n GenesisErrorBoundary,\n slots?.errorBoundary,\n { fallback: FatalFallback, onError, resetKey, onRetry: retry, children: screens },\n slotProps?.errorBoundary,\n );\n // The first block's root is the outermost.\n content = parts.blocks.blocks.reduceRight<ReactNode>((inner, block) => {\n const Root = block.Root;\n return Root ? (\n <Root key={block.id} slots={slots} slotProps={slotProps}>\n {inner}\n </Root>\n ) : (\n inner\n );\n }, guarded);\n }\n\n return (\n <GenesisProvider provider={parts.provider} queryClient={client}>\n <SessionProvider store={session}>\n <BootProvider boot={boot}>\n <BlocksProvider value={parts.blocks}>\n <GenesisErrorBoundary key={resetKey} fallback={FatalFallback} onError={onError} onRetry={retry}>\n {/* Sheet content renders in the library's portal, here: below data, session, boot and blocks. */}\n {bottomSheet ? <NativeSheetProvider bottomSheet={bottomSheet}>{content}</NativeSheetProvider> : content}\n </GenesisErrorBoundary>\n </BlocksProvider>\n </BootProvider>\n </SessionProvider>\n </GenesisProvider>\n );\n}\n\n// Every slot name, checked against NativeAppSlots by the compiler: a block filling any other is a BlockError.\nconst SLOT_NAMES: Record<keyof NativeAppSlots, true> = {\n boot: true,\n fatal: true,\n errorBoundary: true,\n signedOut: true,\n forceUpgrade: true,\n maintenance: true,\n updateBanner: true,\n whatsNew: true,\n devtoolsFeedback: true,\n pushPrompt: true,\n};\nconst NATIVE_APP_SLOT_NAMES: readonly string[] = Object.keys(SLOT_NAMES);\n\n/** Blocks' slot fills under the app's own slots: the app's (a component or `null`) always win. */\nfunction withBlockSlots(fills: Readonly<Record<string, unknown>>, own: Slots<NativeAppSlots> | undefined): Slots<NativeAppSlots> | undefined {\n if (Object.keys(fills).length === 0) return own;\n return { ...(fills as Slots<NativeAppSlots>), ...own };\n}\n\n/** `blocks`, with `updates` added when it was given on its own (given both ways, it runs once). */\nfunction givenBlocks(props: Pick<GenesisNativeAppProps, \"blocks\" | \"updates\">): readonly NativeBlock[] {\n const given = props.blocks ?? [];\n return props.updates && !given.includes(props.updates) ? [...given, props.updates] : given;\n}\n\nconst NO_HOLD: LinkHold = {\n hold: () => {},\n peek: () => null,\n take: () => null,\n clear: () => {},\n subscribe: () => () => {},\n};\n","/**\n * A hydration gate holds writes until a persisted store has loaded from disk.\n *\n * The bug it prevents: a persisted store (zustand `persist`, say) is created\n * with defaults, something sets a value before the saved state has been read,\n * and that write lands on disk first, replacing what the user had. With the\n * gate, a write made before hydration never reaches disk (`storage()`), or\n * waits for it (`run()`).\n *\n * const gate = createHydrationGate();\n * persist(store, {\n * storage: createJSONStorage(() => gate.storage(AsyncStorage)),\n * // Open only after a good read: after a failed one, writes would replace what's on disk.\n * onRehydrateStorage: () => (_state, error) => {\n * if (!error) gate.markHydrated();\n * },\n * });\n */\nimport type { AsyncStorageLike } from \"./query\";\n\nexport interface HydrationGate {\n readonly hydrated: boolean;\n /** Call once the store has read its saved state. Idempotent. */\n markHydrated(): void;\n /** Resolves once hydrated. */\n whenHydrated(): Promise<void>;\n /** Run a write now if hydrated, otherwise once hydrated. */\n run<T>(write: () => T | Promise<T>): Promise<T>;\n /**\n * The storage, with writes made before hydration dropped (reads pass\n * through, since hydration is a read). After hydration the store writes\n * its merged state on its next change, so nothing is lost but the stale\n * write. (A zustand migration's own write during hydration is dropped too;\n * the old version stays on disk and is migrated again until then.)\n */\n storage<S extends AsyncStorageLike>(storage: S): S;\n}\n\nexport interface HydrationGateOptions {\n /** Told about each write `storage()` dropped (to log it in development). */\n onDroppedWrite?: (key: string) => void;\n}\n\n/** A gate that holds writes until a persisted store has hydrated. */\nexport function createHydrationGate({ onDroppedWrite }: HydrationGateOptions = {}): HydrationGate {\n let hydrated = false;\n let open!: () => void;\n const opened = new Promise<void>((resolve) => {\n open = resolve;\n });\n\n const gate: HydrationGate = {\n get hydrated() {\n return hydrated;\n },\n markHydrated() {\n if (hydrated) return;\n hydrated = true;\n open();\n },\n whenHydrated: () => opened,\n async run(write) {\n if (!hydrated) await opened;\n return write();\n },\n storage(storage) {\n const setItem = async (key: string, value: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.setItem(key, value);\n };\n const removeItem = async (key: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.removeItem(key);\n };\n // A proxy, not a spread: a storage class's prototype methods (and its\n // private fields, through `this`) keep working.\n return new Proxy(storage, {\n get(target, property) {\n if (property === \"setItem\") return setItem;\n if (property === \"removeItem\") return removeItem;\n const value = Reflect.get(target, property, target) as unknown;\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n },\n };\n return gate;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/held-link.ts","../src/app.tsx","../src/hydration-gate.ts"],"names":["useRef","useEffect","client","persistence","session","boot","FatalFallback","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoCO,SAAS,cAAA,GAA2B;AACzC,EAAA,IAAI,IAAA,GAAsB,IAAA;AAC1B,EAAA,MAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,EAAA,MAAM,GAAA,GAAM,CAAC,IAAA,KAAwB;AACnC,IAAA,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ACpB,UAAA,IAAI,QAAA,KAAa,WAAW,OAAO,OAAA;AACnC,UAAA,IAAI,QAAA,KAAa,cAAc,OAAO,UAAA;AACtC,UAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,UAAU,MAAM,CAAA;AAClD,UAAA,OAAO,OAAO,KAAA,KAAU,UAAA,GAAa,KAAA,CAAM,IAAA,CAAK,MAAM,CAAA,GAAI,KAAA;AAAA,QAC5D;AAAA,OACD,CAAA;AAAA,IACH;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT","file":"index.js","sourcesContent":["/**\n * Hold a deep link until sign-in completes.\n *\n * expo-router opens every incoming link itself. For a signed-in user that is\n * all that should happen. For a signed-out user, the auth layout redirects to\n * sign-in and the link is lost; holding it lets the app go there once the user\n * has signed in. The hold lives outside React, because expo-router's\n * `+native-intent` runs before any component:\n *\n * // lib/links.ts\n * export const linkHold = createLinkHold();\n * // app/+native-intent.ts\n * export function redirectSystemPath({ path }) {\n * const to = normalizeLink(path, links);\n * if (to && to !== \"/\") linkHold.hold(to);\n * return to;\n * }\n *\n * `useHeldLink` follows a held link only if the user was seen signed out\n * while it was held. A link that arrives while signed in, or at a cold start\n * that turns out signed in, is dropped, since the router already opened it.\n * `GenesisNativeApp` runs it for you (`links.onRelease`).\n */\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nexport interface LinkHold {\n /** Hold `path`, replacing any held one. */\n hold(path: string): void;\n peek(): string | null;\n /** Return the held path and forget it. */\n take(): string | null;\n clear(): void;\n subscribe(listener: () => void): () => void;\n}\n\n/** A place to hold one deep link until sign-in completes; lives outside React. */\nexport function createLinkHold(): LinkHold {\n let held: string | null = null;\n const listeners = new Set<() => void>();\n const set = (next: string | null) => {\n if (held === next) return;\n held = next;\n for (const listener of listeners) listener();\n };\n return {\n hold: (path) => set(path),\n peek: () => held,\n take() {\n const path = held;\n set(null);\n return path;\n },\n clear: () => set(null),\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n\n/** `\"pending\"` while booting or reading the session. */\nexport type HeldLinkAuth = \"pending\" | \"signedOut\" | \"signedIn\";\n\nexport interface UseHeldLinkOptions {\n auth: HeldLinkAuth;\n /** Go there, e.g. `(path) => router.replace(path)`. Called once per link held across a sign-in. */\n onRelease: (path: string) => void;\n}\n\n/** Follow the held link after a sign-in, drop it otherwise; returns the link still held. */\nexport function useHeldLink(hold: LinkHold, { auth, onRelease }: UseHeldLinkOptions): string | null {\n const held = useSyncExternalStore(hold.subscribe, hold.peek, hold.peek);\n const release = useRef(onRelease);\n release.current = onRelease;\n // Was the user signed out while this link was held?\n const waitedForSignIn = useRef(false);\n useEffect(() => {\n if (held === null) {\n waitedForSignIn.current = false;\n return;\n }\n if (auth === \"signedOut\") waitedForSignIn.current = true;\n if (auth !== \"signedIn\") return;\n const path = hold.take();\n const follow = waitedForSignIn.current;\n waitedForSignIn.current = false;\n if (path !== null && follow) release.current(path);\n }, [auth, held, hold]);\n return held;\n}\n","/**\n * `<GenesisNativeApp>`: everything above an Expo app's screens, so the root\n * `_layout.tsx` is a few lines.\n *\n * last-resort boundary (React Native primitives only)\n * └ theme (GenesisThemeProvider, owning the platform color scheme)\n * └ keyboard (`keyboardProvider`, once, then `keyboardScroll` for form screens)\n * └ toasts (`NativeToastProvider`, so `useToast()` works on every screen; `toast={null}` drops it)\n * └ data (GenesisProvider over the Supabase client, the QueryClient)\n * └ session + boot (splash held until both are known)\n * └ blocks' roots (with `blocks`, e.g. updates: force upgrade, maintenance, banner, what's new)\n * └ errorBoundary → `bottomSheet`'s provider, if given → your screens (or `signedOut`)\n *\n * Every error the shell catches goes to each block's `onError` (the\n * observability block reports it) and then to the app's own `onError`:\n * render, global, boot and unhandled-rejection errors, and queries and\n * mutations that failed unexpectedly (`reportQueryErrors`).\n *\n * `blocks` (`defineBlock` declarations a native shell can run) are resolved\n * once: requirements checked, boot steps run behind the splash, roots\n * mounted, slot fills put under your `slots`, Settings rows handed to\n * `useBlockSettings`.\n * Global errors, render errors and a failed boot show the `fatal` slot with\n * \"Try again\". Every part is a slot (`slots` / `slotProps`, `null` drops it)\n * and is also exported on its own.\n */\nimport { useEffect, useRef, useState, useSyncExternalStore, type ComponentType, type ReactNode } from \"react\";\nimport { Text, View } from \"react-native\";\nimport type { QueryClient, QueryClientConfig } from \"@tanstack/react-query\";\nimport { GenesisThemeProvider } from \"@marktiderman/genesis-design-system/theme\";\nimport type { CanonicalBrand } from \"@marktiderman/genesis-design-system\";\nimport { GenesisProvider, createSupabaseProvider, type DataProvider, type SupabaseClientInput } from \"@marktiderman/genesis-core/provider\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { KeyboardScrollProvider, type KeyboardScrollProps, type KeyboardToolbarProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport {\n GenesisModulesProvider,\n NativeSheetProvider,\n NativeToastProvider,\n type GenesisModules,\n type NativeSheetLibrary,\n type NativeToastProviderProps,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { BootProvider, createBoot, type BootOptions, type BootStatus, type BootStep } from \"./boot\";\nimport {\n FatalScreen,\n GenesisErrorBoundary,\n PlainFatalScreen,\n defaultErrorUtils,\n defaultRejectionTracker,\n installGlobalErrorHandler,\n installRejectionTracker,\n type EnableRejectionTracker,\n type ErrorUtilsLike,\n type FatalScreenProps,\n type GenesisErrorBoundaryProps,\n type OnError,\n} from \"./errors\";\nimport { SessionProvider, createSessionStore, type AuthClientLike } from \"./auth\";\nimport { useHeldLink, type HeldLinkAuth, type LinkHold } from \"./held-link\";\nimport { connectQueryLifecycle, createNativeQueryClient, reportQueryErrors, type QueryLifecycleOptions, type QueryPersistence } from \"./query\";\nimport { resolveBlocks } from \"@marktiderman/genesis-features/blocks\";\nimport { BlocksProvider, reportToBlocks, type NativeBlock } from \"./blocks\";\nimport type { DevtoolsSlots } from \"./devtools/slots\";\n// Types only: the block's code is in the `/updates` entry and arrives with the `updates` prop.\nimport type { UpdatesBlock, UpdatesSlots } from \"./updates/block\";\n// Types only, likewise: the push block (`/push`) arrives in `blocks`.\nimport type { PushSlots } from \"./push/block\";\n\n/** `expo-splash-screen`, or a stand-in. Call `preventAutoHideAsync()` at module scope yourself too. */\nexport interface SplashModule {\n preventAutoHideAsync?: () => Promise<unknown>;\n hideAsync: () => Promise<unknown>;\n}\n\nexport interface BootScreenProps {\n status: BootStatus;\n}\n\nexport interface SignedOutProps {\n /** Your screens. The default renders them, for an expo-router layout that redirects. */\n children: ReactNode;\n}\n\n// A type, not an interface, so it fits the slots contract's Record constraint.\n// The updates block's slots (`forceUpgrade`, `maintenance`, `updateBanner`,\n// `whatsNew`) render only when the `updates` prop is given.\nexport type NativeAppSlots = UpdatesSlots &\n PushSlots &\n DevtoolsSlots & {\n /** Shown while booting: under the splash at launch, on its own after \"Try again\". Default `BootScreen`. */\n boot: BootScreenProps;\n /** A failed boot, a fatal global error or a render error. Default `FatalScreen`. */\n fatal: FatalScreenProps;\n /** The boundary around your screens. Default `GenesisErrorBoundary`. */\n errorBoundary: GenesisErrorBoundaryProps;\n /** What a signed-out user sees. Default your screens (gate them with `useSession`). */\n signedOut: SignedOutProps;\n};\n\nexport interface NativeQueryClientOptions {\n /** Your own client. Default `createNativeQueryClient(config)`. */\n client?: QueryClient;\n config?: QueryClientConfig;\n}\n\nexport interface GenesisNativeAppProps {\n brand: CanonicalBrand;\n /** A Supabase client (from `createGenesisSupabase` in `@marktiderman/genesis-supabase`). */\n supabase: AuthClientLike & SupabaseClientInput;\n /** The data provider. Default `createSupabaseProvider(supabase)`. */\n provider?: DataProvider;\n queryClient?: NativeQueryClientOptions;\n /**\n * Save queries to the phone: `persistQueries({ storage, keys, buster })`\n * from `@marktiderman/genesis-native/persist`. The saved cache belongs to\n * one user: it is restored only for that user and cleared when the user\n * changes (sign-out, a session that ended while the app was closed, an\n * account switch).\n */\n persist?: (client: QueryClient) => QueryPersistence;\n /** `expo-splash-screen`: hidden once boot has finished and the session is known. */\n splash?: SplashModule;\n /**\n * `KeyboardProvider` from react-native-keyboard-controller, mounted once\n * around the app. Its keyboard views (`keyboardScroll` included) do nothing\n * without it: give both or neither. Read once: it wraps the whole app, so\n * a different component later would remount everything below it. To pass\n * it props, define the wrapper at module scope, not inline.\n */\n keyboardProvider?: ComponentType<{ children: ReactNode }>;\n /** `KeyboardAwareScrollView` from react-native-keyboard-controller, for form screens. Needs `keyboardProvider`. */\n keyboardScroll?: ComponentType<KeyboardScrollProps>;\n /**\n * `KeyboardToolbar` from react-native-keyboard-controller: previous / next /\n * done above the keyboard on Genesis's form layouts. Needs `keyboardScroll`\n * (and so `keyboardProvider`); without them it is ignored.\n */\n keyboardToolbar?: ComponentType<KeyboardToolbarProps>;\n /**\n * The optional native modules the app installed, for Genesis components to\n * use (`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`):\n * FlashList, expo-image, Reanimated, expo-glass-effect, expo-symbols, a\n * lucide icon set, the @expo/ui date picker. Each one left out falls back\n * to plain React Native. Read once.\n */\n modules?: GenesisModules;\n /**\n * `@gorhom/bottom-sheet` v5, to opt every `NativeSheet` into it (snap\n * points, drag between heights): `import * as BottomSheet from \"@gorhom/bottom-sheet\"`,\n * then `bottomSheet={BottomSheet}`. The app mounts `NativeSheetProvider`\n * (and so the library's `BottomSheetModalProvider`) for you; the app's root\n * must still be inside gesture-handler's `GestureHandlerRootView`, with\n * Reanimated set up. Leave it out and sheets are React Native's own modal\n * (an iOS page sheet), which needs neither. Read once.\n */\n bottomSheet?: NativeSheetLibrary;\n /**\n * Toasts (`useToast()` from `@marktiderman/genesis-ui-native`): `NativeToastProvider` is\n * mounted around the screens, at the top of the screen by default (a bottom toast would sit on\n * a tab bar). Pass its options to place it, or `null` to mount your own. Read once.\n */\n toast?: Pick<NativeToastProviderProps, \"position\" | \"disableAnimation\"> | null;\n /** Follow a link held while signed out, once the user signs in. */\n links?: { hold: LinkHold; onRelease: (path: string) => void };\n /** Run before first render, in order (wipe-on-reinstall, hydrate stores, fonts). Read once. */\n steps?: readonly BootStep[];\n bootOptions?: BootOptions;\n /** Longest wait for Supabase's `getSession()` before using the stored session (offline). Default 5000 ms. */\n sessionWaitMs?: number;\n /** Default `globalThis.ErrorUtils`. */\n errorUtils?: ErrorUtilsLike;\n /** Report unhandled promise rejections to `onError`. Default Hermes's tracker; `null` turns it off. */\n rejectionTracker?: EnableRejectionTracker | null;\n /** `AppState` and NetInfo, so queries refetch on focus and know the network. */\n lifecycle?: QueryLifecycleOptions;\n /**\n * Report queries and mutations that failed for good to `onError` (and so\n * to the observability block), non-fatal, as `query` / `mutation` with the\n * key's first segment as a tag. Only unexpected errors: offline, signed\n * out, not found and the server's expected refusals are left to the\n * screen. One query opts out with `meta: { reportErrors: false }`.\n * Default true. Read once.\n */\n reportQueryErrors?: boolean;\n /**\n * Every caught error, after the blocks' own `onError` (the observability\n * block, `createObservability` from `/observability`, reports to Sentry\n * there). A throwing reporter is ignored.\n */\n onError?: OnError;\n /** After a signed-in user signs out, once the query cache is cleared. */\n onSignedOut?: () => void;\n /**\n * The updates block: `createUpdates(…)` from `@marktiderman/genesis-native/updates`\n * (force upgrade, maintenance, the update banner, what's new). Its policy\n * loads behind the splash for at most `policyTimeoutMs` and never fails the\n * boot. Read once; leave it out to turn the block off.\n */\n updates?: UpdatesBlock;\n /**\n * Blocks to run (`createUpdates(…)` is one). Resolved once at start: a\n * block whose requirement is missing, or two blocks contributing the same\n * slot, nav entry or Settings row, shows the fatal screen and reports a\n * `BlockError` to `onError`. Read once.\n */\n blocks?: readonly NativeBlock[];\n /**\n * Your features (FeatureIds) that blocks may require but that aren't\n * blocks. A block requiring anything that is neither one of `blocks` nor\n * listed here is a `BlockError`. Read once.\n */\n appFeatures?: readonly string[];\n slots?: Slots<NativeAppSlots>;\n slotProps?: SlotPropsFor<NativeAppSlots>;\n children?: ReactNode;\n}\n\n/** The default boot slot: a plain loading view (the splash covers it at launch). */\nexport function BootScreen(_props: BootScreenProps) {\n return (\n <View testID=\"genesis-boot\" accessibilityRole=\"progressbar\" style={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}>\n <Text>Loading…</Text>\n </View>\n );\n}\n\nconst PassThrough: ComponentType<SignedOutProps> = ({ children }) => <>{children}</>;\n\n// The web provider's types don't list the native-only prop; Metro resolves the native provider.\nconst ThemeProvider = GenesisThemeProvider as ComponentType<{\n brand: CanonicalBrand;\n syncNativeAppearance?: boolean;\n children: ReactNode;\n}>;\n\n/**\n * The root of an Expo app: theme, keyboard, data, boot behind the splash, errors, session and held links.\n *\n * @stability Beta\n */\nexport function GenesisNativeApp(props: GenesisNativeAppProps) {\n // Above every provider: if one of them (or the shell's own set-up) throws,\n // this shows a screen made of nothing that can fail, and retry starts over.\n const [rootKey, setRootKey] = useState(0);\n const onErrorRef = useRef(props.onError);\n onErrorRef.current = props.onError;\n // The blocks as given, before they are resolved: an error here may come from resolving them.\n const blocksRef = useRef(givenBlocks(props));\n const splashRef = useRef(props.splash);\n splashRef.current = props.splash;\n return (\n <GenesisErrorBoundary\n key={rootKey}\n fallback={PlainFatalScreen}\n onError={(e, r) => {\n reportToBlocks(blocksRef.current, e, r);\n try {\n onErrorRef.current?.(e, r);\n } catch {\n // A failing reporter must not stop the fatal screen.\n }\n // The shell (which hides the splash) never mounted: hide it here, or the screen stays behind it.\n splashRef.current?.hideAsync().catch(() => {});\n }}\n onRetry={() => setRootKey((key) => key + 1)}\n >\n <ThemedShell {...props} />\n </GenesisErrorBoundary>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\n\nconst MISSING_KEYBOARD_PROVIDER =\n \"GenesisNativeApp: `keyboardScroll` was given without `keyboardProvider`, so form screens won't move above the keyboard. \" +\n 'Pass `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nconst TOOLBAR_WITHOUT_SCROLL =\n \"GenesisNativeApp: `keyboardToolbar` was given without `keyboardScroll`, so it is ignored. \" +\n 'Pass `keyboardScroll={KeyboardAwareScrollView}` and `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nfunction ThemedShell(props: GenesisNativeAppProps) {\n const { brand, keyboardScroll, keyboardToolbar } = props;\n // Frozen: a new component type here (an inline wrapper) would remount the shell and reset the app.\n const [Keyboard] = useState(() => props.keyboardProvider);\n // Frozen too: an inline object would hand every component a new module set each render.\n const [modules] = useState(() => props.modules);\n const [toast] = useState(() => (props.toast === null ? null : { position: \"top\" as const, ...props.toast }));\n const missingProvider = Boolean(keyboardScroll) && !Keyboard;\n const toolbarWithoutScroll = Boolean(keyboardToolbar) && !keyboardScroll;\n useEffect(() => {\n if (typeof __DEV__ === \"undefined\" || !__DEV__) return;\n // genesis-allow-console: development-only set-up mistakes, shown as LogBox errors on purpose.\n if (missingProvider) console.error(MISSING_KEYBOARD_PROVIDER);\n if (toolbarWithoutScroll) console.error(TOOLBAR_WITHOUT_SCROLL);\n }, [missingProvider, toolbarWithoutScroll]);\n let body = <Shell {...props} />;\n // Inside the modules: a toast animates with Reanimated and draws Liquid Glass when the app gave them.\n if (toast) body = <NativeToastProvider {...toast}>{body}</NativeToastProvider>;\n if (modules) body = <GenesisModulesProvider modules={modules}>{body}</GenesisModulesProvider>;\n if (keyboardScroll) body = <KeyboardScrollProvider component={keyboardScroll} toolbar={keyboardToolbar}>{body}</KeyboardScrollProvider>;\n if (Keyboard) body = <Keyboard>{body}</Keyboard>;\n return (\n <ThemeProvider brand={brand} syncNativeAppearance>\n {body}\n </ThemeProvider>\n );\n}\n\nconst SESSION_STEP_MARGIN_MS = 15_000;\n\nfunction Shell(props: GenesisNativeAppProps) {\n const { supabase, provider, queryClient: queryOptions, persist, splash, links, steps = [], bootOptions, sessionWaitMs = 5000 } = props;\n const { errorUtils, rejectionTracker, lifecycle, slotProps, children } = props;\n const latest = useRef(props);\n latest.current = props;\n const [blockList] = useState(() => givenBlocks(props));\n // Read once, like the keyboard provider: a different module later would remount the screens.\n const [bottomSheet] = useState(() => props.bottomSheet);\n const onError: OnError = (error, report) => {\n reportToBlocks(blockList, error, report);\n try {\n latest.current.onError?.(error, report);\n } catch {\n // A failing reporter must not take the shell down with it.\n }\n };\n // How many fatal screens are up (the global handler lets a second fatal error end the app).\n const fatalShown = useRef(0);\n\n // Created once: the shell's parts live as long as the app.\n const [parts] = useState(() => {\n const list = blockList;\n const blocks = resolveBlocks(list, props.appFeatures ? [...list.map((b) => b.id), ...props.appFeatures] : undefined, {\n platform: \"native\",\n slots: NATIVE_APP_SLOT_NAMES,\n });\n const client = queryOptions?.client ?? createNativeQueryClient(queryOptions?.config);\n const persistence = persist ? persist(client) : null;\n const session = createSessionStore(supabase, {\n waitMs: sessionWaitMs,\n // Another user (or nobody) now: nothing of the last user's may show or stay on disk.\n onUserChange: (previous, next) => {\n client.clear();\n void persistence?.clear();\n if (previous !== null && next === null) latest.current.onSignedOut?.();\n },\n });\n const boot = createBoot(\n [\n ...steps,\n // Blocks' steps, in dependency order (the updates block's settles within its own timeout and never throws).\n ...blocks.blocks.flatMap((block) => block.bootSteps ?? []),\n { id: \"genesis:session\", run: () => session.load(), timeoutMs: sessionWaitMs + SESSION_STEP_MARGIN_MS },\n // After the session, so only the cache saved for this user is restored.\n ...(persistence ? [{ id: \"genesis:query-cache\", run: () => persistence.restore(session.getState().userId ?? \"\") }] : []),\n ],\n bootOptions,\n );\n // One component type for the life of the app, so a re-render never remounts a visible fatal screen.\n function FatalFallback(fallbackProps: FatalScreenProps) {\n useEffect(() => {\n fatalShown.current++;\n return () => {\n fatalShown.current--;\n };\n }, []);\n const { slotProps: sp } = latest.current;\n const s = withBlockSlots(blocks.slots, latest.current.slots);\n return (\n // A `fatal` slot that throws falls back to the plain screen.\n <GenesisErrorBoundary fallback={PlainFatalScreen} onError={onError} onRetry={fallbackProps.retry}>\n {renderSlot(FatalScreen, s?.fatal, fallbackProps, sp?.fatal)}\n </GenesisErrorBoundary>\n );\n }\n return { client, persistence, session, boot, FatalFallback, blocks, provider: provider ?? createSupabaseProvider(supabase) };\n });\n const { boot, session, persistence, client, FatalFallback } = parts;\n const slots = withBlockSlots(parts.blocks.slots, props.slots);\n const bootState = useSyncExternalStore(boot.subscribe, boot.getState, boot.getState);\n const sessionState = useSyncExternalStore(session.subscribe, session.getState, session.getState);\n const [fatal, setFatal] = useState<Error | null>(null);\n const [resetKey, setResetKey] = useState(0);\n\n useEffect(() => session.start(), [session]);\n useEffect(() => {\n void boot.start();\n }, [boot]);\n useEffect(() => {\n if (bootState.status === \"failed\" && bootState.error) onError(bootState.error, { fatal: true, source: \"boot\" });\n }, [bootState.status, bootState.error]);\n useEffect(() => {\n if (bootState.status === \"ready\" && persistence) return persistence.subscribe(sessionState.userId ?? \"\");\n }, [bootState.status, persistence, sessionState.userId]);\n useEffect(() => {\n const utils = errorUtils ?? defaultErrorUtils();\n if (!utils) return;\n return installGlobalErrorHandler({ errorUtils: utils, onError, onFatal: setFatal, alreadyFatal: () => fatalShown.current > 0 });\n }, [errorUtils]);\n useEffect(() => {\n const enable = rejectionTracker === null ? undefined : (rejectionTracker ?? defaultRejectionTracker());\n if (enable) installRejectionTracker({ enable, onError });\n }, [rejectionTracker]);\n useEffect(() => (lifecycle ? connectQueryLifecycle(lifecycle) : undefined), [lifecycle]);\n const [queryReports] = useState(() => props.reportQueryErrors !== false);\n useEffect(() => (queryReports ? reportQueryErrors(client, onError) : undefined), [client, queryReports]);\n\n // Splash: up until boot has finished (the session step included), or failed.\n const settled = bootState.status === \"ready\" || bootState.status === \"failed\" || fatal !== null;\n const splashHidden = useRef(false);\n useEffect(() => {\n if (!settled || !splash || splashHidden.current) return;\n splashHidden.current = true;\n splash.hideAsync().catch(() => {});\n }, [settled, splash]);\n\n const auth: HeldLinkAuth = bootState.status !== \"ready\" || sessionState.status === \"loading\" ? \"pending\" : sessionState.status;\n useHeldLink(links?.hold ?? NO_HOLD, { auth: links ? auth : \"pending\", onRelease: (path) => links?.onRelease(path) });\n\n const retry = () => {\n setFatal(null);\n setResetKey((key) => key + 1);\n if (boot.getState().status === \"failed\") void boot.retry();\n };\n\n let content: ReactNode;\n if (fatal) {\n content = <FatalFallback error={fatal} retry={retry} />;\n } else if (bootState.status === \"failed\" && bootState.error) {\n content = <FatalFallback error={bootState.error} retry={retry} />;\n } else if (bootState.status !== \"ready\") {\n content = renderSlot(BootScreen, slots?.boot, { status: bootState.status }, slotProps?.boot);\n } else {\n const screens =\n sessionState.status === \"signedOut\" ? renderSlot(PassThrough, slots?.signedOut, { children }, slotProps?.signedOut) : children;\n const guarded = renderSlot(\n GenesisErrorBoundary,\n slots?.errorBoundary,\n { fallback: FatalFallback, onError, resetKey, onRetry: retry, children: screens },\n slotProps?.errorBoundary,\n );\n // The first block's root is the outermost.\n content = parts.blocks.blocks.reduceRight<ReactNode>((inner, block) => {\n const Root = block.Root;\n return Root ? (\n <Root key={block.id} slots={slots} slotProps={slotProps}>\n {inner}\n </Root>\n ) : (\n inner\n );\n }, guarded);\n }\n\n return (\n <GenesisProvider provider={parts.provider} queryClient={client}>\n <SessionProvider store={session}>\n <BootProvider boot={boot}>\n <BlocksProvider value={parts.blocks}>\n <GenesisErrorBoundary key={resetKey} fallback={FatalFallback} onError={onError} onRetry={retry}>\n {/* Sheet content renders in the library's portal, here: below data, session, boot and blocks. */}\n {bottomSheet ? <NativeSheetProvider bottomSheet={bottomSheet}>{content}</NativeSheetProvider> : content}\n </GenesisErrorBoundary>\n </BlocksProvider>\n </BootProvider>\n </SessionProvider>\n </GenesisProvider>\n );\n}\n\n// Every slot name, checked against NativeAppSlots by the compiler: a block filling any other is a BlockError.\nconst SLOT_NAMES: Record<keyof NativeAppSlots, true> = {\n boot: true,\n fatal: true,\n errorBoundary: true,\n signedOut: true,\n forceUpgrade: true,\n maintenance: true,\n updateBanner: true,\n whatsNew: true,\n devtoolsFeedback: true,\n pushPrompt: true,\n};\nconst NATIVE_APP_SLOT_NAMES: readonly string[] = Object.keys(SLOT_NAMES);\n\n/** Blocks' slot fills under the app's own slots: the app's (a component or `null`) always win. */\nfunction withBlockSlots(fills: Readonly<Record<string, unknown>>, own: Slots<NativeAppSlots> | undefined): Slots<NativeAppSlots> | undefined {\n if (Object.keys(fills).length === 0) return own;\n return { ...(fills as Slots<NativeAppSlots>), ...own };\n}\n\n/** `blocks`, with `updates` added when it was given on its own (given both ways, it runs once). */\nfunction givenBlocks(props: Pick<GenesisNativeAppProps, \"blocks\" | \"updates\">): readonly NativeBlock[] {\n const given = props.blocks ?? [];\n return props.updates && !given.includes(props.updates) ? [...given, props.updates] : given;\n}\n\nconst NO_HOLD: LinkHold = {\n hold: () => {},\n peek: () => null,\n take: () => null,\n clear: () => {},\n subscribe: () => () => {},\n};\n","/**\n * A hydration gate holds writes until a persisted store has loaded from disk.\n *\n * The bug it prevents: a persisted store (zustand `persist`, say) is created\n * with defaults, something sets a value before the saved state has been read,\n * and that write lands on disk first, replacing what the user had. With the\n * gate, a write made before hydration never reaches disk (`storage()`), or\n * waits for it (`run()`).\n *\n * const gate = createHydrationGate();\n * persist(store, {\n * storage: createJSONStorage(() => gate.storage(AsyncStorage)),\n * // Open only after a good read: after a failed one, writes would replace what's on disk.\n * onRehydrateStorage: () => (_state, error) => {\n * if (!error) gate.markHydrated();\n * },\n * });\n */\nimport type { AsyncStorageLike } from \"./query\";\n\nexport interface HydrationGate {\n readonly hydrated: boolean;\n /** Call once the store has read its saved state. Idempotent. */\n markHydrated(): void;\n /** Resolves once hydrated. */\n whenHydrated(): Promise<void>;\n /** Run a write now if hydrated, otherwise once hydrated. */\n run<T>(write: () => T | Promise<T>): Promise<T>;\n /**\n * The storage, with writes made before hydration dropped (reads pass\n * through, since hydration is a read). After hydration the store writes\n * its merged state on its next change, so nothing is lost but the stale\n * write. (A zustand migration's own write during hydration is dropped too;\n * the old version stays on disk and is migrated again until then.)\n */\n storage<S extends AsyncStorageLike>(storage: S): S;\n}\n\nexport interface HydrationGateOptions {\n /** Told about each write `storage()` dropped (to log it in development). */\n onDroppedWrite?: (key: string) => void;\n}\n\n/** A gate that holds writes until a persisted store has hydrated. */\nexport function createHydrationGate({ onDroppedWrite }: HydrationGateOptions = {}): HydrationGate {\n let hydrated = false;\n let open!: () => void;\n const opened = new Promise<void>((resolve) => {\n open = resolve;\n });\n\n const gate: HydrationGate = {\n get hydrated() {\n return hydrated;\n },\n markHydrated() {\n if (hydrated) return;\n hydrated = true;\n open();\n },\n whenHydrated: () => opened,\n async run(write) {\n if (!hydrated) await opened;\n return write();\n },\n storage(storage) {\n const setItem = async (key: string, value: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.setItem(key, value);\n };\n const removeItem = async (key: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.removeItem(key);\n };\n // A proxy, not a spread: a storage class's prototype methods (and its\n // private fields, through `this`) keep working.\n return new Proxy(storage, {\n get(target, property) {\n if (property === \"setItem\") return setItem;\n if (property === \"removeItem\") return removeItem;\n const value = Reflect.get(target, property, target) as unknown;\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n },\n };\n return gate;\n}\n"]}
|
package/dist/observability.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { a as ObservabilitySink } from './block-
|
|
2
|
-
export { B as Breadcrumb,
|
|
1
|
+
import { a as RouteErrorBoundaryProps, b as ObservabilitySink } from './block-DFnC8j5U.js';
|
|
2
|
+
export { B as Breadcrumb, c as BreadcrumbLevel, C as ConsoleSinkOptions, E as ErrorContext, d as EventCheck, e as EventPropSpec, f as EventProps, g as EventSchema, h as EventValues, i as OBSERVABILITY_BLOCK_ID, O as ObservabilityBlock, j as ObservabilityOptions, k as ObservabilityProvider, l as ObserveLike, m as ObserveSinkOptions, R as RecentActivity, n as RecentError, o as RecentStore, T as TimingTags, p as checkEvent, q as consoleSink, r as createObservability, s as defineEvents, t as observeSink, u as scrubBreadcrumb, v as scrubbedError, w as useObservability, x as useRecentActivity } from './block-DFnC8j5U.js';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
|
-
import { V as VersionSignature } from './blocks-
|
|
4
|
+
import { V as VersionSignature } from './blocks-CyXjSGwV.js';
|
|
5
|
+
export { c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-BlT6KBpa.js';
|
|
6
|
+
import './query-DobJyRvs.js';
|
|
7
|
+
import '@tanstack/react-query';
|
|
5
8
|
import '@marktiderman/genesis-core/slots';
|
|
6
9
|
import '@marktiderman/genesis-features/blocks';
|
|
7
|
-
import '@tanstack/react-query';
|
|
8
10
|
import '@marktiderman/genesis-design-system';
|
|
9
11
|
import '@marktiderman/genesis-core/provider';
|
|
10
12
|
import '@marktiderman/genesis-ui-native/layouts';
|
|
11
13
|
import '@marktiderman/genesis-ui-native/components';
|
|
12
|
-
import './query-DUmVAfsF.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* `sentrySink(Sentry, options)`: Sentry through the observability seam.
|
|
@@ -32,7 +33,14 @@ import './query-DUmVAfsF.js';
|
|
|
32
33
|
* `beforeBreadcrumb`, `beforeSendLog`), and the user as an id only;
|
|
33
34
|
* - no default PII, screenshots, view hierarchy or accessibility labels, and
|
|
34
35
|
* touch breadcrumbs without the touched element's label (labels hold names);
|
|
35
|
-
* - fatal errors
|
|
36
|
+
* - fatal errors and unhandled promise rejections marked unhandled, so
|
|
37
|
+
* release health counts them;
|
|
38
|
+
* - trace headers (`sentry-trace`, `baggage`) sent only to the hosts in
|
|
39
|
+
* `tracePropagationTargets` (none by default), never to every request;
|
|
40
|
+
* - `flush` before an update reloads the app (the observability block
|
|
41
|
+
* registers it), the last event id and the replay id for a support
|
|
42
|
+
* request, and `wrapExpoRouterErrorBoundary` around the block's screen
|
|
43
|
+
* boundary.
|
|
36
44
|
*
|
|
37
45
|
* Native crashes (sentry-cocoa, sentry-android) are built on the device's
|
|
38
46
|
* native side and don't pass through these JavaScript hooks.
|
|
@@ -61,6 +69,15 @@ interface SentryLike {
|
|
|
61
69
|
expoRouterIntegration?(options?: {
|
|
62
70
|
enableTimeToInitialDisplay?: boolean;
|
|
63
71
|
}): unknown;
|
|
72
|
+
/** Sentry 8.17+ (`wrapExpoRouterErrorBoundary`): reports a route's error from its `ErrorBoundary`. */
|
|
73
|
+
wrapExpoRouterErrorBoundary?(boundary: ComponentType<RouteErrorBoundaryProps>): ComponentType<RouteErrorBoundaryProps>;
|
|
74
|
+
/** Sends what is queued. Takes no timeout on React Native: the observability block holds the deadline. */
|
|
75
|
+
flush?(): PromiseLike<boolean>;
|
|
76
|
+
lastEventId?(): string | undefined;
|
|
77
|
+
/** The active session replay integration, when replay is on (`getReplay()?.getReplayId()`). */
|
|
78
|
+
getReplay?(): {
|
|
79
|
+
getReplayId(): string | null | undefined;
|
|
80
|
+
} | undefined;
|
|
64
81
|
metrics?: {
|
|
65
82
|
distribution(name: string, value: number, options?: Options): void;
|
|
66
83
|
count(name: string, value?: number, options?: Options): void;
|
|
@@ -81,6 +98,15 @@ interface SentrySinkOptions {
|
|
|
81
98
|
expoRouter?: boolean | {
|
|
82
99
|
enableTimeToInitialDisplay?: boolean;
|
|
83
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* The URLs that get Sentry's trace headers (`sentry-trace`, `baggage`),
|
|
103
|
+
* as strings (matched anywhere in the URL) or regular expressions: your
|
|
104
|
+
* own API and Supabase project (`["https://abc.supabase.co"]`). Default
|
|
105
|
+
* none: no request carries them, so third-party hosts never see your
|
|
106
|
+
* trace ids and their CORS never trips on the extra headers. Wins over
|
|
107
|
+
* `init.tracePropagationTargets`.
|
|
108
|
+
*/
|
|
109
|
+
tracePropagationTargets?: readonly (string | RegExp)[];
|
|
84
110
|
/** More integrations (replay, profiling). Masking is yours to set on them. */
|
|
85
111
|
integrations?: readonly unknown[];
|
|
86
112
|
/**
|
|
@@ -167,4 +193,4 @@ declare function scrubEvent<E extends ScrubbableEvent>(event: E): E | null;
|
|
|
167
193
|
/** A breadcrumb, span or any record, scrubbed by value. `null` when scrubbing threw (fail closed). */
|
|
168
194
|
declare function scrubRecord<R extends object>(record: R): R | null;
|
|
169
195
|
|
|
170
|
-
export { FILTERED, ObservabilitySink, type ScrubbableEvent, type SentryLike, type SentrySinkOptions, isSecretKey, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, sentryRelease, sentrySink, signatureTags };
|
|
196
|
+
export { FILTERED, ObservabilitySink, RouteErrorBoundaryProps, type ScrubbableEvent, type SentryLike, type SentrySinkOptions, isSecretKey, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, sentryRelease, sentrySink, signatureTags };
|
package/dist/observability.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { scrubRecord, scrubEvent, scrubString } from './chunk-
|
|
2
|
-
export { FILTERED, OBSERVABILITY_BLOCK_ID, ObservabilityProvider, checkEvent, consoleSink, createObservability, defineEvents, isSecretKey, observeSink, scrubBreadcrumb, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, scrubbedError, useObservability, useRecentActivity } from './chunk-
|
|
1
|
+
import { scrubRecord, scrubEvent, scrubString } from './chunk-6L36FQBX.js';
|
|
2
|
+
export { FILTERED, OBSERVABILITY_BLOCK_ID, ObservabilityProvider, checkEvent, consoleSink, createObservability, defineEvents, isSecretKey, observeSink, scrubBreadcrumb, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, scrubbedError, useObservability, useRecentActivity } from './chunk-6L36FQBX.js';
|
|
3
|
+
export { ScreenErrorScreen, createScreenErrorBoundary } from './chunk-MFHOHSEQ.js';
|
|
4
|
+
import './chunk-VIC2KXMA.js';
|
|
3
5
|
import './chunk-NGYNYJPL.js';
|
|
4
6
|
|
|
5
7
|
// src/observability/sentry.ts
|
|
@@ -67,6 +69,8 @@ function sentrySink(sentry, options) {
|
|
|
67
69
|
reportAccessibilityIdentifier: false,
|
|
68
70
|
tracesSampleRate: options.tracesSampleRate ?? (environment === "production" ? 0.2 : 1),
|
|
69
71
|
...extra,
|
|
72
|
+
// Only the app's own hosts: Sentry's mobile default would add the headers to every request.
|
|
73
|
+
tracePropagationTargets: [...options.tracePropagationTargets ?? (Array.isArray(extra.tracePropagationTargets) ? extra.tracePropagationTargets : [])],
|
|
70
74
|
dsn,
|
|
71
75
|
environment,
|
|
72
76
|
...sentryRelease(signature, applicationId),
|
|
@@ -83,17 +87,22 @@ function sentrySink(sentry, options) {
|
|
|
83
87
|
});
|
|
84
88
|
for (const [key, value] of Object.entries(signatureTags(signature))) sentry.setTag(key, value);
|
|
85
89
|
}
|
|
90
|
+
let lastEventId;
|
|
86
91
|
return {
|
|
87
92
|
name: "sentry",
|
|
88
93
|
// Sentry deduplicates by error object, and `beforeSend` scrubs: it always gets the original.
|
|
89
94
|
scrubsErrors: true,
|
|
90
95
|
captureError(error, context) {
|
|
91
|
-
sentry.captureException(error, {
|
|
92
|
-
// Unhandled when the app could not go on, so release health counts it
|
|
93
|
-
mechanism: { handled: !context.fatal, type: `genesis.${context.source}` },
|
|
96
|
+
lastEventId = sentry.captureException(error, {
|
|
97
|
+
// Unhandled when the app could not go on, or nothing caught it, so release health counts it.
|
|
98
|
+
mechanism: { handled: context.handled ?? !context.fatal, type: `genesis.${context.source}` },
|
|
94
99
|
captureContext: {
|
|
95
100
|
level: context.fatal ? "fatal" : "error",
|
|
96
|
-
tags: {
|
|
101
|
+
tags: {
|
|
102
|
+
...context.tags ? scrub ? scrubRecord(context.tags) ?? {} : context.tags : {},
|
|
103
|
+
"genesis.source": context.source,
|
|
104
|
+
...context.route ? { route: context.route } : {}
|
|
105
|
+
},
|
|
97
106
|
...context.componentStack ? { contexts: { react: { componentStack: scrub ? scrubString(context.componentStack) : context.componentStack } } } : {}
|
|
98
107
|
}
|
|
99
108
|
});
|
|
@@ -114,7 +123,11 @@ function sentrySink(sentry, options) {
|
|
|
114
123
|
sentry.metrics?.count(name, 1, { attributes: props });
|
|
115
124
|
},
|
|
116
125
|
timing: (name, ms, tags) => sentry.metrics?.distribution(name, ms, { unit: "millisecond", attributes: tags }),
|
|
117
|
-
wrap: (root) => sentry.wrap(root)
|
|
126
|
+
wrap: (root) => sentry.wrap(root),
|
|
127
|
+
wrapRouteErrorBoundary: sentry.wrapExpoRouterErrorBoundary ? (boundary) => sentry.wrapExpoRouterErrorBoundary(boundary) : void 0,
|
|
128
|
+
flush: sentry.flush ? () => sentry.flush() : void 0,
|
|
129
|
+
lastEventId: () => sentry.lastEventId?.() ?? lastEventId,
|
|
130
|
+
replayId: () => sentry.getReplay?.()?.getReplayId() ?? void 0
|
|
118
131
|
};
|
|
119
132
|
}
|
|
120
133
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/observability/sentry.ts"],"names":[],"mappings":";;;;;AAsFA,IAAM,KAAA,GAAQ,MAAM,OAAO,OAAA,KAAY,WAAA,IAAe,OAAA;AAG/C,SAAS,aAAA,CAAc,WAAyC,aAAA,EAAoE;AACzI,EAAA,MAAM,UAAU,SAAA,EAAW,OAAA;AAC3B,EAAA,MAAM,QAAQ,SAAA,EAAW,KAAA;AACzB,EAAA,IAAI,CAAC,OAAA,IAAW,CAAC,SAAS,CAAC,aAAA,SAAsB,EAAC;AAClD,EAAA,OAAO,EAAE,OAAA,EAAS,CAAA,EAAG,aAAa,CAAA,CAAA,EAAI,OAAO,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,IAAA,EAAM,KAAA,EAAM;AACxE;AAGO,SAAS,cAAc,SAAA,EAAiE;AAC7F,EAAA,IAAI,CAAC,SAAA,EAAW,OAAO,EAAC;AACxB,EAAA,OAAO;AAAA,IACL,iBAAiB,SAAA,CAAU,MAAA;AAAA,IAC3B,aAAa,SAAA,CAAU,MAAA,KAAW,WAAY,SAAA,CAAU,QAAA,IAAY,YAAa,SAAA,CAAU,MAAA;AAAA,IAC3F,gBAAA,EAAkB,UAAU,gBAAA,IAAoB,SAAA,CAAU,YAAY,SAAA,CAAU,MAAA,KAAW,QAAQ,MAAA,GAAS,SAAA,CAAA;AAAA,IAC5G,gBAAA,EAAkB,UAAU,cAAA,IAAkB,SAAA;AAAA,IAC9C,GAAI,S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AO;AACrE,MAAA,MAAA,CAAO,aAAA,CAAc;AAAA,QACnB,UAAU,KAAA,CAAM,QAAA;AAAA,QAChB,SAAS,KAAA,CAAM,OAAA;AAAA,QACf,KAAA,EAAO,MAAM,KAAA,IAAS,MAAA;AAAA,QACtB,MAAM,KAAA,CAAM,IAAA;AAAA,QACZ,GAAI,MAAM,SAAA,GAAY,EAAE,WAAW,KAAA,CAAM,SAAA,GAAY,GAAA,EAAK,GAAI;AAAC,OAChE,CAAA;AAAA,IACH,CAAA;AAAA,IACA,OAAA,EAAS,CAAC,EAAA,KAAO,MAAA,CAAO,QAAQ,EAAA,GAAK,EAAE,EAAA,EAAG,GAAI,IAAI,CAAA;AAAA,IAClD,KAAA,CAAM,MAAM,KAAA,EAAO;AACjB,MAAA,MAAA,CAAO,aAAA,CAAc,EAAE,QAAA,EAAU,OAAA,EAAS,OAAA,EAAS,MAAM,KAAA,EAAO,MAAA,EAAQ,IAAA,EAAM,KAAA,EAAO,CAAA;AACrF,MAAA,MAAA,CAAO,SAAS,KAAA,CAAM,IAAA,EAAM,GAAG,EAAE,UAAA,EAAY,OAAO,CAAA;AAAA,IACtD,CAAA;AAAA,IACA,MAAA,EAAQ,CAAC,IAAA,EAAM,EAAA,EAAI,SAAS,MAAA,CAAO,OAAA,EAAS,YAAA,CAAa,IAAA,EAAM,IAAI,EAAE,IAAA,EAAM,aAAA,EAAe,UAAA,EAAY,MAAM,CAAA;AAAA,IAC5G,IAAA,EAAM,CAAC,IAAA,KAAS,MAAA,CAAO,KAAK,IAAI;AAAA,GAClC;AACF","file":"observability.js","sourcesContent":["/**\n * `sentrySink(Sentry, options)`: Sentry through the observability seam.\n * `@sentry/react-native` is an optional peer, passed in rather than\n * imported (`import * as Sentry from \"@sentry/react-native\"`), so an app\n * without it never bundles it.\n *\n * Calling it runs `Sentry.init` at once, so call it at module scope (where\n * `createObservability` is built, before the root layout renders): errors\n * thrown while the app's modules load and the shell's first render are then\n * caught. A second call in the same process (Fast Refresh) reuses the client.\n *\n * What it sets up, on Expo SDK 58 with @sentry/react-native 8:\n * - `expoRouterIntegration` (navigation spans, time to initial display);\n * - release `<applicationId>@<version>+<build>` and dist `<build>` from the\n * version signature (Sentry's own format, so release health lines up),\n * with the update id, channel, runtime version and launch as tags;\n * - the PII scrubber on every event, transaction, span, breadcrumb and log\n * (`beforeSend`, `beforeSendTransaction`, `beforeSendSpan`,\n * `beforeBreadcrumb`, `beforeSendLog`), and the user as an id only;\n * - no default PII, screenshots, view hierarchy or accessibility labels, and\n * touch breadcrumbs without the touched element's label (labels hold names);\n * - fatal errors marked unhandled, so release health counts them as crashes.\n *\n * Native crashes (sentry-cocoa, sentry-android) are built on the device's\n * native side and don't pass through these JavaScript hooks.\n *\n * Errors: the shell (`GenesisNativeApp`) reports every error it catches\n * through `captureError`. Sentry's own global handler stays on for errors\n * before the shell mounts; when both see one error object, Sentry's\n * deduplication (`__sentry_captured__`) sends it once.\n */\nimport type { ComponentType } from \"react\";\nimport type { VersionSignature } from \"../updates/signature\";\nimport { scrubEvent, scrubRecord, scrubString } from \"./scrub\";\nimport type { ObservabilitySink } from \"./sink\";\n\ntype Options = Record<string, unknown>;\ntype Hook<T> = (value: T, hint?: unknown) => T | null | PromiseLike<T | null>;\n\n/**\n * `@sentry/react-native`'s namespace: the calls this sink makes. Method\n * syntax on purpose, so the real namespace (with wider option types) fits.\n */\nexport interface SentryLike {\n init(options: Options): unknown;\n getClient(): unknown;\n wrap<P extends Record<string, unknown>>(root: ComponentType<P>): ComponentType<P>;\n captureException(error: unknown, context?: Options): string;\n addBreadcrumb(breadcrumb: Options): void;\n setUser(user: { id: string } | null): void;\n setTag(key: string, value: string): void;\n expoRouterIntegration?(options?: { enableTimeToInitialDisplay?: boolean }): unknown;\n metrics?: {\n distribution(name: string, value: number, options?: Options): void;\n count(name: string, value?: number, options?: Options): void;\n };\n}\n\nexport interface SentrySinkOptions {\n /** `process.env.EXPO_PUBLIC_SENTRY_DSN`. Empty or missing: Sentry is not started and the sink does nothing. */\n dsn: string | undefined | null;\n /** Default `development` in `__DEV__`, else from the signature's channel: `production`, `preview` (`preview` and `pr-*`), `development`, else `production`. */\n environment?: string;\n /** The version signature (`versionSignature(…)` from `/updates`, or the updates block's `signature`): release, dist and update tags. */\n signature?: VersionSignature;\n /** `Application.applicationId` (expo-application): the release's prefix. */\n applicationId?: string | null;\n /** Default 0.2 in production and 1 elsewhere. */\n tracesSampleRate?: number;\n /** Navigation spans and time to initial display through Expo Router. Default true. */\n expoRouter?: boolean | { enableTimeToInitialDisplay?: boolean };\n /** More integrations (replay, profiling). Masking is yours to set on them. */\n integrations?: readonly unknown[];\n /**\n * Other `Sentry.init` options. The scrubbing hooks run first and yours\n * after, on the scrubbed value; `sendDefaultPii` and the screenshot,\n * view-hierarchy and accessibility options can be set here on purpose.\n */\n init?: Options;\n /** False turns the scrubber off (not recommended; it is also the only thing reducing the user to an id). Default true. */\n scrub?: boolean;\n /** Called instead of `console.warn` when the DSN is missing outside development. */\n onMissingDsn?: () => void;\n}\n\ndeclare const __DEV__: boolean | undefined;\nconst isDev = () => typeof __DEV__ !== \"undefined\" && __DEV__;\n\n/** Sentry's release format: `<applicationId>@<version>+<build>`, with `dist` the build; `undefined` parts when unknown. */\nexport function sentryRelease(signature: VersionSignature | undefined, applicationId?: string | null): { release?: string; dist?: string } {\n const version = signature?.version;\n const build = signature?.build;\n if (!version || !build || !applicationId) return {};\n return { release: `${applicationId}@${version}+${build}`, dist: build };\n}\n\n/** The tags each event carries from the signature. Unknown values are written `unknown`, never left out. */\nexport function signatureTags(signature: VersionSignature | undefined): Record<string, string> {\n if (!signature) return {};\n return {\n \"update.launch\": signature.launch,\n \"update.id\": signature.launch === \"update\" ? (signature.updateId ?? \"unknown\") : signature.launch,\n \"update.channel\": signature.requestedChannel ?? signature.channel ?? (signature.launch === \"off\" ? \"none\" : \"unknown\"),\n \"update.runtime\": signature.runtimeVersion ?? \"unknown\",\n ...(signature.emergency ? { \"update.emergency\": \"true\" } : {}),\n };\n}\n\n/** One Sentry environment per kind of build, not one per channel (`pr-42` is `preview`). */\nexport function sentryEnvironment(channel: string | null | undefined): string {\n if (!channel || channel === \"production\") return \"production\";\n if (channel === \"development\") return \"development\";\n if (channel === \"preview\" || /^pr-\\d+$/.test(channel)) return \"preview\";\n return \"production\";\n}\n\n/** A touch breadcrumb with the touched elements' names only: their labels (accessibility labels, test ids) can hold names. */\nexport function withoutTouchLabels<T extends { category?: unknown; message?: unknown; data?: unknown }>(crumb: T): T {\n if (crumb.category !== \"touch\" || !crumb.data || typeof crumb.data !== \"object\") return crumb;\n const data = crumb.data as { path?: unknown };\n const path = Array.isArray(data.path) ? data.path.map((p) => (p && typeof p === \"object\" ? { name: (p as { name?: unknown }).name } : p)) : undefined;\n const first = path?.[0] as { name?: unknown } | undefined;\n return { ...crumb, message: `Touch event within element: ${typeof first?.name === \"string\" ? first.name : \"unknown\"}`, data: { ...data, ...(path ? { path } : {}) } };\n}\n\nfunction chain<T>(ours: (value: T) => T | null, theirs: unknown): Hook<T> {\n return (value, hint) => {\n const scrubbed = ours(value);\n if (scrubbed === null) return null;\n return typeof theirs === \"function\" ? (theirs as Hook<T>)(scrubbed, hint) : scrubbed;\n };\n}\n\n/**\n * Start Sentry and return a sink for it. Without a DSN it starts nothing and\n * returns a sink that does nothing (a warning outside development says so).\n *\n * @stability Beta\n */\nexport function sentrySink(sentry: SentryLike, options: SentrySinkOptions): ObservabilitySink {\n const { dsn, signature, applicationId, scrub = true } = options;\n if (!dsn) {\n if (!isDev()) (options.onMissingDsn ?? (() => console.warn(\"[observability] EXPO_PUBLIC_SENTRY_DSN is not set: errors are not reported to Sentry.\")))();\n return { name: \"sentry (no DSN)\" };\n }\n const environment = options.environment ?? (isDev() ? \"development\" : sentryEnvironment(signature?.requestedChannel ?? signature?.channel));\n // Fast Refresh runs this module again: a second init would stack integrations on the live client.\n if (!sentry.getClient()) {\n const extra = options.init ?? {};\n const router = options.expoRouter ?? true;\n const integrations = [\n ...(router && sentry.expoRouterIntegration\n ? [sentry.expoRouterIntegration({ enableTimeToInitialDisplay: typeof router === \"object\" ? router.enableTimeToInitialDisplay : true })]\n : []),\n ...(options.integrations ?? []),\n ...(Array.isArray(extra.integrations) ? extra.integrations : []),\n ];\n const keep = <T>(value: T) => value;\n const span = (value: Options): Options => {\n const scrubbed = scrubRecord(value);\n // A span can't be dropped here: fail closed by sending it without its description and data.\n return scrubbed ?? { ...value, description: undefined, data: {} };\n };\n sentry.init({\n sendDefaultPii: false,\n attachScreenshot: false,\n attachViewHierarchy: false,\n reportAccessibilityIdentifier: false,\n tracesSampleRate: options.tracesSampleRate ?? (environment === \"production\" ? 0.2 : 1),\n ...extra,\n dsn,\n environment,\n ...sentryRelease(signature, applicationId),\n integrations,\n beforeSend: chain(scrub ? scrubEvent : keep, extra.beforeSend),\n beforeSendTransaction: chain(scrub ? scrubEvent : keep, extra.beforeSendTransaction),\n beforeBreadcrumb: chain<Options>((crumb) => (scrub ? scrubRecord(withoutTouchLabels(crumb)) : crumb), extra.beforeBreadcrumb),\n beforeSendLog: chain(scrub ? scrubRecord : keep, extra.beforeSendLog),\n beforeSendMetric: chain(scrub ? scrubRecord : keep, extra.beforeSendMetric),\n beforeSendSpan: (value: Options) => {\n const scrubbed = scrub ? span(value) : value;\n return typeof extra.beforeSendSpan === \"function\" ? (extra.beforeSendSpan as (s: Options) => Options)(scrubbed) : scrubbed;\n },\n });\n for (const [key, value] of Object.entries(signatureTags(signature))) sentry.setTag(key, value);\n }\n\n return {\n name: \"sentry\",\n // Sentry deduplicates by error object, and `beforeSend` scrubs: it always gets the original.\n scrubsErrors: true,\n captureError(error, context) {\n sentry.captureException(error, {\n // Unhandled when the app could not go on, so release health counts it as a crash.\n mechanism: { handled: !context.fatal, type: `genesis.${context.source}` },\n captureContext: {\n level: context.fatal ? \"fatal\" : \"error\",\n tags: { \"genesis.source\": context.source, ...(context.route ? { route: context.route } : {}) },\n ...(context.componentStack ? { contexts: { react: { componentStack: scrub ? scrubString(context.componentStack) : context.componentStack } } } : {}),\n },\n });\n },\n breadcrumb(crumb) {\n // Sentry's Expo Router integration records navigation itself.\n if (crumb.category === \"navigation\" && (options.expoRouter ?? true)) return;\n sentry.addBreadcrumb({\n category: crumb.category,\n message: crumb.message,\n level: crumb.level ?? \"info\",\n data: crumb.data,\n ...(crumb.timestamp ? { timestamp: crumb.timestamp / 1000 } : {}),\n });\n },\n setUser: (id) => sentry.setUser(id ? { id } : null),\n event(name, props) {\n sentry.addBreadcrumb({ category: \"event\", message: name, level: \"info\", data: props });\n sentry.metrics?.count(name, 1, { attributes: props });\n },\n timing: (name, ms, tags) => sentry.metrics?.distribution(name, ms, { unit: \"millisecond\", attributes: tags }),\n wrap: (root) => sentry.wrap(root),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/observability/sentry.ts"],"names":[],"mappings":";;;;;;;AA6GA,IAAM,KAAA,GAAQ,MAAM,OAAO,OAAA,KAAY,WAAA,IAAe,OAAA;AAG/C,SAAS,aAAA,CAAc,WAAyC,aAAA,EAAoE;AACzI,EAAA,MAAM,UAAU,SAAA,EAAW,OAAA;AAC3B,EAAA,MAAM,QAAQ,SAAA,EAAW,KAAA;AACzB,EAAA,IAAI,CAAC,OAAA,IAAW,CAAC,SAAS,CAAC,aAAA,SAAsB,EAAC;AAClD,EAAA,OAAO,EAAE,OAAA,EAAS,CAAA,EAAG,aAAa,CAAA,CAAA,EAAI,OAAO,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,EAAI,IAAA,EAAM,KAAA,EAAM;AACxE;AAGO,SAAS,cAAc,SAAA,EAAiE;AAC7F,EAAA,IAAI,CAAC,SAAA,EAAW,OAAO,EAAC;AACxB,EAAA,OAAO;AAAA,IACL,iBAAiB,SAAA,CAAU,MAAA;AAAA,IAC3B,aAAa,SAAA,CAAU,MAAA,KAAW,WAAY,SAAA,CAAU,QAAA,IAAY,YAAa,SAAA,CAAU,MAAA;AAAA,IAC3F,gBAAA,EAAkB,UAAU,gB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AAO,CAAA;AAAA,IACtD,CAAA;AAAA,IACA,MAAA,EAAQ,CAAC,IAAA,EAAM,EAAA,EAAI,SAAS,MAAA,CAAO,OAAA,EAAS,YAAA,CAAa,IAAA,EAAM,IAAI,EAAE,IAAA,EAAM,aAAA,EAAe,UAAA,EAAY,MAAM,CAAA;AAAA,IAC5G,IAAA,EAAM,CAAC,IAAA,KAAS,MAAA,CAAO,KAAK,IAAI,CAAA;AAAA,IAChC,sBAAA,EAAwB,OAAO,2BAAA,GAA8B,CAAC,aAAa,MAAA,CAAO,2BAAA,CAA6B,QAAQ,CAAA,GAAI,MAAA;AAAA,IAC3H,OAAO,MAAA,CAAO,KAAA,GAAQ,MAAM,MAAA,CAAO,OAAO,GAAI,MAAA;AAAA,IAC9C,WAAA,EAAa,MAAM,MAAA,CAAO,WAAA,IAAc,IAAK,WAAA;AAAA,IAC7C,UAAU,MAAM,MAAA,CAAO,SAAA,IAAY,EAAG,aAAY,IAAK;AAAA,GACzD;AACF","file":"observability.js","sourcesContent":["/**\n * `sentrySink(Sentry, options)`: Sentry through the observability seam.\n * `@sentry/react-native` is an optional peer, passed in rather than\n * imported (`import * as Sentry from \"@sentry/react-native\"`), so an app\n * without it never bundles it.\n *\n * Calling it runs `Sentry.init` at once, so call it at module scope (where\n * `createObservability` is built, before the root layout renders): errors\n * thrown while the app's modules load and the shell's first render are then\n * caught. A second call in the same process (Fast Refresh) reuses the client.\n *\n * What it sets up, on Expo SDK 58 with @sentry/react-native 8:\n * - `expoRouterIntegration` (navigation spans, time to initial display);\n * - release `<applicationId>@<version>+<build>` and dist `<build>` from the\n * version signature (Sentry's own format, so release health lines up),\n * with the update id, channel, runtime version and launch as tags;\n * - the PII scrubber on every event, transaction, span, breadcrumb and log\n * (`beforeSend`, `beforeSendTransaction`, `beforeSendSpan`,\n * `beforeBreadcrumb`, `beforeSendLog`), and the user as an id only;\n * - no default PII, screenshots, view hierarchy or accessibility labels, and\n * touch breadcrumbs without the touched element's label (labels hold names);\n * - fatal errors and unhandled promise rejections marked unhandled, so\n * release health counts them;\n * - trace headers (`sentry-trace`, `baggage`) sent only to the hosts in\n * `tracePropagationTargets` (none by default), never to every request;\n * - `flush` before an update reloads the app (the observability block\n * registers it), the last event id and the replay id for a support\n * request, and `wrapExpoRouterErrorBoundary` around the block's screen\n * boundary.\n *\n * Native crashes (sentry-cocoa, sentry-android) are built on the device's\n * native side and don't pass through these JavaScript hooks.\n *\n * Errors: the shell (`GenesisNativeApp`) reports every error it catches\n * through `captureError`. Sentry's own global handler stays on for errors\n * before the shell mounts; when both see one error object, Sentry's\n * deduplication (`__sentry_captured__`) sends it once.\n */\nimport type { ComponentType } from \"react\";\nimport type { VersionSignature } from \"../updates/signature\";\nimport { scrubEvent, scrubRecord, scrubString } from \"./scrub\";\nimport type { ObservabilitySink, RouteErrorBoundaryProps } from \"./sink\";\n\ntype Options = Record<string, unknown>;\ntype Hook<T> = (value: T, hint?: unknown) => T | null | PromiseLike<T | null>;\n\n/**\n * `@sentry/react-native`'s namespace: the calls this sink makes. Method\n * syntax on purpose, so the real namespace (with wider option types) fits.\n */\nexport interface SentryLike {\n init(options: Options): unknown;\n getClient(): unknown;\n wrap<P extends Record<string, unknown>>(root: ComponentType<P>): ComponentType<P>;\n captureException(error: unknown, context?: Options): string;\n addBreadcrumb(breadcrumb: Options): void;\n setUser(user: { id: string } | null): void;\n setTag(key: string, value: string): void;\n expoRouterIntegration?(options?: { enableTimeToInitialDisplay?: boolean }): unknown;\n /** Sentry 8.17+ (`wrapExpoRouterErrorBoundary`): reports a route's error from its `ErrorBoundary`. */\n wrapExpoRouterErrorBoundary?(boundary: ComponentType<RouteErrorBoundaryProps>): ComponentType<RouteErrorBoundaryProps>;\n /** Sends what is queued. Takes no timeout on React Native: the observability block holds the deadline. */\n flush?(): PromiseLike<boolean>;\n lastEventId?(): string | undefined;\n /** The active session replay integration, when replay is on (`getReplay()?.getReplayId()`). */\n getReplay?(): { getReplayId(): string | null | undefined } | undefined;\n metrics?: {\n distribution(name: string, value: number, options?: Options): void;\n count(name: string, value?: number, options?: Options): void;\n };\n}\n\nexport interface SentrySinkOptions {\n /** `process.env.EXPO_PUBLIC_SENTRY_DSN`. Empty or missing: Sentry is not started and the sink does nothing. */\n dsn: string | undefined | null;\n /** Default `development` in `__DEV__`, else from the signature's channel: `production`, `preview` (`preview` and `pr-*`), `development`, else `production`. */\n environment?: string;\n /** The version signature (`versionSignature(…)` from `/updates`, or the updates block's `signature`): release, dist and update tags. */\n signature?: VersionSignature;\n /** `Application.applicationId` (expo-application): the release's prefix. */\n applicationId?: string | null;\n /** Default 0.2 in production and 1 elsewhere. */\n tracesSampleRate?: number;\n /** Navigation spans and time to initial display through Expo Router. Default true. */\n expoRouter?: boolean | { enableTimeToInitialDisplay?: boolean };\n /**\n * The URLs that get Sentry's trace headers (`sentry-trace`, `baggage`),\n * as strings (matched anywhere in the URL) or regular expressions: your\n * own API and Supabase project (`[\"https://abc.supabase.co\"]`). Default\n * none: no request carries them, so third-party hosts never see your\n * trace ids and their CORS never trips on the extra headers. Wins over\n * `init.tracePropagationTargets`.\n */\n tracePropagationTargets?: readonly (string | RegExp)[];\n /** More integrations (replay, profiling). Masking is yours to set on them. */\n integrations?: readonly unknown[];\n /**\n * Other `Sentry.init` options. The scrubbing hooks run first and yours\n * after, on the scrubbed value; `sendDefaultPii` and the screenshot,\n * view-hierarchy and accessibility options can be set here on purpose.\n */\n init?: Options;\n /** False turns the scrubber off (not recommended; it is also the only thing reducing the user to an id). Default true. */\n scrub?: boolean;\n /** Called instead of `console.warn` when the DSN is missing outside development. */\n onMissingDsn?: () => void;\n}\n\ndeclare const __DEV__: boolean | undefined;\nconst isDev = () => typeof __DEV__ !== \"undefined\" && __DEV__;\n\n/** Sentry's release format: `<applicationId>@<version>+<build>`, with `dist` the build; `undefined` parts when unknown. */\nexport function sentryRelease(signature: VersionSignature | undefined, applicationId?: string | null): { release?: string; dist?: string } {\n const version = signature?.version;\n const build = signature?.build;\n if (!version || !build || !applicationId) return {};\n return { release: `${applicationId}@${version}+${build}`, dist: build };\n}\n\n/** The tags each event carries from the signature. Unknown values are written `unknown`, never left out. */\nexport function signatureTags(signature: VersionSignature | undefined): Record<string, string> {\n if (!signature) return {};\n return {\n \"update.launch\": signature.launch,\n \"update.id\": signature.launch === \"update\" ? (signature.updateId ?? \"unknown\") : signature.launch,\n \"update.channel\": signature.requestedChannel ?? signature.channel ?? (signature.launch === \"off\" ? \"none\" : \"unknown\"),\n \"update.runtime\": signature.runtimeVersion ?? \"unknown\",\n ...(signature.emergency ? { \"update.emergency\": \"true\" } : {}),\n };\n}\n\n/** One Sentry environment per kind of build, not one per channel (`pr-42` is `preview`). */\nexport function sentryEnvironment(channel: string | null | undefined): string {\n if (!channel || channel === \"production\") return \"production\";\n if (channel === \"development\") return \"development\";\n if (channel === \"preview\" || /^pr-\\d+$/.test(channel)) return \"preview\";\n return \"production\";\n}\n\n/** A touch breadcrumb with the touched elements' names only: their labels (accessibility labels, test ids) can hold names. */\nexport function withoutTouchLabels<T extends { category?: unknown; message?: unknown; data?: unknown }>(crumb: T): T {\n if (crumb.category !== \"touch\" || !crumb.data || typeof crumb.data !== \"object\") return crumb;\n const data = crumb.data as { path?: unknown };\n const path = Array.isArray(data.path) ? data.path.map((p) => (p && typeof p === \"object\" ? { name: (p as { name?: unknown }).name } : p)) : undefined;\n const first = path?.[0] as { name?: unknown } | undefined;\n return { ...crumb, message: `Touch event within element: ${typeof first?.name === \"string\" ? first.name : \"unknown\"}`, data: { ...data, ...(path ? { path } : {}) } };\n}\n\nfunction chain<T>(ours: (value: T) => T | null, theirs: unknown): Hook<T> {\n return (value, hint) => {\n const scrubbed = ours(value);\n if (scrubbed === null) return null;\n return typeof theirs === \"function\" ? (theirs as Hook<T>)(scrubbed, hint) : scrubbed;\n };\n}\n\n/**\n * Start Sentry and return a sink for it. Without a DSN it starts nothing and\n * returns a sink that does nothing (a warning outside development says so).\n *\n * @stability Beta\n */\nexport function sentrySink(sentry: SentryLike, options: SentrySinkOptions): ObservabilitySink {\n const { dsn, signature, applicationId, scrub = true } = options;\n if (!dsn) {\n // genesis-allow-console: a build set-up warning, before any reporter exists.\n if (!isDev()) (options.onMissingDsn ?? (() => console.warn(\"[observability] EXPO_PUBLIC_SENTRY_DSN is not set: errors are not reported to Sentry.\")))();\n return { name: \"sentry (no DSN)\" };\n }\n const environment = options.environment ?? (isDev() ? \"development\" : sentryEnvironment(signature?.requestedChannel ?? signature?.channel));\n // Fast Refresh runs this module again: a second init would stack integrations on the live client.\n if (!sentry.getClient()) {\n const extra = options.init ?? {};\n const router = options.expoRouter ?? true;\n const integrations = [\n ...(router && sentry.expoRouterIntegration\n ? [sentry.expoRouterIntegration({ enableTimeToInitialDisplay: typeof router === \"object\" ? router.enableTimeToInitialDisplay : true })]\n : []),\n ...(options.integrations ?? []),\n ...(Array.isArray(extra.integrations) ? extra.integrations : []),\n ];\n const keep = <T>(value: T) => value;\n const span = (value: Options): Options => {\n const scrubbed = scrubRecord(value);\n // A span can't be dropped here: fail closed by sending it without its description and data.\n return scrubbed ?? { ...value, description: undefined, data: {} };\n };\n sentry.init({\n sendDefaultPii: false,\n attachScreenshot: false,\n attachViewHierarchy: false,\n reportAccessibilityIdentifier: false,\n tracesSampleRate: options.tracesSampleRate ?? (environment === \"production\" ? 0.2 : 1),\n ...extra,\n // Only the app's own hosts: Sentry's mobile default would add the headers to every request.\n tracePropagationTargets: [...(options.tracePropagationTargets ?? (Array.isArray(extra.tracePropagationTargets) ? extra.tracePropagationTargets : []))],\n dsn,\n environment,\n ...sentryRelease(signature, applicationId),\n integrations,\n beforeSend: chain(scrub ? scrubEvent : keep, extra.beforeSend),\n beforeSendTransaction: chain(scrub ? scrubEvent : keep, extra.beforeSendTransaction),\n beforeBreadcrumb: chain<Options>((crumb) => (scrub ? scrubRecord(withoutTouchLabels(crumb)) : crumb), extra.beforeBreadcrumb),\n beforeSendLog: chain(scrub ? scrubRecord : keep, extra.beforeSendLog),\n beforeSendMetric: chain(scrub ? scrubRecord : keep, extra.beforeSendMetric),\n beforeSendSpan: (value: Options) => {\n const scrubbed = scrub ? span(value) : value;\n return typeof extra.beforeSendSpan === \"function\" ? (extra.beforeSendSpan as (s: Options) => Options)(scrubbed) : scrubbed;\n },\n });\n for (const [key, value] of Object.entries(signatureTags(signature))) sentry.setTag(key, value);\n }\n\n let lastEventId: string | undefined;\n return {\n name: \"sentry\",\n // Sentry deduplicates by error object, and `beforeSend` scrubs: it always gets the original.\n scrubsErrors: true,\n captureError(error, context) {\n lastEventId = sentry.captureException(error, {\n // Unhandled when the app could not go on, or nothing caught it, so release health counts it.\n mechanism: { handled: context.handled ?? !context.fatal, type: `genesis.${context.source}` },\n captureContext: {\n level: context.fatal ? \"fatal\" : \"error\",\n tags: {\n ...(context.tags ? (scrub ? scrubRecord(context.tags) ?? {} : context.tags) : {}),\n \"genesis.source\": context.source,\n ...(context.route ? { route: context.route } : {}),\n },\n ...(context.componentStack ? { contexts: { react: { componentStack: scrub ? scrubString(context.componentStack) : context.componentStack } } } : {}),\n },\n });\n },\n breadcrumb(crumb) {\n // Sentry's Expo Router integration records navigation itself.\n if (crumb.category === \"navigation\" && (options.expoRouter ?? true)) return;\n sentry.addBreadcrumb({\n category: crumb.category,\n message: crumb.message,\n level: crumb.level ?? \"info\",\n data: crumb.data,\n ...(crumb.timestamp ? { timestamp: crumb.timestamp / 1000 } : {}),\n });\n },\n setUser: (id) => sentry.setUser(id ? { id } : null),\n event(name, props) {\n sentry.addBreadcrumb({ category: \"event\", message: name, level: \"info\", data: props });\n sentry.metrics?.count(name, 1, { attributes: props });\n },\n timing: (name, ms, tags) => sentry.metrics?.distribution(name, ms, { unit: \"millisecond\", attributes: tags }),\n wrap: (root) => sentry.wrap(root),\n wrapRouteErrorBoundary: sentry.wrapExpoRouterErrorBoundary ? (boundary) => sentry.wrapExpoRouterErrorBoundary!(boundary) : undefined,\n flush: sentry.flush ? () => sentry.flush!() : undefined,\n lastEventId: () => sentry.lastEventId?.() ?? lastEventId,\n replayId: () => sentry.getReplay?.()?.getReplayId() ?? undefined,\n };\n}\n"]}
|
package/dist/persist.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
-
import { A as AsyncStorageLike,
|
|
2
|
+
import { A as AsyncStorageLike, h as QueryPersistence } from './query-DobJyRvs.js';
|
|
3
|
+
import 'react';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* `@marktiderman/genesis-native/persist`: save chosen queries to async storage
|
package/dist/persist.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DAY_MS } from './chunk-
|
|
1
|
+
import { DAY_MS } from './chunk-C54LIT4N.js';
|
|
2
2
|
import { defaultShouldDehydrateQuery } from '@tanstack/react-query';
|
|
3
3
|
import { persistQueryClientSubscribe, persistQueryClientRestore } from '@tanstack/query-persist-client-core';
|
|
4
4
|
import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister';
|
package/dist/push.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { X as PushPermissionStatus, Y as NotificationResponseLike, Z as NotificationLike, o as LinkOptions, _ as QuietHours } from './blocks-CyXjSGwV.js';
|
|
2
|
+
export { $ as ChannelImportance, a0 as ChannelInputLike, a1 as DEFAULT_PREFERENCES, a2 as NotificationActionLike, a3 as NotificationBehaviorLike, a4 as NotificationCategory, a5 as NotificationPreferences, a6 as NotificationsModuleLike, a7 as PermissionRequestLike, a8 as PermissionState, a9 as PermissionStatusLike, aa as PermissionStore, ab as PreferencesState, ac as PreferencesStatus, ad as PreferencesStore, ae as PromptOptions, af as PromptState, ag as PromptStore, ah as PushAppStateLike, ai as PushBackend, aj as PushBackendError, ak as PushBlock, al as PushChannel, am as PushDeviceCategory, an as PushErrorSource, ao as PushOnError, ap as PushOptions, aq as PushPromptProps, ar as PushPromptSheet, as as PushProvider, at as PushRoot, au as PushRootProps, av as PushSlots, aw as PushStorageLike, ax as PushSupabaseLike, ay as Registration, az as RegistrationState, aA as RegistrationStatus, aB as SubscriptionLike, aC as canPush, aD as createPermissionStore, aE as createPreferencesStore, aF as createPromptStore, aG as createPush, aH as createRegistration, aI as statusOf, aJ as supabasePushBackend, aK as useBadge, aL as useNotificationPreferences, aM as useOptionalPush, aN as usePush, aO as usePushPermissionState, aP as usePushPrompt, aQ as usePushRegistration, aR as useSuppressNotifications, aS as validPreferences } from './blocks-CyXjSGwV.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { Slots, SlotPropsFor } from '@marktiderman/genesis-core/slots';
|
|
6
6
|
import { SettingsPageProps, SettingsPageRow } from '@marktiderman/genesis-ui-native/layouts';
|
|
7
7
|
export { RICH_PUSH_IMAGE_FIELDS, RichPushData, RichPushMessageLike, isRichPushUrl, richPushMessage } from './push-payload.js';
|
|
8
8
|
import '@marktiderman/genesis-features/blocks';
|
|
9
|
+
import './query-DobJyRvs.js';
|
|
9
10
|
import '@tanstack/react-query';
|
|
10
11
|
import '@marktiderman/genesis-design-system';
|
|
11
12
|
import '@marktiderman/genesis-core/provider';
|
|
12
13
|
import '@marktiderman/genesis-ui-native/components';
|
|
13
|
-
import './query-DUmVAfsF.js';
|
|
14
14
|
|
|
15
15
|
interface NotificationSettingsCopy {
|
|
16
16
|
permissionSection: string;
|