Skip to content

sanity markdown#732

Merged
elie222 merged 1 commit intomainfrom
chore/sanity-studio-md
Aug 29, 2025
Merged

sanity markdown#732
elie222 merged 1 commit intomainfrom
chore/sanity-studio-md

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Aug 29, 2025

Summary by CodeRabbit

  • New Features

    • Added Markdown editing support to the web app’s content management experience, enabling richer text formatting and easier authoring with a streamlined editor and live preview.
  • Chores

    • Updated the marketing content submodule to the latest revision to keep site content in sync.

@vercel
Copy link

vercel bot commented Aug 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Aug 29, 2025 2:49pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

Walkthrough

Updated a marketing submodule reference and added two dependencies to apps/web/package.json. No code, API, or interface changes were modified. Control flow and error handling remain unchanged.

Changes

Cohort / File(s) Summary of Changes
Submodule update
apps/web/app/(marketing)
Advanced submodule pointer from dc789dc5 to 2cb82aa, updating checked-out content only.
Web app dependencies
apps/web/package.json
Added dependencies: easymde@^2.20.0, sanity-plugin-markdown@6.0.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I nudge the submodule, hop—no code to mend,
Two shiny deps in the basket I send.
Ears up, I commit, with a soft little cheer,
Markdown and MDE nibbling near.
Thump-thump—onward! The changelog is clear. 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/sanity-studio-md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@claude
Copy link

claude bot commented Aug 29, 2025

Claude finished @elie222's task —— View job


Pull Request Review

Reviewing PR #732 "sanity markdown" for code quality, security, performance, and best practices.

Summary

This PR adds markdown editing capabilities to the Sanity CMS configuration by introducing two new dependencies: easymde (a markdown editor) and sanity-plugin-markdown (Sanity CMS plugin for markdown support).

Detailed Analysis

New Dependencies Added

  1. easymde: ^2.20.0

    • Simple, embeddable markdown editor built on CodeMirror
    • Active maintenance: Regularly updated, good community support
    • ⚠️ Bundle size impact: ~125KB minified, significant for client-side bundles
    • Security: No known vulnerabilities in this version
  2. sanity-plugin-markdown: 6.0.0

    • Official plugin to integrate markdown editing in Sanity Studio
    • Compatibility: Version 6.0.0 is compatible with Sanity v3
    • Official plugin: Maintained by Sanity team, well-documented

Code Quality Assessment

Dependency Management:

  • Uses exact version for sanity-plugin-markdown (good for stability)
  • Uses caret range for easymde (allows patch updates)
  • Both dependencies properly locked in pnpm-lock.yaml

Architecture:

  • The project already has Sanity infrastructure (sanity.cli.ts, @portabletext/react)
  • New dependencies integrate well with existing Sanity setup
  • Optional dependencies structure indicates proper conditional loading

Performance Considerations

⚠️ Bundle Size Impact:

  • easymde adds ~125KB to bundle size
  • Only loads when Sanity Studio is accessed
  • Consider code-splitting if markdown editor isn't used everywhere

Loading Strategy:

  • Both packages are in dependencies, not devDependencies
  • Appropriate since they're needed at runtime for Sanity Studio

Security Assessment

No Security Issues Found:

  • No known vulnerabilities in specified versions
  • Both packages from trusted maintainers
  • Proper version pinning in lock file

Test Coverage Implications

⚠️ Missing Test Coverage:

  • No tests found for Sanity-related functionality
  • Consider adding integration tests for markdown content handling
  • Existing test suite has 48 test files but none cover CMS functionality

Best Practices & Recommendations

Good:

  • Proper semantic versioning usage
  • Clean dependency management
  • Follows existing project patterns

📝 Recommendations:

  1. Add JSDoc comments in components using markdown editor
  2. Consider lazy loading for easymde to reduce initial bundle size
  3. Add integration tests for Sanity markdown functionality
  4. Document markdown schema in code comments or docs
  5. Consider Bundle Analysis: Run next bundle-analyzer to measure impact

Missing Context

⚠️ No Description: PR lacks description explaining:

  • Purpose of adding markdown support
  • Where it will be used in the application
  • Any breaking changes or migration needed

Verdict

✅ APPROVED - This is a clean, well-structured addition that follows project conventions. The dependencies are appropriate and secure, though consider the performance recommendations above.

Action Items

  • Add integration tests for markdown functionality
  • Consider bundle optimization strategies
  • Update documentation if this affects user-facing features

@socket-security
Copy link

@elie222 elie222 merged commit 2c129c3 into main Aug 29, 2025
12 of 13 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/web/app/(marketing) (1)

1-1: Drop submodule checks; focus on markdown deps placement and SSR safety.

  • No submodule changes in this PR—CI checkout config need not be updated.
  • easymde and sanity-plugin-markdown are declared in apps/web/package.json but not imported in apps/web/app/**. If they’re only for Studio, move them to the Studio workspace; otherwise, import them in client components or via dynamic(() => import(...), { ssr: false }).
  • No next/document imports found under apps/web/app.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1b02c91 and d9ec278.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • apps/web/app/(marketing) (1 hunks)
  • apps/web/package.json (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
apps/web/app/**

📄 CodeRabbit inference engine (apps/web/CLAUDE.md)

NextJS app router structure with (app) directory

Files:

  • apps/web/app/(marketing)
!{.cursor/rules/*.mdc}

📄 CodeRabbit inference engine (.cursor/rules/cursor-rules.mdc)

Never place rule files in the project root, in subdirectories outside .cursor/rules, or in any other location

Files:

  • apps/web/app/(marketing)
  • apps/web/package.json
!pages/_document.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)

!pages/_document.{js,jsx,ts,tsx}: Don't import next/document outside of pages/_document.jsx in Next.js projects.
Don't import next/document outside of pages/_document.jsx in Next.js projects.

Files:

  • apps/web/app/(marketing)
  • apps/web/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Jit Security
  • GitHub Check: claude-review
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
apps/web/package.json (2)

97-97: Pin EasyMDE and ensure client-only usage

  • In apps/web/package.json, change:

    -    "easymde": "^2.20.0",
    +    "easymde": "2.20.0",
  • To verify there are no server-side imports of EasyMDE, run:

    #!/bin/bash
    grep -R -n -C2 --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" \
      -e "from 'easymde'" \
      -e "from \"easymde\"" \
      -e "require('easymde')" \
      -e "require(\"easymde\")" .

139-139: Align Sanity plugin version and scope properly

  • sanity-plugin-markdown@6.0.0 declares a peer on sanity@^4 while the project uses sanity@3.90.0—either upgrade Sanity to v4 or downgrade the plugin to a 5.x release compatible with v3.
  • Move the plugin from dependencies to optionalDependencies next to other Studio‐only packages to prevent it entering the Next.js runtime.
  • Ensure zero imports/usage in non-Studio code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant