Skip to content

Conversation

@sfanahata
Copy link
Contributor

DESCRIBE YOUR PR

Problem:

  • Problem: MDX files in /docs directory required server restart to see changes
  • Root Cause: The getFileBySlugWithCache function was caching MDX files even in development
  • Solution: Added development mode check to bypass cache when NODE_ENV === 'development'
  • Impact: Hot reload now works for .mdx files while preserving production performance

Solution

  • Bypass MDX cache in development mode to allow hot reload
  • Maintains caching behavior in production for performance
  • Resolves issue where MDX changes required server restart

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

@vercel
Copy link

vercel bot commented Jul 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2025 7:59am
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2025 7:59am

@sfanahata sfanahata requested review from BYK and chargome July 11, 2025 22:39
@codecov
Copy link

codecov bot commented Jul 11, 2025

Bundle Report

Changes will increase total bundle size by 141 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 9.82MB -2 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 11.91MB 143 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 879.57kB -0.0%
static/chunks/1831-*.js -3 bytes 422.11kB -0.0%
server/app/api/ip-*.js 1 bytes 259.13kB 0.0%
server/app/_not-*.js 1 bytes 259.12kB 0.0%
server/app/[[...path]]/page_client-*.js 1 bytes 259.08kB 0.0%
server/app/platform-*.js 1 bytes 244.62kB 0.0%
static/1jDYZ1MP__ENFnugCaJvE/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/1jDYZ1MP__ENFnugCaJvE/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/Ti_7Tl8aOw9Jb9v_6tDbb/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/Ti_7Tl8aOw9Jb9v_6tDbb/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.67MB -0.0%
../instrumentation.js -41 bytes 996.74kB -0.0%
9523.js -3 bytes 972.72kB -0.0%
../app/[[...path]]/page.js.nft.json 65 bytes 705.76kB 0.01%
../app/platform-redirect/page.js.nft.json 65 bytes 705.68kB 0.01%
../app/sitemap.xml/route.js.nft.json 65 bytes 703.65kB 0.01%
../app/[[...path]]/page.js 1 bytes 592.68kB 0.0%
4217.js 1 bytes 191.33kB 0.0%
9273.js 1 bytes 84.57kB 0.0%
../app/platform-redirect/page.js 1 bytes 31.66kB 0.0%
9567.js -9 bytes 20.65kB -0.04%

Files in 9567.js:

  • ./src/mdx.ts → Total Size: 24.14kB

App Routes Affected:

App Route Size Change Total Size Change (%)
/platform-redirect 1 bytes 2.58MB 0.0%
/[[...path]] 1 bytes 3.14MB 0.0%

@BYK
Copy link
Member

BYK commented Jul 12, 2025

I'll change one little thing before merging but this is definitely the right place and the right approach. Will approve and merge tomorrow morning.

@BYK BYK changed the title fixes hot reload for Shannon and hopefully others fix(mdx): Disable in-memory cache for development Jul 12, 2025
@BYK BYK enabled auto-merge (squash) July 12, 2025 07:44
@BYK BYK merged commit bae3b4d into master Jul 12, 2025
15 checks passed
@BYK BYK deleted the hot-reload-wtf branch July 12, 2025 07:59
@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants