Skip to content

Commit bdcee0c

Browse files
committed
feat: add availableSince for a reusable availability check
1 parent ab8767e commit bdcee0c

File tree

18 files changed

+70
-26
lines changed

18 files changed

+70
-26
lines changed

docs/contributing/pages/components.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,33 @@ Attributes:
106106

107107
- `src` (string) - the URL of the Arcade embed
108108

109+
## AvailableSince
110+
111+
Display version availability information in a consistent format. Use this component to indicate when a feature, API, or configuration option became available in an SDK.
112+
113+
<AvailableSince version="10" />
114+
115+
```markdown {tabTitle:Basic Usage}
116+
<AvailableSince version="10.17.0" />
117+
```
118+
119+
Attributes:
120+
121+
- `version` (string) - required, the version number (e.g., "10", "8.5.0")
122+
123+
**When to use:**
124+
125+
- Use `AvailableSince` to indicate when a feature or option first became available
126+
- For prominent minimum version requirements, use the [`VersionRequirement`](#versionrequirement) component instead
127+
128+
**Examples in the wild:**
129+
130+
The `AvailableSince` component is automatically used within:
131+
- `SdkOption` component for configuration options
132+
- `SdkApi` component for API methods
133+
134+
You can also use it directly in MDX content to indicate availability for features or entire sections.
135+
109136
## Expandable
110137

111138
Render an expandable section to provide additional information to users on demand.

docs/platforms/javascript/common/opentelemetry/custom-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ If you want to add your own http/node-fetch instrumentation, you have to follow
100100

101101
### Custom HTTP Instrumentation
102102

103-
_Available since SDK version 8.35.0_
103+
<AvailableSince version="8.35.0" />
104104

105105
You can add your own `@opentelemetry/instrumentation-http` instance in your OpenTelemetry setup. However, in this case, you need to disable span creation in Sentry's `httpIntegration`:
106106

docs/platforms/javascript/common/tracing/instrumentation/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ To add spans that aren't active, you can create independent spans. This is usefu
109109

110110
### Setting an inactive span active (browser only)
111111

112-
_Available Since: `10.15.0`_
112+
<AvailableSince version="10.15.0" />
113113

114114
In browser environments, you might run into use cases, where the callback-based span APIs are not sufficient.
115115
In such cases (see example below), you can use `startInactiveSpan` to start an initially inactive span and then
@@ -231,7 +231,7 @@ Sentry maintains a [list of well-known span operations](https://develop.sentry.d
231231

232232
### Updating the Span Name
233233

234-
_Available since: v8.47.0_
234+
<AvailableSince version="8.47.0" />
235235

236236
You can update the name of a span at any time:
237237

docs/platforms/javascript/guides/nestjs/features/sentry-cron-decorator.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: SentryCron Decorator
33
description: "Learn about Sentry's SentryCron decorator."
44
---
55

6-
<Alert>
7-
The `@SentryCron` decorator is available from version `@sentry/nestjs` 8.16.0 and up.
8-
</Alert>
6+
<AvailableSince version="8.16.0" />
97

108
The NestJS SDK includes a `@SentryCron` decorator that can be used to augment the native NestJS `@Cron` decorator to
119
send check-ins to Sentry before and after each cron job run.

docs/platforms/javascript/guides/nestjs/features/sentry-traced-decorator.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: SentryTraced Decorator
33
description: "Learn about Sentry's SentryTraced decorator."
44
---
55

6-
<Alert>
7-
The `@SentryTraced` decorator is available from version `@sentry/nestjs` 8.15.0 and up.
8-
</Alert>
6+
<AvailableSince version="8.15.0" />
97

108
The NestJS SDK includes a `@SentryTraced` decorator that will create spans whenever the method it decorates is invoked.
119
This feature enables more granular performance monitoring and helps you gather detailed insights into the performance

docs/platforms/javascript/guides/nuxt/features/nitro-server-features.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ The Sentry Nuxt SDK automatically instruments various Nitro server APIs to provi
77

88
## Server Middleware
99

10-
<Alert>Available from version `@sentry/nuxt` 10.17.0 and up.</Alert>
10+
<AvailableSince version="10.17.0" />
1111

1212
The Sentry Nuxt SDK automatically instruments [server middleware handlers](https://nuxt.com/docs/4.x/guide/directory-structure/server#server-middleware) in addition to server event handlers. This includes the handler functions and their `onBeforeResponse` and `onRequest` callbacks.
1313

1414
## Cache
1515

16-
<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>
16+
<AvailableSince version="10.21.0" />
1717

1818
The Sentry Nuxt SDK automatically instruments [cache APIs](https://nitro.build/guide/cache) for the following Nitro functions:
1919

@@ -25,15 +25,15 @@ This provides spans in your transactions that represent cache operations and the
2525

2626
## Storage
2727

28-
<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>
28+
<AvailableSince version="10.21.0" />
2929

3030
The Sentry Nuxt SDK automatically instruments [storage APIs](https://nuxt.com/docs/4.x/guide/directory-structure/server#server-storage) (also known as KV storage) and common operations.
3131

3232
Keep in mind that only the storage mounts configured under `nitro.storage` in your `nuxt.config.ts` will be instrumented. Storage spans will show up in a similar way to [cache](#cache) spans since they both utilize the same underlying Nitro storage API.
3333

3434
## Database
3535

36-
<Alert>Available from version `@sentry/nuxt` 10.21.0 and up.</Alert>
36+
<AvailableSince version="10.21.0" />
3737

3838
The Sentry Nuxt SDK automatically instruments Nitro's [database API](https://nitro.build/guide/database). This provides spans in your transactions that represent database query operations and their durations, enabling you to identify slow queries, track query frequency, and optimize your database interactions.
3939

docs/platforms/kotlin/guides/kotlin-multiplatform/configuration/options.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ If you are using Sentry in your mobile app, read our [frequently asked questions
3434

3535
<Alert>
3636

37-
This options is available since SDK version `0.13.0`
37+
<AvailableSince version="0.13.0" />
3838

3939
</Alert>
4040

platform-includes/distributed-tracing/custom-instrumentation/javascript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The two services are now connected with your custom distributed tracing implemen
4040

4141
### Starting a New Trace
4242

43-
Available since SDK version `8.5.0`.
43+
<AvailableSince version="8.5.0" />
4444

4545
In case the SDK's [default behavior](../#trace-duration) for the trace duration does not fit your needs, you can manually start a new trace that will no longer be connected to the current (distributed) trace.
4646
This means that spans or errors collected by the SDK during this new trace will not be connected to spans or errors collected before or after this new trace.

platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ If your app crashes while a user is uploading a photo, you can trace exactly whe
7373

7474
### Strict Trace Continuation
7575

76-
_Available since SDK version 10_
76+
<AvailableSince version="10" />_
7777

7878
When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
7979
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,

platform-includes/distributed-tracing/how-to-use/javascript.node.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ If your app crashes while a user is uploading a photo, you can trace exactly whe
6464

6565
### Strict Trace Continuation
6666

67-
_Available since SDK version 10_
67+
<AvailableSince version="10" />
6868

6969
When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry.
7070
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service,

0 commit comments

Comments
 (0)