@sentry/remix
Version:
Official Sentry SDK for Remix
45 lines • 2.1 kB
TypeScript
interface ModuleLoadContext {
moduleUrl?: string;
[key: string]: unknown;
}
interface ModuleLoadResult {
format: string | null | undefined;
shortCircuit?: boolean;
source?: string | ArrayBuffer | ArrayBufferView;
}
type ModuleLoader = (url: string, context: ModuleLoadContext, nextLoad: (url: string, context?: Partial<ModuleLoadContext>) => ModuleLoadResult) => ModuleLoadResult;
/**
* Makes every Remix 3 asset server created from now on serve browser modules that carry debug IDs.
*
* Source maps follow the other meta framework SDKs:
* - `sourceMaps: false` keeps them off, with a warning that stack traces stay minified.
* - `'inline'` or `'external'` is kept as the app configured it.
* - Left out, they are generated but hidden: modules do not reference them and `.map` requests are
* not served, so the source only reaches Sentry.
*
* Has to run before the app's first `createAssetServer()` call, which usually happens while its
* modules are imported. `Sentry.init()` is too late for that, so the `@sentry/remix/v3/node` entry
* calls this.
*/
export declare function instrumentAssetServer(): void;
/**
* Injects the debug ID snippet into every module the asset server compiles.
*
* Loaders run after the TypeScript transform and before minification, so the snippet is minified
* along with the module, and its ID is a hash of the compiled source. The module URL is part of the
* hash so two identical files get IDs of their own, since their source maps differ.
*/
export declare const debugIdLoader: ModuleLoader;
/**
* The minifier drops comments and the asset server rebuilds source maps after the loaders ran, so
* the `//# debugId=` comment and the source map's `debugId` field, which is what `sentry-cli` reads,
* are added to the served response instead.
*/
/**
* The asset server's own `fetch`, before stamping. The emitter needs it because stamping hides source
* maps by default, and the upload must still get them.
* @internal
*/
export declare const UNSTAMPED_FETCH: unique symbol;
export {};
//# sourceMappingURL=assetServer.d.ts.map