Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
10fe77f
ref(tracing): Remove references to @sentry/apm (#4845)
AbhiPrasad Apr 7, 2022
f501391
ref(core): Delete `API` class (#4848)
AbhiPrasad Apr 7, 2022
1997ad5
ref(tracing): Delete deprecated `startSpan` and `child` methods (#4849)
AbhiPrasad Apr 7, 2022
5f0d7c2
ref(core): Remove `whitelistUrls`/`blacklistUrls` (#4850)
AbhiPrasad Apr 7, 2022
67bbb65
ref(gatsby): Remove `Sentry` from window (#4857)
AbhiPrasad Apr 7, 2022
c481f55
ref(hub): Remove `getActiveDomain` (#4858)
AbhiPrasad Apr 7, 2022
8ed1e9e
ref(types): Remove deprecated `user` dsn field (#4864)
AbhiPrasad Apr 7, 2022
ba4561c
ref(hub): Remove `setTransaction` scope method (#4865)
AbhiPrasad Apr 7, 2022
ebff719
ref: Drop support for Node 6 (#4851)
AbhiPrasad Apr 7, 2022
5a050ee
ref(tracing): Rename `registerRequestInstrumentation` -> `instrumentO…
AbhiPrasad Apr 7, 2022
bd509d0
fix(test): Increase MongoMemoryServer creation timeout (#4881)
Lms24 Apr 7, 2022
729aced
ref(node): Remove deprecated `frameContextLines` (#4884)
timfish Apr 7, 2022
0604aef
ref(browser): Remove top level eventbuilder exports (#4887)
timfish Apr 7, 2022
fc6aa54
ref(build): Update to TypeScript 3.8.3 (#4895)
lobsterkatie Apr 7, 2022
804640d
ref(bundles): Stop publishing CDN bundles on npm (#4901)
Apr 8, 2022
c64ca5e
ref(types): Delete `RequestSessionStatus` enum (#4889)
AbhiPrasad Apr 8, 2022
d096b02
ref(types): Delete Status enum (#4891)
AbhiPrasad Apr 8, 2022
9b1dfdf
ref(build): Rename `dist` directories to `cjs` (#4900)
Lms24 Apr 8, 2022
7f56b0f
ref(integrations): Remove old `angular`, `ember`, and `vue` integrati…
AbhiPrasad Apr 8, 2022
e6149ad
ref(types): Delete `SessionStatus` enum (#4890)
AbhiPrasad Apr 8, 2022
dcb1bb8
meta: 7.0.0-alpha.0 changelog (#4892)
AbhiPrasad Apr 8, 2022
87e9894
fix(build): Skip flags file when building integration bundles (#4906)
lobsterkatie Apr 9, 2022
bac2d91
fix(dev): Standardize yarn `clean` scripts (#4909)
lobsterkatie Apr 11, 2022
62e7189
chore(dev): Remove redundant `.gitignore` in `utils` package (#4905)
lobsterkatie Apr 11, 2022
53027de
ref(dev): Centralize jest config (#4907)
lobsterkatie Apr 11, 2022
f5a6ca8
release: 7.0.0-alpha.0
getsentry-bot Apr 11, 2022
b42472a
feat(docs): Add migration guide for v7 (#4910)
Apr 11, 2022
075d59b
feat(browser): Add debugging hints to browser integration tests (#4914)
lobsterkatie Apr 11, 2022
07d4ffd
ref(various): Remove usage of deprecated `event.stacktrace` (#4885)
timfish Apr 11, 2022
5d38a7e
chore(dev): Update `jest` and friends (#4897)
lobsterkatie Apr 11, 2022
05292b9
fix(dev): Fix unit test debugging configuration (#4915)
lobsterkatie Apr 12, 2022
a9cc619
ref: Port functionality from `Backend` to `Client` (#4911)
Lms24 Apr 12, 2022
43cb4a1
feat(docs): Add section for renaming of CDN bundles (#4918)
Apr 12, 2022
ea09e78
ref(backend): Delete `Backend` classes (#4919)
Lms24 Apr 12, 2022
2ffd78c
fix(wasm): Ensure wasm bundle exists before running wasm tests (#4916)
lobsterkatie Apr 12, 2022
6f09dd7
feat: Expose configurable stack parser (#4902)
timfish Apr 12, 2022
08f50c8
ref(browser): Remove stack parser support for Opera pre v15 (#4923)
timfish Apr 12, 2022
052263b
ref(tracing): Update `setMeasurements` to only set a single measureme…
Apr 13, 2022
b35fed9
feat(tracing): Make `setMeasurement` public API (#4933)
Apr 13, 2022
254e40e
ref(types): Stop using `Severity` enum (#4926)
lobsterkatie Apr 14, 2022
e214325
ref(build): Turn on `isolatedModules` TS option (#4896)
lobsterkatie Apr 14, 2022
3c7faf9
chore(types): Update `@types/jest` (#4929)
lobsterkatie Apr 14, 2022
fa34914
ref: Inject Transports into Client (#4921)
Lms24 Apr 14, 2022
b7c2494
feat(docs): Add `Backend` removal and `Transport` injection to migrat…
Lms24 Apr 14, 2022
b15912a
feat(docs): Add enum removal and deprecation section to migration doc…
Lms24 Apr 14, 2022
ec5ebe9
feat: Add `name` field to `EventProcessor` (#4932)
Apr 14, 2022
362375c
meta: 7.0.0-alpha.1 changelog (#4939)
AbhiPrasad Apr 14, 2022
23f8d6e
release: 7.0.0-alpha.1
getsentry-bot Apr 14, 2022
e5f26a5
chore(gatsby): Create type declarations for gatsby plugin files (#4928)
lobsterkatie Apr 14, 2022
92bf5d3
chore(dev): Remove `tslint` (#4940)
AbhiPrasad Apr 14, 2022
e816c34
ref(test): Switch to `mongodb-memory-server-global` (#4872)
onurtemizkan Apr 14, 2022
9cf57fd
fix(tests): Use non-delayed success endpoints to test `crashed` and `…
onurtemizkan Apr 14, 2022
9f3253d
ref(utils): Remove `forget` async utility function (#4941)
Lms24 Apr 14, 2022
1660047
feat(tracing): Add GB unit to device memory tag value (#4935)
dashed Apr 14, 2022
3f43c39
fix(build): Cache gatsby plugin types files in CI (#4944)
lobsterkatie Apr 14, 2022
d62c758
fix(tests): Fix type errors in tests (#4908)
lobsterkatie Apr 14, 2022
0d811bd
ref(node): Remove `raven-node` backward-compat code (#4942)
AbhiPrasad Apr 18, 2022
fe845d9
ref(build): Split up rollup config code (#4950)
lobsterkatie Apr 19, 2022
34d4ddb
ref(tests): Suppress unconstructive listener and open handle warnings…
onurtemizkan Apr 19, 2022
5ed6066
feat(core): Introduce separate client options (#4927)
AbhiPrasad Apr 19, 2022
1cc0e8a
fix(dev): Check out correct commit in manual GHA `Build & Test` workf…
lobsterkatie Apr 20, 2022
1b32e54
ref(core): Simplify the setup logic of integrations (#4952)
Apr 20, 2022
03d978a
ref(build): Rename CDN bundles to be es6 per default (#4958)
Apr 21, 2022
67cb07a
fix(angular): Use Angular compiler to compile @sentry/angular (#4641)
Lms24 Apr 21, 2022
4581faa
doc(angular): Add Angular migration instructions to migration doc (#4…
Lms24 Apr 21, 2022
deac0eb
ref: Enforce `stackParser` through options. (#4953)
AbhiPrasad Apr 21, 2022
c2ebd42
feat(tracing): Add Prisma ORM integration. (#4931)
onurtemizkan Apr 21, 2022
ec384db
meta(gha): Deploy action `enforce-license-compliance.yml` (#4961)
chadwhitacre Apr 21, 2022
df555d1
fix(dev): Correctly lint `scripts` typescript files (#4963)
lobsterkatie Apr 21, 2022
18257b1
feat(angular): Log warning if SDK is used with an older Angular versi…
Lms24 Apr 22, 2022
b5abe03
ref: Switch to new transports (#4943)
AbhiPrasad Apr 25, 2022
4a35b8d
chore(dev): Update `caniuse-lite` (#4975)
lobsterkatie Apr 26, 2022
8d52e14
chore(dev): Update `ts-node` to 10.7 (#4976)
lobsterkatie Apr 26, 2022
84555ac
fix(build): Replace `git.io` links with redirect targets (#4986)
asottile-sentry Apr 26, 2022
e6a51cb
fix(tracing): Adjust `sideEffects` package.json entry for v7 (#4987)
Lms24 Apr 26, 2022
a8591ea
ref: Delete old transports (#4967)
AbhiPrasad Apr 26, 2022
e0374a3
ref(minimal): Delete `@sentry/minimal` (#4971)
AbhiPrasad Apr 26, 2022
5037d76
fix(nextjs): Fix missing types build in `install-sentry-from-branch` …
kamilogorek Apr 26, 2022
299aeb3
ref: Delete store endpoint code (#4969)
AbhiPrasad Apr 26, 2022
a5c3808
fix(dev): Fix linting for top-level `scripts` folder (#4977)
lobsterkatie Apr 27, 2022
4176bcb
chore: set ignoreSentryErrors to true (#4994)
vladanpaunovic Apr 27, 2022
4ca2de2
ref(tests): Move top-level jest config to `jest` folder (#4978)
lobsterkatie Apr 27, 2022
87cf8c5
fix(tests): Silence dummy output in tests (#4979)
lobsterkatie Apr 27, 2022
8145ce9
ref(nextjs): Update webpack-plugin and change how cli binary is detec…
AbhiPrasad Apr 27, 2022
a71cfb9
fix(dev): Remove eslint cache when cleaning repo (#4980)
lobsterkatie Apr 27, 2022
e86fa94
ref(core): Delete API Details (#4999)
AbhiPrasad Apr 27, 2022
3a512bc
feat(dev): Add VSCode debugger config for ts-node scripts (#4990)
lobsterkatie Apr 27, 2022
7856952
ref: Add argument-less overload to `resolvedSyncPromise` (#5000)
Apr 27, 2022
d619372
fix(hub): Add missing parameter to `captureException` docstring (#5001)
lobsterkatie Apr 27, 2022
c55003f
chore(build): Remove unnecessary `esModuleInterop` settings (#4991)
lobsterkatie Apr 27, 2022
69028bf
ref: Remove unneeded logic from transports (#5002)
Apr 28, 2022
9e46944
ref(build): Switch tsconfig `target` to es6 (#5005)
lobsterkatie Apr 28, 2022
7f04d33
feat(build): Add sucrase build foundations (#4992)
lobsterkatie Apr 28, 2022
aefa9b1
ref: Refactor transport, request, and client report types (#5007)
Apr 28, 2022
ebc938a
fix(serverless): Adjust v6 Lambda layer hotfix for v7 (#5006)
Lms24 Apr 28, 2022
de2822b
feat(transport): Add client report hook to `makeTransport` (#5008)
Apr 28, 2022
389f4ee
ref(browser): Remove showReportDialog on browser client (#4973)
AbhiPrasad Apr 28, 2022
b3fddcd
feat(hub): Remove _invokeClient (#4972)
AbhiPrasad Apr 28, 2022
f979104
docs(transports): Update Migration document with custom Transport cha…
Lms24 Apr 28, 2022
1c5bff0
ref(core): Make event processing logs warnings (#5010)
AbhiPrasad Apr 28, 2022
031ffa7
docs(core): Improve documentation of `Options` and `ClientOptions` pr…
Lms24 Apr 29, 2022
dd1fb29
ref: Record dropped events in `BaseClient` (#5017)
Apr 29, 2022
b450538
ref: Add back client reporting to `BrowserClient` (#5018)
Apr 29, 2022
e16a699
test(tracing): Add Prisma ORM integration tests. (#4962)
onurtemizkan Apr 29, 2022
f18a938
fix(gatsby): Add script to ensure types files exist when testing (#5020)
lobsterkatie Apr 29, 2022
69e6275
fix(build): Fix temporary sucrase CI jobs (#5021)
lobsterkatie Apr 29, 2022
1130c1c
feat(build): Add various rollup plugins to sucrase build (#4993)
lobsterkatie Apr 30, 2022
16356cb
fix(tests): Add `const`-to-`var` ts-jest transformer (#5022)
lobsterkatie May 2, 2022
2df499b
ref: Make it easier to use stackParser (#5015)
AbhiPrasad May 3, 2022
d8fc94c
test(utils): Remove usage of testOnlyIfNodeVersionAtLeast(8) (#5025)
AbhiPrasad May 3, 2022
00c00fa
ref(browser): Don't use Breadcrumbs integration in send event flow (#…
May 3, 2022
39553b5
ref: Remove unused `_sendEvent` method in base client (#5026)
May 3, 2022
c9e8997
meta: 7.0.0-beta.0 CHANGELOG (#5011)
AbhiPrasad May 3, 2022
3532b33
feat: Export browser integrations individually (#5028)
AbhiPrasad May 3, 2022
50361b6
release: 7.0.0-beta.0
getsentry-bot May 3, 2022
add82b4
Merge branch 'release/7.0.0-beta.0' into 7.x
May 4, 2022
1b924e7
chore(browser): Rename `UserAgent` integration to `HttpContext` (#5027)
Lms24 May 4, 2022
794f65b
fix(browser): Change `UserAgent` export to `HttpContext` (#5033)
Lms24 May 4, 2022
6496a11
ref: Remove `critical` severity (#5032)
May 4, 2022
9782d69
ref: Delete unneeded `SDK_NAME` (#5040)
May 5, 2022
419416a
docs(migration): Add TLDR to v7 migration docs (#5041)
May 5, 2022
1e210fe
chore: update sentry logo in readme files (#5045)
mattjohnsonpint May 5, 2022
c9e3602
fix(tracing): Remove `isInstanceOf` check in Hub constructor (#5046)
Lms24 May 6, 2022
8b16378
ref(tracing): Reset IdleTimeout based on activities count (#5044)
AbhiPrasad May 6, 2022
8d475b1
ref(utils): Clean up dangerous type casts in object helper file (#5047)
May 9, 2022
5bd31ac
chore: Add NextJS cli fix to changelog (#5055)
AbhiPrasad May 9, 2022
8d36f0b
ref(utils): Add logic to enable skipping of normalization (#5052)
May 9, 2022
19a9d00
feat(build): Vendor polyfills injected during build (#5051)
lobsterkatie May 9, 2022
904b2d3
fix(integrations): Mark ExtraErrorData as already normalized (#5053)
May 9, 2022
cb9260f
feat(build): Add polyfill-extraction rollup plugin (#5023)
lobsterkatie May 10, 2022
1342c42
ref(node): Explicitly pass down node transport options (#5057)
AbhiPrasad May 10, 2022
52af0b1
ref(browser): Unify BrowserTransportOptions (#5058)
AbhiPrasad May 10, 2022
94554b3
ref(nextjs): Use new build process in vercel script (#5065)
lobsterkatie May 10, 2022
f715933
ref(build): Use rollup/sucrase for non-watch npm builds (#5035)
lobsterkatie May 10, 2022
529650c
chore(build): Handle npm tarballs (#5067)
lobsterkatie May 10, 2022
73ee42b
fix yarn.lock
lobsterkatie May 11, 2022
46400ff
chore(dev): Update `caniuse-lite` (#5069)
lobsterkatie May 11, 2022
5beee11
fix(utils): Consider 429 responses in transports (#5062)
May 11, 2022
656d7c4
ref(hub): Convert `Session` class to object and functions (#5054)
Lms24 May 11, 2022
8c185db
fix(build): Fix references to `rollup.bundle.config.js` (#5074)
lobsterkatie May 11, 2022
7bf6540
fix(tests): Fix node integration test linting and type errors (#5070)
lobsterkatie May 11, 2022
6536eb6
chore(docs): Fix unresolved rebase conflict in Migration.MD (#5076)
Lms24 May 11, 2022
cd71864
feat(react): Add react-router-v6 integration (#5042)
onurtemizkan May 11, 2022
7723d32
ref(build): Use sucrase for `watch` npm builds (#5059)
lobsterkatie May 11, 2022
6b3ea05
ref(build): Improve logging in prepack scripts (#5071)
lobsterkatie May 11, 2022
c8d9905
ref(build): Remove `es5`, `cjs`, and `esm` build commands (#5073)
lobsterkatie May 11, 2022
23982cf
chore(dev): Remove redundant `prepublishOnly` build step in CI (#5083)
lobsterkatie May 12, 2022
e5bfbaa
feat(dev): Add default Node version for CI jobs (#5081)
lobsterkatie May 12, 2022
d9722dc
ref(dev): Use `lerna exec` for top-level `link:yarn` yarn script (#5084)
lobsterkatie May 12, 2022
e39b3f6
feat(build): Add args and templates to rollup debugger plugin (#5085)
lobsterkatie May 12, 2022
042e96e
fix(types): Make `@sentry/types` a runtime dependency in gatsby and n…
lobsterkatie May 12, 2022
f4a1840
ref(utils): Remove `Object.setPrototypeOf` polyfill (#5087)
lobsterkatie May 12, 2022
1badac1
ref(node): Improve Node manual test logging (#5088)
lobsterkatie May 12, 2022
28c09ad
ref(core): Log warning on NOK transport response (#5091)
May 12, 2022
845346a
fix(dev): Restrict size check action to PRs (#5082)
lobsterkatie May 12, 2022
10bca50
meta: 7.0.0-beta.1 changelog (#5092)
AbhiPrasad May 12, 2022
30a9092
release: 7.0.0-beta.1
getsentry-bot May 12, 2022
472a473
Merge branch 'release/7.0.0-beta.1' into 7.x
May 12, 2022
e0ad5c1
fix(ember): Export sha hashes of injected scripts (#5089)
May 13, 2022
5c34152
ref(serverless): Do not throw on flush error (#5090)
May 13, 2022
8a4039d
ref(serverless): Use GitHub action to zip lambda layer (second try) (…
antonpirker May 13, 2022
25aed4d
ref(serverless): Improve handling of SDK version in GitHub action (#5…
antonpirker May 13, 2022
fa7e3b7
ref(serverless): Correctly exit on failed version extraction during b…
kamilogorek May 13, 2022
ce665e2
ref(build): Run repo-level builds in parallel (#5094)
lobsterkatie May 13, 2022
3534f15
ref(dev): Split up top-level `yarn clean` script (#5095)
lobsterkatie May 13, 2022
cac6312
fix(build): Fix express import in `gcpfunction` (#5097)
lobsterkatie May 13, 2022
98bc01a
ref(dev): Consolidate `.gitignore` files (#5096)
lobsterkatie May 13, 2022
78d7304
add changelog entries (#5102)
lobsterkatie May 13, 2022
6b6e746
fix(build): Narrow scope of build cache in GHA (#5105)
lobsterkatie May 17, 2022
774065f
chore(dev): Clean up main tsconfigs (#5114)
lobsterkatie May 17, 2022
797fe90
fix(build): Strip `eslint-enable` comments in rollup plugin (#5112)
lobsterkatie May 17, 2022
95db446
fix(build): Prevent redundant typechecking (#5115)
lobsterkatie May 17, 2022
66a6b59
ref(build): Use sucrase for es6 bundles (#5111)
lobsterkatie May 17, 2022
33e48ca
chore(tests): Fix react `act` warning in tests (#5113)
lobsterkatie May 17, 2022
0a6b4f2
feat(utils): Introduce Baggage API (#5066)
AbhiPrasad May 17, 2022
888f2b8
chore(build): Move aws lambda build step (#5123)
lobsterkatie May 18, 2022
a917dda
fix(build): Ensure bundle builds have needed dependencies (#5119)
lobsterkatie May 18, 2022
efbd343
docs(migration): Add upgrading information for multiple Sentry packag…
Lms24 May 18, 2022
d478c77
feat(core): Send Baggage in Envelope Header (#5104)
Lms24 May 18, 2022
8d08a8b
Change DSN in Lambda Layer to point to relay running in Lambda Extens…
antonpirker May 18, 2022
457b806
feat: Add attachments API (#5004)
timfish May 18, 2022
152e3c5
feat(ci): Add Node 18 to test matrix (#5049)
AbhiPrasad May 19, 2022
263257f
feat(build): Add rollup config for Node bundles (#5142)
lobsterkatie May 20, 2022
7c71013
feat(build): Allow for multiple bundle entrypoints (#5143)
lobsterkatie May 20, 2022
161d302
feat(build): Add ability to combine package-specific rollup config wi…
lobsterkatie May 20, 2022
18af87d
feat(build): Add option to build only specified bundle variants (#5145)
lobsterkatie May 20, 2022
9759e27
ref: Rename baggage env header to trace (#5128)
AbhiPrasad May 23, 2022
d48711f
feat(tracing): Add empty baggage header propagation to outgoing reque…
Lms24 May 23, 2022
945437a
ref(tracing): Reduce metrics bundle size (#5122)
AbhiPrasad May 23, 2022
5a782c3
Deactivated deployment of Lambda Layer until new Lambda Extension is …
antonpirker May 23, 2022
06930f5
meta: Update 7.0.0-beta.2 CHANGELOG (#5137)
AbhiPrasad May 23, 2022
c146db5
release: 7.0.0-beta.2
getsentry-bot May 23, 2022
2808c6e
Merge branch 'release/7.0.0-beta.2' into 7.x
May 23, 2022
bbc9d3d
fix(browser): Fix memory leak in `addEventListener` instrumentation (…
May 24, 2022
fa5712e
fix(tracing): Don't use `querySelector` when not available (#5160)
May 24, 2022
b0950aa
ref(dev): Improve labeling of checkout step in GHA (#5156)
lobsterkatie May 24, 2022
ef9a5d9
ref(core): Remove unnecessary nested `dropUndefinedKeys` call (#5161)
Lms24 May 25, 2022
7b9747f
ref(core): Actually ensure attachments are added to the envelope (#5159)
timfish May 25, 2022
31595e3
ref(core): Make hint callback argument non-optional (#5141)
timfish May 25, 2022
0ad2971
fix(utils): Fix infinite recursion in `dropUndefinedKeys` (#5163)
May 25, 2022
98c2ccc
ref(core): Test mutation of attachments in hint (#5140)
timfish May 25, 2022
549512d
ref(build): Use rollup to build AWS lambda layer (#5146)
lobsterkatie May 25, 2022
2b36cab
feat(nextjs): Make tracing package treeshakable (#5166)
May 25, 2022
1823003
meta: Update 7.0.0-rc.0 CHANGELOG (#5165)
May 25, 2022
8f0cb52
release: 7.0.0-rc.0
getsentry-bot May 25, 2022
23e04f5
Merge branch 'release/7.0.0-rc.0' into 7.x
May 25, 2022
b0919ef
ref(node): Allow node stack parser to work in browser context (#5135)
timfish May 27, 2022
e80ccdc
meta: 7.0.0 CHANGELOG (#5177)
AbhiPrasad May 30, 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
Prev Previous commit
Next Next commit
ref(minimal): Delete @sentry/minimal (#4971)
Remove the minimal package and `callOnHub`. Instead, call hub methods directly. This gives static typing and bundle size improvements.
  • Loading branch information
AbhiPrasad authored and lobsterkatie committed Apr 26, 2022
commit e0374a3b0e9efc2c5000d9e9e708b63365963a07
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);
}

/**
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);
}
46 changes: 6 additions & 40 deletions packages/hub/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,27 +185,10 @@ export class Hub implements HubInterface {
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
public captureException(exception: any, hint?: EventHint): string {
const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());
let finalHint = hint;

// If there's no explicit hint provided, mimic the same thing that would happen
// in the minimal itself to create a consistent behavior.
// We don't do this in the client, as it's the lowest level API, and doing this,
// would prevent user from having full control over direct calls.
if (!hint) {
let syntheticException: Error;
try {
throw new Error('Sentry syntheticException');
} catch (exception) {
syntheticException = exception as Error;
}
finalHint = {
originalException: exception,
syntheticException,
};
}

this._invokeClient('captureException', exception, {
...finalHint,
originalException: exception,
syntheticException: new Error('Sentry syntheticException'),
...hint,
event_id: eventId,
});
return eventId;
Expand All @@ -221,27 +204,10 @@ export class Hub implements HubInterface {
hint?: EventHint,
): string {
const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());
let finalHint = hint;

// If there's no explicit hint provided, mimic the same thing that would happen
// in the minimal itself to create a consistent behavior.
// We don't do this in the client, as it's the lowest level API, and doing this,
// would prevent user from having full control over direct calls.
if (!hint) {
let syntheticException: Error;
try {
throw new Error(message);
} catch (exception) {
syntheticException = exception as Error;
}
finalHint = {
originalException: message,
syntheticException,
};
}

this._invokeClient('captureMessage', message, level, {
...finalHint,
originalException: message,
syntheticException: new Error(message),
...hint,
event_id: eventId,
});
return eventId;
Expand Down
15 changes: 15 additions & 0 deletions packages/hub/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,18 @@ export { addGlobalEventProcessor, Scope } from './scope';
export { Session } from './session';
export { SessionFlusher } from './sessionflusher';
export { getCurrentHub, getHubFromCarrier, getMainCarrier, Hub, makeMain, setHubOnCarrier } from './hub';
export {
addBreadcrumb,
captureException,
captureEvent,
captureMessage,
configureScope,
startTransaction,
setContext,
setExtra,
setExtras,
setTag,
setTags,
setUser,
withScope,
} from './exports';
Loading