Skip to content

Commit e9f0629

Browse files
committed
ref(replay): Mark all methods & properties as public/private
1 parent 9ec436b commit e9f0629

11 files changed

+228
-284
lines changed

packages/replay/.eslintrc.js

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ module.exports = {
2323
{
2424
files: ['*.ts', '*.tsx', '*.d.ts'],
2525
rules: {
26-
// TODO (high-prio): Re-enable this after migration
27-
'@typescript-eslint/explicit-member-accessibility': 'off',
2826
// Since we target only es6 here, we can leave this off
2927
'@sentry-internal/sdk/no-async-await': 'off',
3028
},

packages/replay/src/integration.ts

+21-21
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export class Replay implements Integration {
3535
/**
3636
* Options to pass to `rrweb.record()`
3737
*/
38-
readonly recordingOptions: RecordingOptions;
38+
private readonly _recordingOptions: RecordingOptions;
3939

40-
readonly options: ReplayPluginOptions;
40+
private readonly _options: ReplayPluginOptions;
4141

4242
private _replay?: ReplayContainer;
4343

44-
constructor({
44+
public constructor({
4545
flushMinDelay = DEFAULT_FLUSH_MIN_DELAY,
4646
flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY,
4747
initialFlushDelay = INITIAL_FLUSH_DELAY,
@@ -58,19 +58,19 @@ export class Replay implements Integration {
5858
ignoreClass = 'sentry-ignore',
5959
maskTextClass = 'sentry-mask',
6060
blockSelector = '[data-sentry-block]',
61-
...recordingOptions
61+
..._recordingOptions
6262
}: ReplayConfiguration = {}) {
63-
this.recordingOptions = {
63+
this._recordingOptions = {
6464
maskAllInputs,
6565
blockClass,
6666
ignoreClass,
6767
maskTextClass,
6868
maskTextSelector,
6969
blockSelector,
70-
...recordingOptions,
70+
..._recordingOptions,
7171
};
7272

73-
this.options = {
73+
this._options = {
7474
flushMinDelay,
7575
flushMaxDelay,
7676
stickySession,
@@ -92,7 +92,7 @@ Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options
9292
Sentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`,
9393
);
9494

95-
this.options.sessionSampleRate = sessionSampleRate;
95+
this._options.sessionSampleRate = sessionSampleRate;
9696
}
9797

9898
if (typeof errorSampleRate === 'number') {
@@ -104,22 +104,22 @@ Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options
104104
Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
105105
);
106106

107-
this.options.errorSampleRate = errorSampleRate;
107+
this._options.errorSampleRate = errorSampleRate;
108108
}
109109

110-
if (this.options.maskAllText) {
110+
if (this._options.maskAllText) {
111111
// `maskAllText` is a more user friendly option to configure
112112
// `maskTextSelector`. This means that all nodes will have their text
113113
// content masked.
114-
this.recordingOptions.maskTextSelector = MASK_ALL_TEXT_SELECTOR;
114+
this._recordingOptions.maskTextSelector = MASK_ALL_TEXT_SELECTOR;
115115
}
116116

117-
if (this.options.blockAllMedia) {
117+
if (this._options.blockAllMedia) {
118118
// `blockAllMedia` is a more user friendly option to configure blocking
119119
// embedded media elements
120-
this.recordingOptions.blockSelector = !this.recordingOptions.blockSelector
120+
this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector
121121
? MEDIA_SELECTORS
122-
: `${this.recordingOptions.blockSelector},${MEDIA_SELECTORS}`;
122+
: `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;
123123
}
124124

125125
if (this._isInitialized && isBrowser()) {
@@ -149,7 +149,7 @@ Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
149149
* global event processors to finish. This is no longer needed, but keeping it
150150
* here to avoid any future issues.
151151
*/
152-
setupOnce(): void {
152+
public setupOnce(): void {
153153
if (!isBrowser()) {
154154
return;
155155
}
@@ -166,7 +166,7 @@ Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
166166
* Creates or loads a session, attaches listeners to varying events (DOM,
167167
* PerformanceObserver, Recording, Sentry SDK, etc)
168168
*/
169-
start(): void {
169+
public start(): void {
170170
if (!this._replay) {
171171
return;
172172
}
@@ -178,7 +178,7 @@ Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
178178
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
179179
* does not support a teardown
180180
*/
181-
stop(): void {
181+
public stop(): void {
182182
if (!this._replay) {
183183
return;
184184
}
@@ -192,8 +192,8 @@ Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
192192
this._loadReplayOptionsFromClient();
193193

194194
this._replay = new ReplayContainer({
195-
options: this.options,
196-
recordingOptions: this.recordingOptions,
195+
options: this._options,
196+
recordingOptions: this._recordingOptions,
197197
});
198198
}
199199

@@ -203,11 +203,11 @@ Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
203203
const opt = client && (client.getOptions() as BrowserClientReplayOptions | undefined);
204204

205205
if (opt && typeof opt.replaysSessionSampleRate === 'number') {
206-
this.options.sessionSampleRate = opt.replaysSessionSampleRate;
206+
this._options.sessionSampleRate = opt.replaysSessionSampleRate;
207207
}
208208

209209
if (opt && typeof opt.replaysOnErrorSampleRate === 'number') {
210-
this.options.errorSampleRate = opt.replaysOnErrorSampleRate;
210+
this._options.errorSampleRate = opt.replaysOnErrorSampleRate;
211211
}
212212
}
213213
}

0 commit comments

Comments
 (0)