Skip to the content

Capsid menu

app/lib/content/load-pipeline.server.ts

17 lines and 4 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.

Functions

The functions of load-pipeline.server.ts
FunctionLinesComplexityCoveredCRAPMutation
loadPipeline6 to 182No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code
<anonymous:9>9 to 121No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code
<anonymous:10>10 to 101No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code
<anonymous:13>13 to 161No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code

Imports

It imports app/lib/content/pipeline.mjs, app/lib/content/wasm.server.ts. Imported by app/kb/procedures/save.server.ts, app/kb/registry/host.server.ts, app/lib/cv/pdf.server.ts, app/lib/cv/save.server.ts, app/lib/dictionary/save.server.ts, app/lib/editor/publish.server.ts, app/lib/llms/save.server.ts, app/lib/pages/save.server.ts, app/lib/phages/save.server.ts, app/lib/roster/save.server.ts, app/routes/admin.preview.ts.

Source

// Never import pipeline.mjs statically from app or worker code: it drags shiki, katex, Plot and
// linkedom into every cold isolate (4.4 MB chunk, measured), and nothing checks for it.
// Isolate-wide: the loaded modules are the same for every request.
let pipeline: Promise<typeof import("./pipeline.mjs")> | undefined;

export function loadPipeline(): Promise<typeof import("./pipeline.mjs")> {
  // A failed load is not cached, so one bad fetch is not every later save's error.
  pipeline ??= Promise.all([import("./wasm.server"), import("./pipeline.mjs")])
    .then(([{ instantiate }, loaded]) => {
      loaded.setWasmLoader(() => instantiate);
      return loaded;
    })
    .catch((error) => {
      pipeline = undefined;
      throw error;
    });
  return pipeline;
}