Skip to content

Commit 1dbbe1d

Browse files
committed
Replace isomorphic-dompurify with dompurify, drop jsdom from production deps (#804)
Since DOMPurify is only used in a "use client" component (EntryContentBody), it always runs in the browser where native DOM is available. This means we don't need isomorphic-dompurify's jsdom-based server fallback. - Replace `isomorphic-dompurify` with `dompurify` (uses native browser DOM) - Remove `jsdom` from production dependencies (remains available via vitest) - Reduces transitive dependency surface area (no more undici in production) Closes #804 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c444c69 commit 1dbbe1d

3 files changed

Lines changed: 56 additions & 37 deletions

File tree

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"argon2": "^0.44.0",
6262
"concurrently": "^9.2.1",
6363
"discord.js": "^14.26.2",
64+
"dompurify": "^3.3.3",
6465
"dotenv-cli": "^11.0.0",
6566
"drizzle-orm": "^0.45.2",
6667
"fast-xml-parser": "^5.5.9",
@@ -70,8 +71,6 @@
7071
"html-rewriter-wasm": "^0.4.1",
7172
"htmlparser2": "^10.1.0",
7273
"ioredis": "^5.9.3",
73-
"isomorphic-dompurify": "^3.7.1",
74-
"jsdom": "^29.0.1",
7574
"linkedom": "^0.18.12",
7675
"mammoth": "^1.11.0",
7776
"marked": "^17.0.3",

pnpm-lock.yaml

Lines changed: 54 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/entries/EntryContentBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { useEffect, useRef, useMemo } from "react";
1111
import { useHotkeys } from "react-hotkeys-hook";
12-
import DOMPurify from "isomorphic-dompurify";
12+
import DOMPurify from "dompurify";
1313

1414
// Configure DOMPurify to:
1515
// 1. Open all external links in new tabs

0 commit comments

Comments
 (0)