webui: remove deprecated @types/dompurify dependency
Remove @types/dompurify package dependency since modern dompurify includes
built-in TypeScript definitions, eliminating the npm deprecation warning.
Problem Analysis:
npm install was showing deprecation warning:
'@types/dompurify@3.2.0: This is a stub types definition. dompurify provides
its own type definitions, so you do not need this installed.'
The webui package.json included both dompurify@^3.2.6 and @types/dompurify@^3.2.0
as dependencies. Modern versions of dompurify (3.x+) ship with their own
TypeScript definitions built-in, making the separate @types package redundant
and deprecated. This created unnecessary dependency bloat and triggered warnings
during npm install operations.
Implementation Changes:
1. Package Dependency Cleanup:
- Removed '@types/dompurify': '^3.2.0' from webui/package.json dependencies
- Preserved dompurify@^3.2.6 which provides both runtime code and TypeScript types
- No code changes required since imports remain identical
2. TypeScript Compatibility:
- Verified existing DOMPurify imports continue working with built-in types
- Confirmed TypeScript compilation passes without @types/dompurify
- No changes needed to mobile-chat.ts, sketch-tool-card.ts, or sketch-timeline-message.ts
Technical Details:
- dompurify 3.x series includes index.d.ts with complete TypeScript definitions
- Import syntax 'import DOMPurify from "dompurify"' unchanged and fully typed
- npm install completes cleanly without deprecation warnings
- TypeScript check (tsc --noEmit) passes successfully with built-in types
Benefits:
- Eliminates npm deprecation warning during install operations
- Reduces dependency count and package.json complexity
- Uses official TypeScript definitions from dompurify maintainers
- Maintains identical functionality and type safety
- Cleaner dependency tree without redundant type packages
Testing:
- npm install runs successfully without warnings
- TypeScript compilation (npm run check) passes without errors
- All DOMPurify usage in web components maintains full type safety
- Build process completes successfully with built-in type definitions
This cleanup removes technical debt and follows best practices for modern
TypeScript package management by using built-in type definitions rather
than deprecated stub packages.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: sf9e195a31b2adb28k
webui: update package-lock.json after removing @types/dompurify
Update package-lock.json to reflect removal of deprecated @types/dompurify
dependency, completing the cleanup of redundant type definitions.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s0cdb73feadefc7b1k
diff --git a/webui/package-lock.json b/webui/package-lock.json
index 848b7d5..03f2a17 100644
--- a/webui/package-lock.json
+++ b/webui/package-lock.json
@@ -9,7 +9,6 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
- "@types/dompurify": "^3.2.0",
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
"dompurify": "^3.2.6",
@@ -1989,15 +1988,6 @@
"integrity": "sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==",
"dev": true
},
- "node_modules/@types/dompurify": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/@types/dompurify/-/dompurify-3.2.0.tgz",
- "integrity": "sha512-Fgg31wv9QbLDA0SpTOXO3MaxySc4DKGLi8sna4/Utjo4r3ZRPdCt4UQee8BWr+Q5z21yifghREPJGYaEOEIACg==",
- "deprecated": "This is a stub types definition. dompurify provides its own type definitions, so you do not need this installed.",
- "dependencies": {
- "dompurify": "*"
- }
- },
"node_modules/@types/estree": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz",
diff --git a/webui/package.json b/webui/package.json
index 4fbe008..f96f86d 100644
--- a/webui/package.json
+++ b/webui/package.json
@@ -24,7 +24,6 @@
"test:playwright": "playwright test -c playwright-ct.config.ts"
},
"dependencies": {
- "@types/dompurify": "^3.2.0",
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
"dompurify": "^3.2.6",