Skip to content

feat: Allow to have top level alias for platforms #13069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 25, 2025
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Mar 20, 2025

Today, it is a bit confusing in some cases, but especially JavaScript, that the top level platform is called "JavaScript" (which all guides inherit from), but actually it is just Browser JavaScript.

This adds a new field which, when set for a platform, will lead to a slightly different behavior:

Screenshot 2025-03-20 at 16 30 08

And

Screenshot 2025-03-20 at 16 27 03

Some notes:

  1. When you click on the top level "JavaScript" in the sidebar, it will basically "redirect" to "Browser JavaScript"
  2. For other platforms that have not set this field, nothing changes - so with this PR, only JS changes.
  3. The breadcrumbs are a bit tricky/weird, there I opted to leave it as it is for now 🤔 it's a bit inconsistent, but everything else is quite tricky as the hierarchy needs to change based on if a guide is selected etc. we may tweak this still...

@mydea mydea self-assigned this Mar 20, 2025
Copy link

vercel bot commented Mar 20, 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 Mar 21, 2025 11:26am
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 21, 2025 11:26am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview Mar 21, 2025 11:26am

Copy link

codecov bot commented Mar 20, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 10.59MB 313 bytes (0.0%) ⬆️
sentry-docs-client-array-push 9.43MB 154 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 868.78kB -0.0%
static/chunks/3319-*.js -3 bytes 394.16kB -0.0%
static/chunks/app/[[...path]]/page-*.js 71 bytes 75.13kB 0.09%
static/chunks/818-*.js 89 bytes 42.41kB 0.21%
static/HXpsENSKNXiWT6Hd3mLfo/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/HXpsENSKNXiWT6Hd3mLfo/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/lEMKawQGy_E4xJXsReprn/_buildManifest.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/lEMKawQGy_E4xJXsReprn/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Files in static/chunks/app/[[...path]]/page-*.js:

  • ./src/components/platformFilter/client.tsx → Total Size: 15.16kB

Files in static/chunks/818-*.js:

  • ./src/components/platformSelector/index.tsx → Total Size: 20.16kB
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.58MB -0.0%
../instrumentation.js -3 bytes 908.25kB -0.0%
9523.js -3 bytes 884.31kB -0.0%
../app/[[...path]]/page.js 71 bytes 535.0kB 0.01%
2065.js 251 bytes 82.23kB 0.31%

Files in ../app/[[...path]]/page.js:

  • ./src/components/platformFilter/client.tsx → Total Size: 505 bytes

Files in 2065.js:

  • ./src/components/platformSelector/index.tsx → Total Size: 490 bytes

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

  • ./src/components/breadcrumbs/index.tsx → Total Size: 1.13kB

  • ./src/components/platformSelector/index.tsx → Total Size: 19.07kB

App Routes Affected:

App Route Size Change Total Size Change (%)
/[[...path]] 71 bytes 3.08MB 0.0%

@mydea mydea requested review from stephanie-anderson, a-hariti and chargome and removed request for stephanie-anderson and a-hariti March 21, 2025 11:08
@mydea mydea changed the title WIP: Allow to have top level alias for platforms feat: Allow to have top level alias for platforms Mar 21, 2025
@mydea mydea marked this pull request as ready for review March 21, 2025 11:08
@coolguyzone
Copy link
Contributor

Hey @mydea , is there an Issue or some other context where this came up? I agree this could be more clear, I'm not sure about using Browser JavaScript though, are web browsers the only application for vanilla JavaScript?

cc @codyde

@mydea
Copy link
Member Author

mydea commented Mar 24, 2025

Hey @mydea , is there an Issue or some other context where this came up? I agree this could be more clear, I'm not sure about using Browser JavaScript though, are web browsers the only application for vanilla JavaScript?

cc @codyde

So basically the "top level" JavaScript docs are all about using @sentry/browser, so yes very much browser specific 😅 basically the fact that this is unclear explains why I want to make this change! xD

You cannot and should not look at the top level "JavaScript" docs if you want to e.g. set up a node app, because it is literally Browser specific. Contrary to most other platforms/guides, in the case of JS the platform docs are not really a subset of the guide docs, sadly :/ But today, this is not really clear at all, and you can easily be tempted to look at the JS docs if you want more specific docs for another framework/guide!

@codyde
Copy link
Contributor

codyde commented Mar 24, 2025

Yeah IMO this is a raelly good point. The reality is, similar to what @mydea already said, in most cases if someone is looking for "top level" JavaScript, they are probably ultimately looking for Node, but we're sending them to Browser JavaScript.

IMO this is a good change - its also smentically accurate since the package we're using is Browser JavaScript anyways.

Thanks for the thoughtful suggestion here @mydea!

@coolguyzone
Copy link
Contributor

Ok @mydea , thanks for the context! The code changes look good to me and so does the preview link. Once one of the docs engineers reviews this should be good to merge.

@mydea mydea merged commit 772d896 into master Mar 25, 2025
13 checks passed
@mydea mydea deleted the fn/platform-alias branch March 25, 2025 11:20
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 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