Skip to content

feat: Delete @sentry/minimal #4971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 97 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
378a6cd
[v7] feat: Remove references to @sentry/apm (#4845)
AbhiPrasad Apr 7, 2022
7e50a94
[v7] feat(core): Delete API class (#4848)
AbhiPrasad Apr 7, 2022
d2fe512
[v7] feat: Delete deprecated `startSpan` and `child` methods (#4849)
AbhiPrasad Apr 7, 2022
50395bd
feat(core): Remove whitelistUrls/blacklistUrls (#4850)
AbhiPrasad Apr 7, 2022
b12e864
feat(gatsby): Remove Sentry from window (#4857)
AbhiPrasad Apr 7, 2022
6623d43
feat(hub): Remove getActiveDomain (#4858)
AbhiPrasad Apr 7, 2022
9094492
feat(types): Remove deprecated user dsn field (#4864)
AbhiPrasad Apr 7, 2022
ffb8b16
feat(hub): Remove setTransaction scope method (#4865)
AbhiPrasad Apr 7, 2022
7ea63c7
[v7] feat: Drop support for Node 6 (#4851)
AbhiPrasad Apr 7, 2022
68317c4
[v7] feat(tracing): Rename registerRequestInstrumentation -> instrume…
AbhiPrasad Apr 7, 2022
780512b
fix(test): Increase MongoMemoryServer creation timeout (#4881)
Lms24 Apr 7, 2022
7d3a3bf
[v7] feat(node): Remove deprecated `frameContextLines` (#4884)
timfish Apr 7, 2022
9d29071
[v7] feat(browser): Remove top level eventbuilder exports (#4887)
timfish Apr 7, 2022
cbbc15d
ref(build): Update to TypeScript 3.8.3 (#4895)
lobsterkatie Apr 7, 2022
14bb9ac
build(bundles): Stop publishing CDN bundles on npm (#4901)
lforst Apr 8, 2022
4bb3c64
feat(types): Delete RequestSessionStatus enum (#4889)
AbhiPrasad Apr 8, 2022
2e1eaf3
[v7] feat(types): Delete Status enum (#4891)
AbhiPrasad Apr 8, 2022
899ed58
ref(build): Rename `dist` directories to `cjs` (#4900)
Lms24 Apr 8, 2022
780af57
feat(integrations): Remove old angular, ember, and vue integrations (…
AbhiPrasad Apr 8, 2022
2123da5
feat(types): Delete SessionStatus enum (#4890)
AbhiPrasad Apr 8, 2022
b2f361d
meta: 7.0.0-alpha.0 changelog (#4892)
AbhiPrasad Apr 8, 2022
381183e
fix(build): Skip flags file when building integration bundles (#4906)
lobsterkatie Apr 9, 2022
7fa3e8c
fix(dev): Standardize yarn `clean` scripts (#4909)
lobsterkatie Apr 11, 2022
05504b3
chore(dev): Remove redundant `.gitignore` in `utils` package (#4905)
lobsterkatie Apr 11, 2022
4f0469b
ref(dev): Centralize jest config (#4907)
lobsterkatie Apr 11, 2022
66f63de
release: 7.0.0-alpha.0
getsentry-bot Apr 11, 2022
66727fd
Merge branch 'release/7.0.0-alpha.0' into 7.x
Apr 11, 2022
de739c9
Add migration guide for v7 (#4910)
lforst Apr 11, 2022
144bec3
feat(browser): Add debugging hints to browser integration tests (#4914)
lobsterkatie Apr 11, 2022
2ecf1e5
feat: Remove usage of deprecated `event.stacktrace` (#4885)
timfish Apr 11, 2022
af7abc0
chore(dev): Update `jest` and friends (#4897)
lobsterkatie Apr 11, 2022
f2c8cee
fix(dev): Fix unit test debugging configuration (#4915)
lobsterkatie Apr 12, 2022
7079520
ref(backend): Port functionality from Backend to Client (#4911)
Lms24 Apr 12, 2022
58b9c4e
docs(migration): Add section for renaming of CDN bundles (#4918)
lforst Apr 12, 2022
3f59f9d
ref(backend): Delete Backend classes (#4919)
Lms24 Apr 12, 2022
0f10358
fix(wasm): Ensure wasm bundle exists before running wasm tests (#4916)
lobsterkatie Apr 12, 2022
f3e9384
ref: Expose configurable stack parser (#4902)
timfish Apr 12, 2022
6445db2
feat: Remove stack parser support for Opera pre v15 (#4923)
timfish Apr 12, 2022
20b8c52
ref(measurements): Update `setMeasurements` to only set a single meas…
lforst Apr 13, 2022
b5fd785
ref(measurements): Make `setMeasurement` public API (#4933)
lforst Apr 13, 2022
292075f
ref(types): Stop using `Severity` enum (#4926)
lobsterkatie Apr 14, 2022
5fa71bb
ref(build): Turn on `isolatedModules` TS option (#4896)
lobsterkatie Apr 14, 2022
96d1e05
chore(types): Update `@types/jest` (#4929)
lobsterkatie Apr 14, 2022
71d1aba
ref(client): Inject Transports into Client (#4921)
Lms24 Apr 14, 2022
bf2dc7b
doc(migration): Add `Backend` removal and `Transport` injection to mi…
Lms24 Apr 14, 2022
df32f93
doc(migration): Add enum removal and deprecation section to migration…
Lms24 Apr 14, 2022
d5c1d58
feat(eventprocessors): Add name field to EventProcessor (#4932)
lforst Apr 14, 2022
be9465b
meta: 7.0.0-alpha.1 changelog (#4939)
AbhiPrasad Apr 14, 2022
90c83f1
release: 7.0.0-alpha.1
getsentry-bot Apr 14, 2022
d6c397d
Merge branch 'release/7.0.0-alpha.1' into 7.x
Apr 14, 2022
ffc80e2
chore(gatsby): Create type declarations for gatsby plugin files (#4928)
lobsterkatie Apr 14, 2022
503b798
feat(typescript): Remove tslint (#4940)
AbhiPrasad Apr 14, 2022
2593be0
ref(test): Switch to `mongodb-memory-server-global`. (#4872)
onurtemizkan Apr 14, 2022
961d3af
fix(tests): Use non-delayed success endpoints to test `crashed` and `…
onurtemizkan Apr 14, 2022
0cf5fb5
ref(utils): remove `forget` async utility function (#4941)
Lms24 Apr 14, 2022
f67b1c2
feat(tracing): Add GB unit to device memory tag value (#4935)
dashed Apr 14, 2022
949e90e
fix(build): Cache gatsby plugin types files in CI (#4944)
lobsterkatie Apr 14, 2022
91f2634
fix(tests): Fix type errors in tests (#4908)
lobsterkatie Apr 14, 2022
0b2163b
ref(node): Remove raven-node backward-compat code (#4942)
AbhiPrasad Apr 18, 2022
7e6f7f2
ref(build): Split up rollup config code (#4950)
lobsterkatie Apr 19, 2022
a5ef02c
ref(tests): Suppress unconstructive listener and open handle warnings…
onurtemizkan Apr 19, 2022
6227c7f
feat(core): Introduce seperate client options (#4927)
AbhiPrasad Apr 19, 2022
ff810cb
fix(dev): Check out correct commit in manual GHA `Build & Test` workf…
lobsterkatie Apr 20, 2022
5d74974
ref(baseclient): Simplify the setup logic of integrations (#4952)
lforst Apr 20, 2022
6d7326c
build(bundles): Rename CDN bundles to be es6 per default (#4958)
lforst Apr 21, 2022
45f4320
fix(angular): Use Angular compiler to compile @sentry/angular (#4641)
Lms24 Apr 21, 2022
9b0c759
doc(angular): Add Angular migration instructions to migration doc (#4…
Lms24 Apr 21, 2022
7fb13d7
ref: Enforce stackParser through options. (#4953)
AbhiPrasad Apr 21, 2022
1e0e9d6
feat(tracing): Add Prisma ORM integration. (#4931)
onurtemizkan Apr 21, 2022
8b6c50d
meta(gha): Deploy action enforce-license-compliance.yml (#4961)
chadwhitacre Apr 21, 2022
ac7f186
fix(dev): Correctly lint `scripts` typescript files (#4963)
lobsterkatie Apr 21, 2022
96b37e7
feat(angular): Log warning if SDK is used with an older Angular versi…
Lms24 Apr 22, 2022
6267b54
feat: Switch to new transports (#4943)
AbhiPrasad Apr 25, 2022
c930bf0
port CaptureException
AbhiPrasad Apr 25, 2022
b4b7221
port captureMessage
AbhiPrasad Apr 25, 2022
091524b
port captureEvent
AbhiPrasad Apr 25, 2022
99c9af0
port configureScope
AbhiPrasad Apr 25, 2022
3d3dd2b
port addBreadcrumb
AbhiPrasad Apr 25, 2022
f502374
port setContext
AbhiPrasad Apr 25, 2022
fb505be
port setExtras
AbhiPrasad Apr 25, 2022
79470f0
port setTags
AbhiPrasad Apr 25, 2022
03d08b0
port setExtra
AbhiPrasad Apr 25, 2022
e44b259
port setTag
AbhiPrasad Apr 25, 2022
764be24
port setUser
AbhiPrasad Apr 25, 2022
38eabe3
port withScope
AbhiPrasad Apr 25, 2022
97d161a
delete invokeClient
AbhiPrasad Apr 25, 2022
e9ce479
port startTransaction
AbhiPrasad Apr 25, 2022
596bafc
delete callOnHub
AbhiPrasad Apr 25, 2022
f76d41d
write exports tests
AbhiPrasad Apr 25, 2022
719fa7f
re-org exports
AbhiPrasad Apr 25, 2022
74aed53
delete minimal
AbhiPrasad Apr 25, 2022
fe8e51b
remove minimal from the repo
AbhiPrasad Apr 25, 2022
215d57d
improve synthetic exception in hub
AbhiPrasad Apr 25, 2022
8477f97
add docs about minimal deletion
AbhiPrasad Apr 26, 2022
8d66cba
clean up hub mocks
AbhiPrasad Apr 26, 2022
299e4da
Merge branch '7.x' into v7-abhi-delete-minimal
AbhiPrasad Apr 26, 2022
7a3b90f
add back missing changelog entry
AbhiPrasad Apr 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@

## 7.0.0-alpha.0

- **breaking** feat: Drop support for Node 6 (#4851)
- **breaking** feat: Remove references to @sentry/apm (#4845)
- **breaking** feat: Delete deprecated startSpan and child methods (#4849)
- **breaking** feat(bundles): Stop publishing CDN bundles on npm (#4901)
- **breaking** ref(build): Rename dist directories to cjs (#4900)
- **breaking** ref(build): Update to TypeScript 3.8.3 (#4895)
- **breaking** feat(browser): Remove top level eventbuilder exports (#4887)
- **breaking** feat(core): Delete API class (#4848)
- **breaking** feat(core): Remove whitelistUrls/blacklistUrls (#4850)
- **breaking** feat(gatsby): Remove Sentry from window (#4857)
- **breaking** feat(hub): Remove getActiveDomain (#4858)
- **breaking** feat(hub): Remove setTransaction scope method (#4865)
- **breaking** feat(integrations): Remove old angular, ember, and vue integrations (#4893)
- **breaking** feat(node): Remove deprecated frameContextLines (#4884)
- **breaking** feat(tracing): Rename registerRequestInstrumentation -> instrumentOutgoingRequests (#4859)
- **breaking** feat(types): Remove deprecated user dsn field (#4864)
- **breaking** feat(types): Delete RequestSessionStatus enum (#4889)
- **breaking** feat(types): Delete Status enum (#4891)
- **breaking** feat(types): Delete SessionStatus enum (#4890)
-
- **(breaking)** feat: Drop support for Node 6 (#4851)
- **(breaking)** feat: Remove references to @sentry/apm (#4845)
- **(breaking)** feat: Delete deprecated startSpan and child methods (#4849)
- **(breaking)** feat(bundles): Stop publishing CDN bundles on npm (#4901)
- **(breaking)** ref(build): Rename dist directories to cjs (#4900)
- **(breaking)** ref(build): Update to TypeScript 3.8.3 (#4895)
- **(breaking)** feat(browser): Remove top level eventbuilder exports (#4887)
- **(breaking)** feat(core): Delete API class (#4848)
- **(breaking)** feat(core): Remove whitelistUrls/blacklistUrls (#4850)
- **(breaking)** feat(gatsby): Remove Sentry from window (#4857)
- **(breaking)** feat(hub): Remove getActiveDomain (#4858)
- **(breaking)** feat(hub): Remove setTransaction scope method (#4865)
- **(breaking)** feat(integrations): Remove old angular, ember, and vue integrations (#4893)
- **(breaking)** feat(node): Remove deprecated frameContextLines (#4884)
- **(breaking)** feat(tracing): Rename registerRequestInstrumentation -> instrumentOutgoingRequests (#4859)
- **(breaking)** feat(types): Remove deprecated user dsn field (#4864)
- **(breaking)** feat(types): Delete RequestSessionStatus enum (#4889)
- **(breaking)** feat(types): Delete Status enum (#4891)
- **(breaking)** feat(types): Delete SessionStatus enum (#4890)

## 6.19.7

- fix(react): Add children prop type to ErrorBoundary component (#4966)
Expand Down
22 changes: 22 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,28 @@ Node.js version 6 has reached end of life in April 2019. For Sentry JavaScript S
As far as SDK development goes, dropping support means no longer running integration tests for Node.js version 6, and also no longer handling edge cases specific to version 6.
Running the new SDK version on Node.js v6 is therefore highly discouraged.

## Removal of `@sentry/minimal`

The `@sentry/minimal` package was deleted and it's functionality was moved to `@sentry/hub`. All exports from `@sentry/minimal` should be avaliable in `@sentry/hub` other than `_callOnClient` function which was removed.

```ts
// New in v7:
import {
addBreadcrumb,
captureException,
configureScope,
setTag,
} from '@sentry/hub';

// Before:
import {
addBreadcrumb,
captureException,
configureScope,
setTag,
} from '@sentry/minimal';
```

## Removal Of Old Platform Integrations From `@sentry/integrations` Package

The following classes will be removed from the `@sentry/integrations` package and can no longer be used:
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ below:
extensions for Performance Monitoring / Tracing
- [`@sentry/hub`](https://github.com/getsentry/sentry-javascript/tree/master/packages/hub): Global state management of
SDKs
- [`@sentry/minimal`](https://github.com/getsentry/sentry-javascript/tree/master/packages/minimal): Minimal SDK for
library authors to add Sentry support
- [`@sentry/core`](https://github.com/getsentry/sentry-javascript/tree/master/packages/core): The base for all
JavaScript SDKs with interfaces, type definitions and base classes.
- [`@sentry/utils`](https://github.com/getsentry/sentry-javascript/tree/master/packages/utils): A set of helpers and
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"packages/hub",
"packages/integration-tests",
"packages/integrations",
"packages/minimal",
"packages/nextjs",
"packages/node",
"packages/node-integration-tests",
Expand Down
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
},
"dependencies": {
"@sentry/hub": "7.0.0-alpha.1",
"@sentry/minimal": "7.0.0-alpha.1",
"@sentry/types": "7.0.0-alpha.1",
"@sentry/utils": "7.0.0-alpha.1",
"tslib": "^1.9.3"
Expand Down
10 changes: 8 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ export {
setTags,
setUser,
withScope,
} from '@sentry/minimal';
export { addGlobalEventProcessor, getCurrentHub, getHubFromCarrier, Hub, makeMain, Scope, Session } from '@sentry/hub';
addGlobalEventProcessor,
getCurrentHub,
getHubFromCarrier,
Hub,
makeMain,
Scope,
Session,
} from '@sentry/hub';
export {
getEnvelopeEndpointWithUrlEncodedAuth,
getStoreEndpointWithUrlEncodedAuth,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/mocks/integration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { getCurrentHub } from '@sentry/hub';
import { configureScope } from '@sentry/minimal';
import { configureScope, getCurrentHub } from '@sentry/hub';
import { Event, EventProcessor, Integration } from '@sentry/types';

export class TestIntegration implements Integration {
Expand Down
115 changes: 40 additions & 75 deletions packages/minimal/src/index.ts → packages/hub/src/exports.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { getCurrentHub, Hub, Scope } from '@sentry/hub';
import {
Breadcrumb,
CaptureContext,
Expand All @@ -9,25 +8,19 @@ import {
Primitive,
Severity,
SeverityLevel,
Transaction,
TransactionContext,
User,
} from '@sentry/types';

/**
* This calls a function on the current hub.
* @param method function to call on hub.
* @param args to pass to function.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function callOnHub<T>(method: string, ...args: any[]): T {
const hub = getCurrentHub();
if (hub && hub[method as keyof Hub]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (hub[method as keyof Hub] as any)(...args);
}
throw new Error(`No hub defined or ${method} was not found on the hub, please open a bug report.`);
}
import { getCurrentHub, Hub } from './hub';
import { Scope } from './scope';

// Note: All functions in this file are typed with a return value of `ReturnType<Hub[HUB_FUNCTION]>`,
// where HUB_FUNCTION is some method on the Hub class.
//
// This is done to make sure the top level SDK methods stay in sync with the hub methods.
// Although every method here has an explicit return type, some of them (that map to void returns) do not
// contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable.

/**
* Captures an exception event and sends it to Sentry.
Expand All @@ -36,14 +29,8 @@ function callOnHub<T>(method: string, ...args: any[]): T {
* @returns The generated eventId.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
export function captureException(exception: any, captureContext?: CaptureContext): string {
const syntheticException = new Error('Sentry syntheticException');

return callOnHub('captureException', exception, {
captureContext,
originalException: exception,
syntheticException,
});
export function captureException(exception: any, captureContext?: CaptureContext): ReturnType<Hub['captureException']> {
return getCurrentHub().captureException(exception, { captureContext });
}

/**
Expand All @@ -57,19 +44,12 @@ export function captureMessage(
message: string,
// eslint-disable-next-line deprecation/deprecation
captureContext?: CaptureContext | Severity | SeverityLevel,
): string {
const syntheticException = new Error(message);

): ReturnType<Hub['captureMessage']> {
// This is necessary to provide explicit scopes upgrade, without changing the original
// arity of the `captureMessage(message, level)` method.
const level = typeof captureContext === 'string' ? captureContext : undefined;
const context = typeof captureContext !== 'string' ? { captureContext } : undefined;

return callOnHub('captureMessage', message, level, {
originalException: message,
syntheticException,
...context,
});
return getCurrentHub().captureMessage(message, level, context);
}

/**
Expand All @@ -78,16 +58,16 @@ export function captureMessage(
* @param event The event to send to Sentry.
* @returns The generated eventId.
*/
export function captureEvent(event: Event): string {
return callOnHub('captureEvent', event);
export function captureEvent(event: Event): ReturnType<Hub['captureEvent']> {
return getCurrentHub().captureEvent(event);
}

/**
* Callback to set context information onto the scope.
* @param callback Callback function that receives Scope.
*/
export function configureScope(callback: (scope: Scope) => void): void {
callOnHub<void>('configureScope', callback);
export function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {
getCurrentHub().configureScope(callback);
Copy link
Contributor

Choose a reason for hiding this comment

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

Gotta say I'm not a huge fan of these return types. Imo it would be better to just define the type right here (void in this case) and add a return for good measure, even though it's a void func, but we want these functions to be legit proxies I believe.

I'll let you make the last call on this however.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with the return, but I'd leave the type as is. This way we are 100% sure that they are in sync.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I initially had the return types (see: 3d3dd2b), but I removed because it's unnecessary bundle size (can't minify return). I can add a note about this.

Will add migration docs!

}

/**
Expand All @@ -98,8 +78,8 @@ export function configureScope(callback: (scope: Scope) => void): void {
*
* @param breadcrumb The breadcrumb to record.
*/
export function addBreadcrumb(breadcrumb: Breadcrumb): void {
callOnHub<void>('addBreadcrumb', breadcrumb);
export function addBreadcrumb(breadcrumb: Breadcrumb): ReturnType<Hub['addBreadcrumb']> {
getCurrentHub().addBreadcrumb(breadcrumb);
}

/**
Expand All @@ -108,33 +88,33 @@ export function addBreadcrumb(breadcrumb: Breadcrumb): void {
* @param context Any kind of data. This data will be normalized.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function setContext(name: string, context: { [key: string]: any } | null): void {
callOnHub<void>('setContext', name, context);
export function setContext(name: string, context: { [key: string]: any } | null): ReturnType<Hub['setContext']> {
getCurrentHub().setContext(name, context);
}

/**
* Set an object that will be merged sent as extra data with the event.
* @param extras Extras object to merge into current context.
*/
export function setExtras(extras: Extras): void {
callOnHub<void>('setExtras', extras);
export function setExtras(extras: Extras): ReturnType<Hub['setExtras']> {
getCurrentHub().setExtras(extras);
}

/**
* Set an object that will be merged sent as tags data with the event.
* @param tags Tags context object to merge into current context.
* Set key:value that will be sent as extra data with the event.
* @param key String of extra
* @param extra Any kind of data. This data will be normalized.
*/
export function setTags(tags: { [key: string]: Primitive }): void {
callOnHub<void>('setTags', tags);
export function setExtra(key: string, extra: Extra): ReturnType<Hub['setExtra']> {
getCurrentHub().setExtra(key, extra);
}

/**
* Set key:value that will be sent as extra data with the event.
* @param key String of extra
* @param extra Any kind of data. This data will be normalized.
* Set an object that will be merged sent as tags data with the event.
* @param tags Tags context object to merge into current context.
*/
export function setExtra(key: string, extra: Extra): void {
callOnHub<void>('setExtra', key, extra);
export function setTags(tags: { [key: string]: Primitive }): ReturnType<Hub['setTags']> {
getCurrentHub().setTags(tags);
}

/**
Expand All @@ -145,17 +125,17 @@ export function setExtra(key: string, extra: Extra): void {
* @param key String key of tag
* @param value Value of tag
*/
export function setTag(key: string, value: Primitive): void {
callOnHub<void>('setTag', key, value);
export function setTag(key: string, value: Primitive): ReturnType<Hub['setTag']> {
getCurrentHub().setTag(key, value);
}

/**
* Updates user context information for future events.
*
* @param user User context object to be set in the current context. Pass `null` to unset the user.
*/
export function setUser(user: User | null): void {
callOnHub<void>('setUser', user);
export function setUser(user: User | null): ReturnType<Hub['setUser']> {
getCurrentHub().setUser(user);
}

/**
Expand All @@ -171,23 +151,8 @@ export function setUser(user: User | null): void {
*
* @param callback that will be enclosed into push/popScope.
*/
export function withScope(callback: (scope: Scope) => void): void {
callOnHub<void>('withScope', callback);
}

/**
* Calls a function on the latest client. Use this with caution, it's meant as
* in "internal" helper so we don't need to expose every possible function in
* the shim. It is not guaranteed that the client actually implements the
* function.
*
* @param method The method to call on the client/client.
* @param args Arguments to pass to the client/fontend.
* @hidden
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function _callOnClient(method: string, ...args: any[]): void {
callOnHub<void>('_invokeClient', method, ...args);
export function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']> {
getCurrentHub().withScope(callback);
}

/**
Expand All @@ -210,6 +175,6 @@ export function _callOnClient(method: string, ...args: any[]): void {
export function startTransaction(
context: TransactionContext,
customSamplingContext?: CustomSamplingContext,
): Transaction {
return callOnHub('startTransaction', { ...context }, customSamplingContext);
): ReturnType<Hub['startTransaction']> {
return getCurrentHub().startTransaction({ ...context }, customSamplingContext);
}
Loading