Skip to content

Commit bc2f8f9

Browse files
Lms24coolguyzone
andauthored
Apply suggestions from code review
Co-authored-by: Alex Krawiec <[email protected]>
1 parent 167dd98 commit bc2f8f9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/platforms/javascript/common/best-practices/web-workers.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ self.onmessage = (event) => {
6868

6969
<Alert level="warning" title="The Order Matters">
7070

71-
Ensure that in both, your main thread code as well as the worker, you set up Sentry before you start listening to messages.
71+
Make sure to initialize Sentry in both the main thread and the worker before either starts listening for messages.
7272
The Sentry SDK sends messages from the worker to the main thread, so if you start listening before Sentry is initialized,
73-
the messages will appear in your listeners and you have to handle them manually.
73+
the messages will appear in your listeners and you will have to handle them manually.
7474

7575
</Alert>
7676

7777
### Multiple Workers
7878

79-
The `sentryWebWorkerIntegration` supports registering multiple workers.
80-
You can add them directly, when you initialize the integration, or later on.
79+
The `sentryWebWorkerIntegration` allows you to register multiple workers.
80+
You can add them either when you initialize the integration, or later on.
8181
This is helpful, if you have workers that are initialized at different points in time in your application lifecycle.
8282

8383
```javascript {filename:index.js} {1-5, 10-14, 18}
@@ -142,7 +142,7 @@ Likewise, don't use the `Sentry.registerWorker` in the worker. Both methods are
142142
### Integrations
143143

144144
Note, that if you use non-default integrations inside web workers, they may not function as expected.
145-
However, non-default integrations that are enabled on the main thread SDK, won't be affected and will work as expected.
145+
However, non-default integrations that are enabled on the main thread SDK won't be affected and will work as expected.
146146
This includes Session Replay.
147147

148148
## Source Maps

docs/platforms/javascript/common/configuration/integrations/webworker.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ notSupported:
2121

2222
_Import name: `Sentry.webWorkerIntegration`_
2323

24-
This integration, together with `Sentry.registerWorker()`, establishes communication between the browser's main thread and one or multiple [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)s.
24+
This integration, together with `Sentry.registerWorker()`, establishes communication between the browser's main thread and one or more [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
2525
It listens to worker messages from the passed workers and forwards them to the main thread.
2626

2727
Read our <PlatformLink to="/best-practices/web-workers/">Web Worker Guide</PlatformLink> for more information.
2828

2929
<Expandable title="What does this integration do?">
3030

31-
This integration listens to a message, sent from the worker when it calls `Sentry.registerWorker({ self })`.
31+
This integration listens to a message sent from the worker when it calls `Sentry.registerWorker({ self })`.
3232
The purpose is to sync source map information (debugIds) between the main thread and the worker so that worker
3333
errors caught by the main thread SDK are properly mapped to the worker's source code.
3434

0 commit comments

Comments
 (0)