Skip to content

Commit

Permalink
ref: Make "js" codeblocks --> "javascript" (#8911)
Browse files Browse the repository at this point in the history
This was a bit inconsistent, but the majority (800+ instances) of codeblocks were "javascript" vs 40 or so of "js"
  • Loading branch information
billyvg committed Jan 19, 2024
1 parent 61f3f5d commit 18454ed
Show file tree
Hide file tree
Showing 31 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/docs/product/performance/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If you've manually instrumented Sentry, you'll need to make sure that your spans

Here's an example snippet of creating a resource span manually with the SDK.

```js
```javascript
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming
const resources = performance.getEntriesByType("resource");
resources.forEach((entry) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This integration adds data from incoming requests to transaction and error event

Controls what types of data are added to the event:

```js
```javascript
{
cookies: boolean // default: true,
data: boolean // default: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
If you're using our Astro SDK, distributed tracing will work out of the box for the client and server runtimes.
To get around possible [Browser CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, you should define `tracePropagationTargets` on the client-side.

```js
```javascript
// sentry.client.config.js
Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
If you're using the current version of our JavaScript SDK and have enabled the `BrowserTracing` integration, distributed tracing will work out of the box. To get around possible [Browser CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, define your `tracePropagationTargets`.

```js
```javascript
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [new Sentry.BrowserTracing()],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ If you're using the current version of our Next.js SDK, distributed tracing will

For client-side you might have to define `tracePropagationTargets` to get around possible [Browser CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues.

```js
```javascript
// sentry.client.config.js
Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
If you're using the current version of our SvelteKit SDK, distributed tracing will work out of the box for the client and server runtimes. To get around possible [Browser CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, you should define `tracePropagationTargets` for client-side.

```js
```javascript
// hooks.client.js
Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
4 changes: 2 additions & 2 deletions src/platform-includes/distributed-tracing/how-to-use/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ If you're using version `7.58.0` or above of our Node SDK and have the HTTP inte

<SignInNote />

```js
```javascript
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [new Sentry.Integrations.Http({ tracing: true })],
Expand All @@ -11,7 +11,7 @@ Sentry.init({

If you're using Express or an Express-compatible framework, you'll also need to use Sentry middleware:

```js
```javascript
const app = express();

// RequestHandler creates a separate execution context, so that all
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
If you're using the current version of our React Native SDK distributed tracing will work out of the box.

```js
```javascript
Sentry.init({
dsn: "___PUBLIC_DSN___",
tracePropagationTargets: ["https://myproject.org", /^\/api\//],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ There are a few steps necessary in order to ensure that your OpenTelemetry setup

<SignInNote />

```js
```javascript
// Sentry dependencies
const Sentry = require("@sentry/node");
const {
Expand Down Expand Up @@ -75,7 +75,7 @@ You can either create spans via `tracer.startActiveSpan()`,
or use the `startSpan()` / `startInactiveSpan()` methods exported from `@sentry/opentelemetry`,
which are just thin wrappers around the OpenTelemetry API:

```js
```javascript
import { startSpan, startInactiveSpan } from "@sentry/opentelemetry";

startSpan({ name: "my span" }, (span) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
How you do this will depend on your server. If you're using a server like Express, you'll be able to use the [response.set](https://expressjs.com/en/4x/api.html#res.set) function.

```js
```javascript
app.get("/", (request, response) => {
response.set("Document-Policy", "js-profiling");
response.sendFile("index.html");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
In the Electron main process, you can enable injection of this header by setting the `enableRendererProfiling` option to `true`:

```js
```javascript
import * as Sentry from "@sentry/electron/main";

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public throwTestError(): void {

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ setTimeout(() => {

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ setTimeout(() => {

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can verify this by adding the following button to your app and pressing it:

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
2 changes: 1 addition & 1 deletion src/platform-includes/session-replay/setup/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ setTimeout(() => {

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You can verify this by adding the following button to your app and pressing it:

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can verify this by adding the following button to your app and pressing it:

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You can verify this by adding the following button to your app and pressing it:

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can verify this by adding the following button to your app and pressing it:

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You can verify this by adding the following button to your app and pressing it:

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {

Once you've added the integration, Replay will start automatically. If you don't want to start it immediately (lazy-load it), you can use `addIntegration`:

```js
```javascript
Sentry.init({
// Note, Replay is NOT instantiated below:
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_Requires JS SDK version v7.47.0 or higher._

```js
```javascript
import * as Sentry from "@sentry/browser";

const eventId = Sentry.captureMessage("User Feedback");
Expand All @@ -19,7 +19,7 @@ You could also collect feedback and send it when an error occurs via the SDK's `

<SignInNote />

```js
```javascript
Sentry.init({
dsn: '___PUBLIC_DSN___',
beforeSend: event => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ When this happens, the Replay can't capture the response body because the reques

To avoid this, disable this behavior of Apollo Client by configuring your own abort signal:

```js
```javascript
const abortController = new AbortController();

const httpLink = createHttpLink({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ navigation.addEventListener("navigate", (event) => {
When using `replaysOnErrorSampleRate`, we "roll the dice" on any Error that is captured & sent to Sentry.
If you want to skip capturing a Replay for certain errors, you can use the `beforeErrorSampling` callback:

```js
```javascript
new Replay({
beforeErrorSampling: (error) => {
return error.message?.includes("drop me");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_order: 1000

If you see the following error during build time, the sibling SDKs installed in your app have mismatched versions:

```js
```javascript
node_modules/@sentry/types/types/globals.d.ts:2:11 - error TS2451: Cannot redeclare block-scoped variable '__DEBUG_BUILD__'.
```

Expand Down
4 changes: 2 additions & 2 deletions src/platforms/node/common/configuration/async-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: "Learn more about how to isolate Sentry scope and breadcrumbs acros

You can use the `runWithAsyncContext` method to isolate Sentry scope and breadcrumbs to a single request if you are using SDK v7.48.0 or higher. This is useful if you are finding that breadcrumbs and scope are leaking across requests.

```js
```javascript
const Sentry = require("@sentry/node");

function requestHandlerMiddleware(req, res, next) {
Expand All @@ -21,7 +21,7 @@ Under the hood, the SDK uses Node's [AsyncLocalStorage API](https://nodejs.org/a

On lower SDK versions you'll have to use [domains](https://nodejs.org/api/domain.html) to isolate Sentry scope and breadcrumbs to a single request.

```js
```javascript
const domain = require("domain");

function myRequestHandler(req, res, next) {
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/node/guides/express/performance/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ app.listen(3000);

You can also manually create transactions in your app:

```js
```javascript
const Sentry = require("@sentry/node");
const http = require("http");

Expand Down
2 changes: 1 addition & 1 deletion src/platforms/react-native/migration/sentry-expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Sentry.init({

Expo-specific tags are no longer added by default. If you were using them, you can add them manually:

```js
```javascript
import Constants from "expo-constants";
import * as Device from "expo-device";
import * as Updates from "expo-updates";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Transaction names are composed from a combination of displayed screen names, (fo

UI instrumentation tracing is disabled by default, but you can enable it by setting the `enableUserInteractionTracing` options to `true` and wrapping your root component:

```js
```javascript
import * as Sentry from "@sentry/react-native";

Sentry.init({
Expand All @@ -43,7 +43,7 @@ export default Sentry.wrap(App);

The label by which UI elements are identified is set by the `labelName` option in `Sentry.wrap`. If no value is supplied, `sentry-label` will be used instead. If an element can't be identified, the transaction won't be captured.

```js
```javascript
export default Sentry.wrap(App, {
touchEventBoundaryProps: { labelName: "my-label" },
});
Expand All @@ -68,7 +68,7 @@ To create UI transactions from React Native Gesture Handler, you need to wrap in
is supported.
</Note>

```js
```javascript
import React from "react";
import { Gesture, GestureDetector } from "react-native-gesture-handler";
import { sentryTraceGesture } from "@sentry/react-native";
Expand Down
6 changes: 3 additions & 3 deletions src/platforms/react-native/troubleshooting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you use a polyfilling library that patches the global `Promise` instance, you

<SignInNote />

```js
```javascript
import allSettled from "promise.allsettled";

Sentry.init({
Expand Down Expand Up @@ -216,7 +216,7 @@ If your build is failing because of outdated fields in the `react-native.config.

_Old_:

```js
```javascript
module.exports = {
dependency: {
platforms: {
Expand All @@ -239,7 +239,7 @@ module.exports = {

_New_:

```js
```javascript
module.exports = {
dependency: {
platforms: {
Expand Down

1 comment on commit 18454ed

@vercel
Copy link

@vercel vercel bot commented on 18454ed Jan 19, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

sentry-docs – ./

docs.sentry.io
sentry-docs-git-master.sentry.dev
sentry-docs.sentry.dev

Please sign in to comment.