diffs

Use when an app uses @pierre/diffs to render or edit code files, diffs, patches, merge conflicts, or CodeView review surfaces, including React, vanilla JavaScript, SSR, workers, annotations, selection, and custom Shiki languages or themes.

Install
npx skills add 'https://github.com/pierrecomputer/pierre/tree/main/skills/diffs'
Download bundle ↓
main · 1831817Scanned 2026-09-15

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗
View on GitHub
← Back to SKILL.md

Recipe: preload a diff on the server

Create props on the server and pass the result to the matching React component:

import { preloadMultiFileDiff } from '@pierre/diffs/ssr';
import { MultiFileDiff } from '@pierre/diffs/react';

const preloaded = await preloadMultiFileDiff({
  oldFile: { name: 'src/value.ts', contents: oldSource },
  newFile: { name: 'src/value.ts', contents: newSource },
  options: { theme: 'pierre-dark', diffStyle: 'split' },
});

<MultiFileDiff {...preloaded} />;

Select the preload function that matches the client component. Use preloadDiffHTML or preloadUnresolvedFileHTML when the host needs an HTML string only.

Referenced from SKILL.md