Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Jun 23, 2025

Follow up to #14096.

  • Makes the entire mdx.ts and accompanying modules async
  • Limits concurrency in mdx.ts async ops (otherwise we crash Vercel Functions / AWS Lambda) (check https://sentry-docs-git-byk-cimdx-cache.sentry.dev/platform-redirect/ -- should not crash)
  • Adds compression to caches (as Vercel complained about the function size)
  • Removes the <script> blocks from the HTML for cache key calculation and faster md generation. Script blocks are already ignored and they are not stable across builds even when nothing changes, causing cache misses.

Cuts down build times from ~21-22 minutes to ~13-14 minutes.

@vercel
Copy link

vercel bot commented Jun 23, 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 Jun 25, 2025 7:19am
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2025 7:19am

@codecov
Copy link

codecov bot commented Jun 23, 2025

Bundle Report

Changes will increase total bundle size by 593.42kB (2.81%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 11.52MB 593.43kB (5.43%) ⬆️
sentry-docs-client-array-push 9.8MB -6 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.64MB -0.0%
1614.js (New) 1.05MB 1.05MB 100.0% 🚀
../instrumentation.js -3 bytes 973.36kB -0.0%
9523.js -3 bytes 949.31kB -0.0%
../app/[[...path]]/page.js.nft.json 196.48kB 598.51kB 48.87% ⚠️
../app/platform-redirect/page.js.nft.json 196.48kB 598.42kB 48.88% ⚠️
../app/sitemap.xml/route.js.nft.json 196.48kB 596.4kB 49.13% ⚠️
../app/[[...path]]/page.js 252 bytes 591.55kB 0.04%
9273.js 2 bytes 84.53kB 0.0%
../app/sitemap.xml/route.js 530 bytes 34.27kB 1.57%
../app/platform-redirect/page.js 252 bytes 31.61kB 0.8%
9567.js 1.69kB 20.35kB 9.07% ⚠️
4288.js (Deleted) -1.04MB 0 bytes -100.0% 🗑️

Files in 9273.js:

  • ./src/docTree.ts → Total Size: 10.9kB

Files in ../app/sitemap.xml/route.js:

  • ./app/sitemap.ts → Total Size: 969 bytes

Files in 9567.js:

  • ./src/files.ts → Total Size: 399 bytes

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

App Routes Affected:

App Route Size Change Total Size Change (%)
/platform-redirect 252 bytes 2.58MB 0.01%
/[[...path]] 252 bytes 3.14MB 0.01%
/ 530 bytes 2.61MB 0.02%
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 873.24kB -0.0%
static/chunks/7750-*.js -3 bytes 415.85kB -0.0%
server/middleware-*.js -5.55kB 1.0kB -84.74%
server/middleware-*.js 5.55kB 6.55kB 555.3% ⚠️
static/nFSM41Cymy0G_SmZxjx7M/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/nFSM41Cymy0G_SmZxjx7M/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/wVW1HYg79DZ1uunK7vnXF/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/wVW1HYg79DZ1uunK7vnXF/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

@codeowner-assignment codeowner-assignment bot requested review from a team and jas-kas June 23, 2025 18:53

### Guides for Source Maps

- <PlatformLink to="/sourcemaps/uploading/typescript/">
Copy link
Member Author

Choose a reason for hiding this comment

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


</Alert>

<Include name="sourcemaps/overview/javascript.cloudflare.mdx" />
Copy link
Member Author

Choose a reason for hiding this comment

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

This include was simply being ignored as it could not be found. With the new system, this causes a build error so I fixed it.

Check current vs fixed

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

just some theories about further improvements. Looks good overall!

@BYK BYK changed the title ci(build): Try to cache mdx bundler ci(build): Parallelize and cache mdx pipeline - fix md cache Jun 25, 2025
@BYK BYK merged commit 3a3b12c into master Jun 25, 2025
14 checks passed
@BYK BYK deleted the byk/ci/mdx-cache branch June 25, 2025 07:50
@sentry
Copy link

sentry bot commented Jun 26, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

bitsandfoxes pushed a commit that referenced this pull request Jul 3, 2025
Follow up to #14096.

- Makes the entire `mdx.ts` and accompanying modules async
- Limits concurrency in `mdx.ts` async ops (otherwise we crash Vercel
Functions / AWS Lambda) (check
https://sentry-docs-git-byk-cimdx-cache.sentry.dev/platform-redirect/ --
should not crash)
- Adds compression to caches (as Vercel complained about the function
size)
- Removes the `<script>` blocks from the HTML for cache key calculation
and faster `md` generation. Script blocks are already ignored and they
are not stable across builds even when nothing changes, causing cache
misses.

Cuts down build times from ~21-22 minutes to ~13-14 minutes.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 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.

4 participants