Package Updates and Duplicate Import Cleanup
Summary
Updated project dependencies and removed duplicate remark imports from ChangelogEntry component to align with established markdown processing architecture.
Why Care
This cleanup eliminates redundant code and ensures all markdown processing follows the centralized pattern established in the codebase. The dependency updates include security patches and performance improvements, while the import cleanup reduces bundle size and prevents potential conflicts between duplicate markdown processors.
Implementation
Changes Made
- Package Updates: Updated multiple dependencies in
site/package.jsonandsite/pnpm-lock.yaml - Import Cleanup: Removed duplicate remark imports from
site/src/components/changelog/ChangelogEntry.astro - Markdown Processing: Replaced direct remark usage with existing
renderSimpleMarkdownutility - Utility Updates: Modified
site/src/utils/shikiHighlighter.tsandsite/src/utils/simpleMarkdownRenderer.ts - Content Sync: Updated
site/src/generated-contentsubmodule
Files Modified
text
site/package.json
site/pnpm-lock.yaml
site/src/components/changelog/ChangelogEntry.astro
site/src/generated-content
site/src/utils/shikiHighlighter.ts
site/src/utils/simpleMarkdownRenderer.ts Technical Details
ChangelogEntry Component Cleanup
File:
site/src/components/changelog/ChangelogEntry.astroRemoved Duplicate Imports:
javascript
// REMOVED - These were duplicating functionality
import { remark } from 'remark';
import remarkGfm from 'remark-gfm'; Added Proper Utility Import:
javascript
// ADDED - Uses centralized markdown processing
import { renderSimpleMarkdown } from "@utils/simpleMarkdownRenderer"; Updated Processing Logic:
javascript
// BEFORE: Missing variables causing TypeScript errors
// previewRendered and restRendered were undefined
// AFTER: Proper markdown processing using centralized utility
const previewRendered = renderSimpleMarkdown(previewContent);
const restRendered = hasMoreContent ? renderSimpleMarkdown(restContent) : { html: '', plainText: '' }; Template Rendering:
astro
<!-- Uses processed HTML from renderSimpleMarkdown utility -->
<div class="changelog-entry__content" set:html={previewRendered.html} />
<div class="changelog-entry__content hidden" id={`content-${id}`} set:html={restRendered.html} /> Architecture Alignment
- Centralized Processing: All markdown processing now goes through established utilities
- Import Sequence: Proper remark/rehype plugin ordering handled by
renderSimpleMarkdown - Error Elimination: Fixed TypeScript errors for missing
previewRenderedandrestRenderedvariables - Bundle Optimization: Removed duplicate remark dependencies from component level
Integration Points
- AstroMarkdown Ecosystem: ChangelogEntry now properly integrates with the existing markdown processing architecture
- Utility Dependencies: Component relies on
@utils/simpleMarkdownRendererwhich handles all remark/rehype complexity - Build System: Changes tested with both
pnpm buildandpnpm dev- no errors or warnings - Content Collections: Maintains compatibility with Astro content collections and changelog rendering
Documentation
- Existing Pattern: Follows the same pattern used by other components that process markdown content
- Utility Reference:
renderSimpleMarkdownalready documented insite/src/utils/simpleMarkdownRenderer.ts - Component Comments: Updated inline documentation to reflect new processing approach
Build Verification
- ✅
pnpm buildcompleted successfully with no errors - ✅
pnpm devserver starts cleanly - ✅ All TypeScript errors resolved
- ✅ Markdown processing functionality preserved
- ✅ Preview/expand functionality maintains existing behavior
Performance Impact
- Reduced Bundle Size: Eliminated duplicate remark imports at component level
- Consistent Processing: Single markdown processor reduces memory overhead
- Faster Builds: Fewer duplicate dependencies to resolve and bundle