Skip to content

Commit 3b3400c

Browse files
committed
review suggestions
1 parent 8f9b036 commit 3b3400c

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

docs/platforms/javascript/guides/nuxt/install/cli-import.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ description: "Learn how to use the node --import CLI flag."
66

77
## Understanding the `--import` CLI Flag
88

9-
The [`--import` CLI flag](https://nodejs.org/api/cli.html#--importmodule) in Node is the default way in ESM to preload a module before the application starts.
10-
Setting this flag is crucial for ensuring proper server-side initialization, as Sentry needs to be initialized before
11-
Node.js resolves the entire import graph of your application. This is necessary for enabling proper instrumentation of ESM module
9+
The [`--import` CLI flag](https://nodejs.org/api/cli.html#--importmodule) in Node is the default way in ESM to preload a specified module at startup.
10+
Setting this CLI flag is crucial for ensuring proper server-side initialization, as Sentry needs to be initialized before the application runs.
11+
This will register Sentry's [loader hook](https://nodejs.org/api/module.html#customization-hooks) and therefore enable proper instrumentation of ESM modules.
1212

1313
## Scenarios where `--import` does not work
1414

15-
- You're not able to add Node CLI flags or environment variables scoped to the function runtime, meaning these variables are not applied in other scopes, such as build time.
15+
- You're unable to add Node CLI flags or environment variables scoped to the function runtime, meaning these variables aren't applied in other scopes, such as build time.
1616
- You don't know the path to the Nuxt server folder in the build output
17-
- On **Netlify**, it is as of now not possible to configure `--import` properly.
18-
- On **Vercel**, it is as of now not possible to configure `--import` properly.
17+
- At this time, it isn't possible to properly configure `--import` in **Netlify**.
18+
- At this time, it isn't possible to properly configure `--import` in **Vercel**.
1919

2020
If any of those points apply to you, you cannot use the `--import` flag to initialize Sentry on the server-side.
2121
Check out the guide for using <PlatformLink to="/install/limited-server-tracing">limited server tracing</PlatformLink> instead.

docs/platforms/javascript/guides/nuxt/install/dynamic-import.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ description: "Learn about how the Nuxt SDK leverages dynamic input() in the buil
77
## Understanding the `import()` expression
88

99
<Alert level='warning'>
10-
This installation method does not work with more recent versions of Nuxt/Nitro.
10+
This installation method doesn't work with more recent versions of Nuxt/Nitro.
1111

12-
We recommend the guide for installing the SDK with the <PlatformLink to="/install/cli-import">CLI flag `--import`</PlatformLink> or <PlatformLink to="/install/limited-server-tracing">limited server tracing</PlatformLink>
12+
We recommend reading the guide for installing the SDK with the <PlatformLink to="/install/cli-import">CLI flag `--import`</PlatformLink> or <PlatformLink to="/install/limited-server-tracing">limited server tracing</PlatformLink>
1313
</Alert>
1414

1515
The `import()` expression, or dynamic import, enables flexible, conditional module loading in ESM.
16-
For the Sentry Nuxt SDK, it provides an approach to initialize server-side Sentry configuration before application startup.
16+
Node.js will generate a separate module graph for any code wrapped in a dynamic `import()`. This separate graph is evaluated **after** all modules, which are statically `import`ed.
1717

18-
The Sentry Nuxt SDK will be initialized before any other code runs and the Nitro server runtime code will be loaded later because of `import()`ing it.
19-
This early initialization is required to set up the SDK's instrumentation of various libraries correctly.
18+
By using the Sentry Nuxt SDK, the server-side application will be wrapped in a dynamic `import()`, while the Sentry configuration will be imported with a static `import`.
19+
This makes it possible to initialize the Sentry Nuxt SDK at startup, while the Nitro server runtime loads later because it is `import()`ed.
20+
This early initialization of Sentry is required to correctly set up the SDK's instrumentation of various libraries.
2021

2122
## Scenarios where `import()` doesn't work
2223

@@ -61,8 +62,8 @@ export default defineNuxtConfig({
6162
})
6263
```
6364

64-
After setting this, the Sentry Nuxt SDK adds some build-time configuration to ensure your app is wrapped with `import()`.
65-
With this, Sentry can be initialized before all other modules of the application.
65+
After setting this, the Sentry Nuxt SDK will add build-time configuration so that your app will be wrapped with `import()`,
66+
ensuring that Sentry can be initialized before any other modules.
6667

6768
The Nuxt server entry file will look something like this:
6869

docs/platforms/javascript/guides/nuxt/install/limited-server-tracing.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
title: Limited Server Tracing
33
sidebar_order: 2
4-
description: "Learn about how the Nuxt SDK can be set up with limited server tracing by adding a top-level import to the build output."
4+
description: "Learn how to set up the Nuxt SDK with limited server tracing by adding a top-level import to the build output."
55
---
66

77
## Understanding Limited Server Tracing
88

9-
Sentry needs to be initialized before the import graph is resolved by Node.
10-
If the default way of adding an <PlatformLink to="/install/cli-import">`--import` CLI flag</PlatformLink> flag does not work for you,
11-
set up the SDK for adding a top-level `import`.
9+
Sentry needs to be initialized before the rest of the application runs.
10+
If the default way of adding an <PlatformLink to="/install/cli-import">`--import` CLI flag</PlatformLink> doesn't work for you,
11+
enable the SDK to add a top-level `import`.
1212

13-
The automatically added top-level `import` will import the Sentry server-side config at the top of the Nuxt server entry file.
13+
The automatically added top-level `import` will then import the Sentry server-side config at the top of the Nuxt server entry file.
1414
In this case, Sentry isn’t initialized before the app starts, but is set up as early as possible.
1515

1616
<Alert level='warning' title='Restrictions of this installation method'>
@@ -34,4 +34,4 @@ export default defineNuxtConfig({
3434
```
3535

3636
By default, the SDK will add the Sentry server config to the build output (typically, `.output/server/sentry.server.config.mjs`).
37-
The SDK then automatically imports this file at the top of the Nitro server entry in the build output.
37+
The SDK will then automatically import this file to the top of the Nitro server entry in the build output.

platform-includes/getting-started-verify/javascript.nuxt.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ If you want to test server-side monitoring locally, build your project and run:
2121
```
2222

2323
<Alert level="warning">
24-
Sentry server-side monitoring **does not work in development mode!**
24+
Sentry server-side monitoring **doesn't work in development mode!**
2525

26-
In case you experience any issues with the server-side setup, check out <PlatformLink to="/troubleshooting">Troubleshooting</PlatformLink>
26+
If you experience any issues with the server-side setup, check out <PlatformLink to="/troubleshooting">Troubleshooting</PlatformLink>
2727
or read through the different <PlatformLink to="/install">installation methods</PlatformLink>.
2828
</Alert>
2929

0 commit comments

Comments
 (0)