Skip to content

Conversation

@sfanahata
Copy link
Contributor

@sfanahata sfanahata commented Sep 12, 2025

DESCRIBE YOUR PR

Summary
Enhanced the platform redirect system to show individual JavaScript frameworks (React, Vue, Angular, etc.) as separate, nested options under the main JavaScript platform. This provides users with a more customized and framework-specific experience when selecting their platform. Also added better logic to check for guide paths because Dart also wasn't showing up due to being nested.

Problem
When users clicked platform-redirect links (like /platform-redirect/?next=/session-replay/privacy/), they only saw top-level platforms (JavaScript, Android, React Native). This didn't reflect that many JavaScript frameworks have different support levels for specific features, and users couldn't easily select their specific framework for a more tailored experience. They also did not see Dart, which was nested under a Dart/Flutter guide.

Solution

  • Automatic Framework Detection: The system now reads the notSupported frontmatter from JavaScript documentation pages to determine which frameworks support each feature. Added more robust logic to search for guides under each platform if main platform paths are empty.

  • Visual Nesting: JavaScript frameworks are indented under the main JavaScript platform for clear hierarchy
    Smart Positioning: JavaScript and its frameworks appear at the end of the platform list
    Framework-Specific URLs: Each framework links to the main JavaScript documentation for that feature

Example pages:
https://sentry-docs-git-platform-redirect-privacy-fix.sentry.dev/platform-redirect/?next=/session-replay/configuration/#network-details

https://sentry-docs-git-platform-redirect-privacy-fix.sentry.dev/platform-redirect/?next=/session-replay/privacy/

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 Sep 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Oct 22, 2025 10:41pm
sentry-docs Ready Ready Preview Comment Oct 22, 2025 10:41pm

cursor[bot]

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Sep 12, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 10.16MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.98MB 614 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.78MB -0.0%
../instrumentation.js -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
../app/platform-redirect/page.js 623 bytes 32.85kB 1.93%

Files in ../app/platform-redirect/page.js:

  • ./app/platform-redirect/page.tsx → Total Size: 9.29kB

App Routes Affected:

App Route Size Change Total Size Change (%)
/platform-redirect 623 bytes 2.78MB 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 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
server/middleware-*.js -6.46kB 1.0kB -86.59%
server/middleware-*.js 6.46kB 7.46kB 645.5% ⚠️
static/p39MenUyK8GGRVwZtIR2b/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/p39MenUyK8GGRVwZtIR2b/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/XxsFjN9f5OlN_Z_meDR5_/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/XxsFjN9f5OlN_Z_meDR5_/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

cursor[bot]

This comment was marked as outdated.

@sfanahata
Copy link
Contributor Author

@chargome and @a-hariti - mind giving this a second set of eyes?

Copy link
Collaborator

@a-hariti a-hariti left a comment

Choose a reason for hiding this comment

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

Overall I love the end result 😍

We should just make the solution more generic and clean up the filter logic and unnecessary mutations (as per my other comments)

PS: I can implement my suggested changes if you want 🤙 @sfanahata

let title = defaultTitle;

// get rid of irrelevant platforms for the `next` path
const platformList = extractPlatforms(rootNode).filter(platform_ => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it will be a lot more freeing to switch the type of this list from "platforms" to "platforms or guides"

from there, I see two options:

  1. the nesting will either be rendered from a flat list similar to now,
    preferably with some flag indicating that it should be nested,
    which will also open the door for a more generic solution without the hardcoded JS logic

OR

  1. keep the the "platforms" type along with an inner filter over its guides, I platform would be retained in the filter if it has at least one relevant guide (the Dart/Flutter situation).
    Then adjust the rendering accordingly

I tend to prefer approach 2, much cleaner

javascriptPlatform.guides?.forEach(guide => {
const guideKey = `javascript.${guide.name}`;
if (!notSupported.includes(guideKey)) {
jsFrameworks.push({
Copy link
Collaborator

Choose a reason for hiding this comment

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

feels like a lot of repetition : )

@sfanahata
Copy link
Contributor Author

We should just make the solution more generic and clean up the filter logic and unnecessary mutations (as per my other comments)

PS: I can implement my suggested changes if you want 🤙 @sfanahata

@a-hariti - Yes please, if it doesn't feel like too much extra work, I'd love for you to take on the changes. Vibe coding obvs only gets me so far. 😊

@sfanahata
Copy link
Contributor Author

@a-hariti - any updates on progress here?

cursor[bot]

This comment was marked as outdated.

@sfanahata sfanahata requested a review from a-hariti October 20, 2025 19:59
@vercel
Copy link

vercel bot commented Oct 20, 2025

Deployment failed with the following error:

Failed to create deployment for team_X2wL9ydOZqI86I3fHzJ6dmXs in project prj_aRQDRhyK5TJkXbwkuzkvO5ObUJPS: FetchError: request to https://76.76.21.112/v13/now/deployments?ownerId=team_X2wL9ydOZqI86I3fHzJ6dmXs&projectId=prj_aRQDRhyK5TJkXbwkuzkvO5ObUJPS&skipAutoDetectionConfirmation=1&teamId=team_X2wL9ydOZqI86I3fHzJ6dmXs&traceCarrier=%7B%22ot-baggage-webhookAt%22%3A%221760990069440%22%2C%22ot-baggage-senderUsername%22%3A%22gh.getsantry%5Bbot%5D%22%2C%22baggage%22%3A%22webhookAt%3D1760990069440%2CsenderUsername%3Dgh.getsantry%255Bbot%255D%22%2C%22x-datadog-trace-id%22%3A%226808781116258274357%22%2C%22x-datadog-parent-id%22%3A%223704648612256075727%22%2C%22x-datadog-sampling-priority%22%3A%222%22%2C%22x-datadog-tags%22%3A%22_dd.p.tid%3D68f6937500000000%2C_dd.p.dm%3D-3%22%2C%22traceparent%22%3A%2200-68f69375000000005e7da659cbf64c35-33698e48e72acfcf-01%22%2C%22tracestate%22%3A%22dd%3Dt.tid%3A68f6937500000000%3Bt.dm%3A-3%3Bs%3A2%3Bp%3A33698e48e72acfcf%22%7D failed, reason: socket hang up

@vercel
Copy link

vercel bot commented Oct 20, 2025

Deployment failed with the following error:

Failed to create deployment for team_X2wL9ydOZqI86I3fHzJ6dmXs in project QmPQTZgdNJZfrj9vUb8rCCZ75RT3Yd8xYrJdmJb6SgzypE: FetchError: request to https://76.76.21.112/v13/now/deployments?ownerId=team_X2wL9ydOZqI86I3fHzJ6dmXs&projectId=QmPQTZgdNJZfrj9vUb8rCCZ75RT3Yd8xYrJdmJb6SgzypE&skipAutoDetectionConfirmation=1&teamId=team_X2wL9ydOZqI86I3fHzJ6dmXs&traceCarrier=%7B%22ot-baggage-webhookAt%22%3A%221760990069440%22%2C%22ot-baggage-senderUsername%22%3A%22gh.getsantry%5Bbot%5D%22%2C%22baggage%22%3A%22webhookAt%3D1760990069440%2CsenderUsername%3Dgh.getsantry%255Bbot%255D%22%2C%22x-datadog-trace-id%22%3A%226808781116258274357%22%2C%22x-datadog-parent-id%22%3A%226166993005515737456%22%2C%22x-datadog-sampling-priority%22%3A%222%22%2C%22x-datadog-tags%22%3A%22_dd.p.tid%3D68f6937500000000%2C_dd.p.dm%3D-3%22%2C%22traceparent%22%3A%2200-68f69375000000005e7da659cbf64c35-55958f76e2158970-01%22%2C%22tracestate%22%3A%22dd%3Dt.tid%3A68f6937500000000%3Bt.dm%3A-3%3Bs%3A2%3Bp%3A55958f76e2158970%22%7D failed, reason: socket hang up

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.

3 participants