3.6 KiB
3.6 KiB
Deprecated Functions and Code
This document tracks functions that have been marked as deprecated and should be removed in future releases.
Email Parsing and Processing Functions
1. splitEmailHeadersAndBody
- Location:
app/courrier/page.tsx - Reason: Email parsing has been centralized in
lib/mail-parser-wrapper.tsand the API endpoint. - Replacement: Use the
decodeEmailfunction fromlib/mail-parser-wrapper.tswhich provides a more comprehensive parsing solution. - Status: Currently marked with
@deprecatedcomment, no usages found.
2. getReplyBody
- Location:
app/courrier/page.tsx - Reason: Should use the
ReplyContentcomponent directly. - Replacement: Use
<ReplyContent email={email} type={type} />directly. - Status: Currently marked with
@deprecatedcomment, no direct usages found.
3. generateEmailPreview
- Location:
app/courrier/page.tsx - Reason: Should use the
EmailPreviewcomponent directly. - Replacement: Use
<EmailPreview email={email} />directly. - Status: Currently marked with
@deprecatedcomment, no usages found.
4. cleanHtml (in server/email-parser.ts)
- Location:
lib/server/email-parser.ts - Reason: This functionality has been centralized in
lib/mail-parser-wrapper.ts. - Replacement: Use
cleanHtmlfromlib/mail-parser-wrapper.ts. - Status: Currently marked with
@deprecatedcomment, used inparseEmailfunction.
5. processHtml (in parse-email/route.ts)
- Location:
app/api/parse-email/route.ts - Reason: HTML processing has been centralized in
lib/mail-parser-wrapper.ts. - Replacement: Use
cleanHtmlfromlib/mail-parser-wrapper.ts. - Status: Currently marked with
@deprecatedcomment, still used in the API route.
Deprecated API Routes
1. app/api/mail/[id]/route.ts
- Status: Deleted
- Replacement: Use
app/api/courrier/[id]/route.tsinstead.
2. app/api/mail/route.ts
- Status: Deleted
- Replacement: Use
app/api/courrier/route.tsinstead.
3. app/api/mail/send/route.ts
- Status: Deleted
- Replacement: Use
app/api/courrier/send/route.tsinstead.
Deprecated Components
ComposeEmail (components/ComposeEmail.tsx)
Status: Deprecated since November 2023
Replacement: Use components/email/ComposeEmail.tsx instead
This component has been deprecated in favor of the more modular and better structured version in the email directory. The newer version has the following improvements:
- Better separation between user message and quoted content in replies/forwards
- Improved styling and visual hierarchy
- Support for RTL/LTR text direction toggling
- More modern UI using Card components instead of a modal
- Better state management for email composition
A compatibility layer has been added to the new component to ensure backward compatibility with existing code that uses the old component. This allows for a smooth transition without breaking changes.
Migration Plan:
- Update imports in files using the old component to import from
@/components/email/ComposeEmail - Test to ensure functionality works with the new component
- Delete the old component file once all usages have been migrated
Migration Plan
Phase 1: Deprecation (Current)
- Mark all deprecated functions with
@deprecatedcomments - Add console warnings to deprecated functions
- Document alternatives
Phase 2: Removal (Future)
- Remove deprecated functions after ensuring no code uses them
- Ensure proper migration path for any code that might have been using these functions
- Update documentation to remove references to deprecated code