-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Add APIs page for JavaScript #12605
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
Bundle ReportChanges will increase total bundle size by 26.47kB (0.13%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
Files in
view changes for bundle: sentry-docs-server-cjsAssets Changed:
Files in
Files in
App Routes Affected:
|
I think it would be better to change the parameters to use the full width and have the object description below them. Now we have plenty of unused space and the object parameters could use the full width instead. Instead of
Do this
How does that sound? |
Yeah, I think that makes sense. I agree it is a bit wasteful as-is. This is really an early draft so def. needs some more love :D Also re: dark mode, this def. needs to be done, true! |
I have re-vamped the design completely now: Screen.Recording.2025-03-26.at.14.22.47.mov(it should also work in dark mode now) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the page!
I believe many users will find this overview page helpful for accessing basic information quickly without reading through extensive documentation. I will use this page a loooot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General question: will this page have a higher relevance for search? For example, when I look for "addIntegration", it would be great to have this page listed in the results somewhere near the top
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a question for @chargome when he's back :D but it's a valid point!
|
||
The started span will automatically be ended when the callback returns, and will thus measure the duration of the callback. The callback cann also be an async function. | ||
|
||
<Expandable title='Examples'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how you've used the Expandable component throughout the page – it makes the site look very neat! The consistency in use is also great and helps users find their way around 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: How do you currently decide which function to add an example to?
I'm just wondering if it would make sense to add more? I understand that some will not really need one, though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really very much a gut-feeling thing, where I feel the API is more complex/harder to understand without an example 😅 We can def. add more where we feel like it!
sidebar_order: 3 | ||
--- | ||
|
||
This page shows all available to-level APIs of the SDK. You can use them like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add a bit more information here at the top (e.g., very briefly explain the purpose of these APIs).
It could also be good to use the word "function" to make it clear that these are SDK APIs and not REST APIs (something like "... the primary functions provided by the SDK for interacting with ...").
Let me know if I can support you with this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, will add a bit more context here!
|
||
## Available Options | ||
|
||
<TableOfContents ignoreIds={["available-options"]} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note, probably not a topic right now:
When you open the page you see two ToC's - one in the center and one to the right.
I can imagine that users gravitate towards the ToC in the center to find the API they're looking for (it is more eye-catching than the ToC in the sidebar). So, it is definitely valuable and needs to be here!
Still, I wish we could toggle the ToC (visible by default); especially considering that the list will become longer rather than shorter in the future 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I get what you mean. What would you propose (for a follow up):
- allow to toggle the TOC in the main page?
- Do not show the TOC in the sidebar?
- Something else...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My proposition:
3. allow to toggle the second level of list elements in the main area (default: hidden)
Core APIs >
Capturing Events >
Enriching Events v
setTag
setTags
I understand if this is too extra :D
WIP WIP wip fixes [getsentry/action-github-commit] Auto commit expandable parameters? [getsentry/action-github-commit] Auto commit font size?
Co-authored-by: Lukas Stracke <[email protected]>
I made a (final?) round of updates based on feedback, feel free to give it another look, if nothing else comes up I'll merge this tomorrow! |
Co-authored-by: Sarah Mischinger <[email protected]>
This adds a new top-level page to the JavaScript docs called "APIs", which is a list of all the top-level APIs that users may need.
This is a manually curated list, and not supposed to be fully exhaustive - but it should contain everything a user may want to call. These are all the
Sentry.xxx
functions, basically.For this, some new components are added to handle formatting of this, as well as code-based syntax highlighting. For now only typescript is supported (to reduce bundle size?) but we can add more if needed. Platforms can also get a
language
defined now which controls how stuff is formatted.As of now, parameters are formatted in a pseudo-typescript format. Not sure if that works for all languages, but we can do something platform specific in the future if needed.
There may be adjustments to be done to the APIs, and I most likely have forgotten one thing or another, but we can always tweak this further where needed.
Example API references: