Skip to content

Commit 300d274

Browse files
authored
fix(js): Fix references of registerWorker to registerWebWorker (#14699)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR I incorrectly referred to `Sentry.registerWebWorker` by `Sentry.registerWorker` when reworking our web worker docs in #14395. Closes getsentry/sentry-javascript#17443 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent c36abd5 commit 300d274

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Then, establish communication between the worker and the SDK:
5656
import * as Sentry from "@sentry/browser";
5757

5858
// Call this before posting any message
59-
Sentry.registerWorker({ self })
59+
Sentry.registerWebWorker({ self })
6060

6161
// Errors from `onmessage` callback of `worker.js`
6262
// will be captured automatically.
@@ -101,7 +101,7 @@ webWorkerIntegration.addWorker(worker3);
101101

102102
<Alert level="warning" title="Keep in Mind">
103103

104-
- Every worker must call `Sentry.registerWorker({ self })` to register itself with the SDK.
104+
- Every worker must call `Sentry.registerWebWorker({ self })` to register itself with the SDK.
105105
- Do not call `Sentry.webWorkerIntegration()` multiple times! This will lead to unexpected behavior.
106106

107107
</Alert>
@@ -135,7 +135,7 @@ Other times, if the worker is just part of your application, you likely want to
135135
<Alert level="warning" title="Keep in Mind">
136136

137137
If you initialize the SDK in the worker, don't use the `Sentry.webWorkerIntegration` to register the worker.
138-
Likewise, don't use the `Sentry.registerWorker` in the worker. Both methods are only supposed to be used when relying on the SDK [from the main thread](#recommended-setup).
138+
Likewise, don't use the `Sentry.registerWebWorker` in the worker. Both methods are only supposed to be used when relying on the SDK [from the main thread](#recommended-setup).
139139

140140
</Alert>
141141

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

Lines changed: 4 additions & 4 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 more [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
24+
This integration, together with `Sentry.registerWebWorker()`, 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.registerWebWorker({ 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

@@ -41,12 +41,12 @@ errors caught by the main thread SDK are properly mapped to the worker's source
4141

4242
_Type: `Worker | Array<Worker>`_
4343

44-
The web worker(s) to listen to. Every worker must call `Sentry.registerWorker({ self })` to register itself with the SDK.
44+
The web worker(s) to listen to. Every worker must call `Sentry.registerWebWorker({ self })` to register itself with the SDK.
4545

4646
## Methods
4747

4848
### `addWorker(worker: Worker)`
4949

5050
Adds a worker to the integration, after the integraion was already initialized and added to the SDK.
5151
This is useful if you have workers that are initialized at later point in your application's lifecycle.
52-
Note that every worker must call `Sentry.registerWorker({ self })` to register itself with the SDK.
52+
Note that every worker must call `Sentry.registerWebWorker({ self })` to register itself with the SDK.

0 commit comments

Comments
 (0)