From 542d94fe49c63d89b2a05cf37c9de358f52d51f7 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 11 May 2022 23:22:00 -0700 Subject: [PATCH 01/25] wordsmith utils package readme --- packages/utils/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/utils/README.md b/packages/utils/README.md index b2dac05757dc..a97ff6656f29 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -18,6 +18,6 @@ ## General -Common utilities used by the Sentry JavaScript SDKs. **Warning, only submodule imports are allowed here.** Also note, -this function shouldn't be used externally, we will break them from time to time. This package is not part of our public -API contract, we use them only internally. +Common utilities used by the Sentry JavaScript SDKs. + +Note: This package is only meant to be used internally, and as such is not part of our public API contract and does not follow semver. From b3b5da4439cbe562bb5d7ee2c7f1de5e376e2537 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 11 May 2022 23:23:28 -0700 Subject: [PATCH 02/25] add comment about root dir to central jest config --- jest/jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jest/jest.config.js b/jest/jest.config.js index 3ce4af024a86..3a92f7c81eec 100644 --- a/jest/jest.config.js +++ b/jest/jest.config.js @@ -1,4 +1,5 @@ module.exports = { + // this is the package root, even when tests are being run at the repo level rootDir: process.cwd(), collectCoverage: true, transform: { From 6888f01ca8ca2e4eca6956066a60aaca452f5ed4 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 11 May 2022 23:24:10 -0700 Subject: [PATCH 03/25] add link to eslint config docs to main eslint config file --- .eslintrc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index eb8e6e8faca8..746c3d474c24 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,8 @@ // Note: All paths are relative to the directory in which eslint is being run, rather than the directory where this file // lives +// ESLint config docs: https://eslint.org/docs/user-guide/configuring/ + module.exports = { root: true, env: { From bee242c7b3a3a298d1fd4b7c026e5c019bc79932 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 11 May 2022 23:27:03 -0700 Subject: [PATCH 04/25] add comment to GHA linting job --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca67de633903..49ae67cdf1e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -211,6 +211,8 @@ jobs: job_lint: name: Lint + # Even though the linter only checks source code, not built code, it needs the built code in order check that all + # inter-package dependencies resolve cleanly. needs: [job_get_metadata, job_build] timeout-minutes: 10 runs-on: ubuntu-latest From f0f3ea1d4126e4248861ec78bcb70aee33a9cf78 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 11 May 2022 23:30:54 -0700 Subject: [PATCH 05/25] add link to commonjs rollup plugin to bundle config --- packages/integrations/rollup.bundle.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/integrations/rollup.bundle.config.js b/packages/integrations/rollup.bundle.config.js index 8f6e21de1937..067a062e17f6 100644 --- a/packages/integrations/rollup.bundle.config.js +++ b/packages/integrations/rollup.bundle.config.js @@ -16,6 +16,7 @@ const baseBundleConfig = makeBaseBundleConfig({ }); // TODO We only need `commonjs` for localforage (used in the offline plugin). Once that's fixed, this can come out. +// CommonJS plugin docs: https://github.com/rollup/plugins/tree/master/packages/commonjs baseBundleConfig.plugins = insertAt(baseBundleConfig.plugins, -2, commonjs()); // this makes non-minified, minified, and minified-with-debug-logging versions of each bundle From 373836ef69b76b0f36fb7ccd206539e340c6d700 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 11 May 2022 23:32:27 -0700 Subject: [PATCH 06/25] fix comment and docstring in rollup bundle plugins --- rollup/plugins/bundlePlugins.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rollup/plugins/bundlePlugins.js b/rollup/plugins/bundlePlugins.js index c2c65d8a1a11..03aefad22ec6 100644 --- a/rollup/plugins/bundlePlugins.js +++ b/rollup/plugins/bundlePlugins.js @@ -42,12 +42,15 @@ export function makeLicensePlugin(title) { * Create a plugin to set the value of the `__SENTRY_DEBUG__` magic string. * * @param includeDebugging Whether or not the resulting build should include log statements - * @returns An instance of the `replace` plugin to do the replacement of the magic string with `true` or 'false` + * @returns An instance of the `@rollup/plugin-replace` plugin to do the replacement of the magic string with `true` or + * 'false` */ export function makeIsDebugBuildPlugin(includeDebugging) { return replace({ - // __DEBUG_BUILD__ and __SENTRY_DEBUG__ are safe to replace in any case, so no checks for assignments necessary - preventAssignment: false, + // TODO `preventAssignment` will default to true in version 5.x of the replace plugin, at which point we can get rid + // of this. (It actually makes no difference in this case whether it's true or false, since we never assign to + // `__SENTRY_DEBUG__`, but if we don't give it a value, it will spam with warnings.) + preventAssignment: true, values: { // Flags in current package __DEBUG_BUILD__: includeDebugging, From 709886f17d82001730e86ccd985bb8106ab6b71e Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 11 May 2022 23:33:51 -0700 Subject: [PATCH 07/25] fix typo in syncpromise test title --- packages/utils/test/syncpromise.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/test/syncpromise.test.ts b/packages/utils/test/syncpromise.test.ts index cdb0a7c6e0e7..b2b98542b6bd 100644 --- a/packages/utils/test/syncpromise.test.ts +++ b/packages/utils/test/syncpromise.test.ts @@ -134,7 +134,7 @@ describe('SyncPromise', () => { }); }); - test('calling the callback immediatly', () => { + test('calling the callback immediately', () => { expect.assertions(1); let foo: number = 1; From 9f392a4b3fe06c2e0f3ef5730917dc25e9b2a9e2 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 11 May 2022 23:35:08 -0700 Subject: [PATCH 08/25] fix docstring on scope method --- packages/hub/src/scope.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/hub/src/scope.ts b/packages/hub/src/scope.ts index 34e9057d6cc9..278cc3c7e17c 100644 --- a/packages/hub/src/scope.ts +++ b/packages/hub/src/scope.ts @@ -441,11 +441,10 @@ export class Scope implements ScopeInterface { } /** - * Applies the current context and fingerprint to the event. - * Note that breadcrumbs will be added by the client. - * Also if the event has already breadcrumbs on it, we do not merge them. + * Applies data from the scope to the event and runs all event processors on it. + * * @param event Event - * @param hint May contain additional information about the original exception. + * @param hint Object containing additional information about the original exception, for use by the event processors. * @hidden */ public applyToEvent(event: Event, hint: EventHint = {}): PromiseLike { From 088d972cf912c57bb0672d07bf6a0406c386666e Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:28:18 -0700 Subject: [PATCH 09/25] fix docstring on uncaught exception handler in node --- packages/node/src/integrations/onuncaughtexception.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node/src/integrations/onuncaughtexception.ts b/packages/node/src/integrations/onuncaughtexception.ts index 9c16e2e70fe2..64b0fdd6989a 100644 --- a/packages/node/src/integrations/onuncaughtexception.ts +++ b/packages/node/src/integrations/onuncaughtexception.ts @@ -7,7 +7,7 @@ import { logAndExitProcess } from './utils/errorhandling'; type OnFatalErrorHandler = (firstError: Error, secondError?: Error) => void; -/** Global Promise Rejection handler */ +/** Global Exception handler */ export class OnUncaughtException implements Integration { /** * @inheritDoc From 88f2ae562277f02154edfdd1934e6c92de7f4ad5 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:29:12 -0700 Subject: [PATCH 10/25] fix docstring on `getIntegration` --- packages/types/src/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/client.ts b/packages/types/src/client.ts index b09557ccba75..5e4fe6d2da43 100644 --- a/packages/types/src/client.ts +++ b/packages/types/src/client.ts @@ -97,7 +97,7 @@ export interface Client { */ flush(timeout?: number): PromiseLike; - /** Returns an array of installed integrations on the client. */ + /** Returns the client's instance of the given integration class, it any. */ getIntegration(integration: IntegrationClass): T | null; /** This is an internal function to setup all integrations that should run on the client */ From 1167a3b69b5eaf8ab847d00b20e1ea8698bddd5e Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:31:04 -0700 Subject: [PATCH 11/25] fix docstrings in `normalize.ts` and normalization tests --- packages/utils/src/normalize.ts | 2 +- packages/utils/test/normalize.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/utils/src/normalize.ts b/packages/utils/src/normalize.ts index f40304374137..d2061af89a8c 100644 --- a/packages/utils/src/normalize.ts +++ b/packages/utils/src/normalize.ts @@ -28,7 +28,7 @@ type ObjOrArray = { [key: string]: T }; * @param input The object to be normalized. * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) * @param maxProperties The max number of elements or properties to be included in any single array or - * object in the normallized output.. + * object in the normallized output. * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/utils/test/normalize.test.ts b/packages/utils/test/normalize.test.ts index f9d909798d37..9f6b60f5f392 100644 --- a/packages/utils/test/normalize.test.ts +++ b/packages/utils/test/normalize.test.ts @@ -184,7 +184,7 @@ describe('normalize()', () => { }); }); - describe('dont mutate and skip non-enumerables', () => { + describe("doesn't mutate the given object and skips non-enumerables", () => { test('simple object', () => { const circular = { foo: 1, @@ -311,7 +311,7 @@ describe('normalize()', () => { }); }); - describe('changes unserializeable/global values/classes to its string representation', () => { + describe('changes unserializeable/global values/classes to their respective string representations', () => { test('primitive values', () => { expect(normalize(undefined)).toEqual('[undefined]'); expect(normalize(NaN)).toEqual('[NaN]'); @@ -376,7 +376,7 @@ describe('normalize()', () => { }); }); - test('known Classes like Reacts SyntheticEvents', () => { + test("known classes like React's `SyntheticEvent`", () => { const obj = { foo: { nativeEvent: 'wat', @@ -510,7 +510,7 @@ describe('normalize()', () => { }); }); - test('normalizes value on every iteration of decycle and takes care of things like Reacts SyntheticEvents', () => { + test("normalizes value on every iteration of decycle and takes care of things like React's `SyntheticEvent`", () => { const obj = { foo: { nativeEvent: 'wat', From ef1017c814807e1d7213ca8f07f3b144b4f26c9c Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:33:53 -0700 Subject: [PATCH 12/25] wordsmith gatsby browser file --- packages/gatsby/gatsby-browser.js | 6 +++--- packages/gatsby/test/gatsby-browser.test.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/gatsby/gatsby-browser.js b/packages/gatsby/gatsby-browser.js index 598ce44ade08..847d76e946ad 100644 --- a/packages/gatsby/gatsby-browser.js +++ b/packages/gatsby/gatsby-browser.js @@ -9,8 +9,8 @@ exports.onClientEntry = function (_, pluginParams) { if (areOptionsDefined) { console.warn( 'Sentry Logger [Warn]: The SDK was initialized in the Sentry config file, but options were found in the Gatsby config. ' + - 'These have been ignored, merge them to the Sentry config if you want to use them.\n' + - 'Learn more about the Gatsby SDK on https://docs.sentry.io/platforms/javascript/guides/gatsby/', + 'These have been ignored. Merge them to the Sentry config if you want to use them.\n' + + 'Learn more about the Gatsby SDK in https://docs.sentry.io/platforms/javascript/guides/gatsby/.', ); } return; @@ -19,7 +19,7 @@ exports.onClientEntry = function (_, pluginParams) { if (!areOptionsDefined) { console.error( 'Sentry Logger [Error]: No config for the Gatsby SDK was found.\n' + - 'Learn how to configure it on https://docs.sentry.io/platforms/javascript/guides/gatsby/', + 'Learn how to configure it in https://docs.sentry.io/platforms/javascript/guides/gatsby/.', ); return; } diff --git a/packages/gatsby/test/gatsby-browser.test.ts b/packages/gatsby/test/gatsby-browser.test.ts index cfeb9d227a88..2d31d8420c6e 100644 --- a/packages/gatsby/test/gatsby-browser.test.ts +++ b/packages/gatsby/test/gatsby-browser.test.ts @@ -81,8 +81,8 @@ describe('onClientEntry', () => { // eslint-disable-next-line no-console expect((console.warn as jest.Mock).mock.calls[0]).toMatchInlineSnapshot(` Array [ - "Sentry Logger [Warn]: The SDK was initialized in the Sentry config file, but options were found in the Gatsby config. These have been ignored, merge them to the Sentry config if you want to use them. - Learn more about the Gatsby SDK on https://docs.sentry.io/platforms/javascript/guides/gatsby/", + "Sentry Logger [Warn]: The SDK was initialized in the Sentry config file, but options were found in the Gatsby config. These have been ignored. Merge them to the Sentry config if you want to use them. + Learn more about the Gatsby SDK in https://docs.sentry.io/platforms/javascript/guides/gatsby/.", ] `); // eslint-disable-next-line no-console @@ -98,7 +98,7 @@ describe('onClientEntry', () => { expect((console.error as jest.Mock).mock.calls[0]).toMatchInlineSnapshot(` Array [ "Sentry Logger [Error]: No config for the Gatsby SDK was found. - Learn how to configure it on https://docs.sentry.io/platforms/javascript/guides/gatsby/", + Learn how to configure it in https://docs.sentry.io/platforms/javascript/guides/gatsby/.", ] `); }); From 672d586ecdfb432ab4436ea3d2746a245dd7de88 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:35:48 -0700 Subject: [PATCH 13/25] fix comments in nextjs types file --- packages/nextjs/src/config/types.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/nextjs/src/config/types.ts b/packages/nextjs/src/config/types.ts index 3b83b23b8f31..83e597f07a45 100644 --- a/packages/nextjs/src/config/types.ts +++ b/packages/nextjs/src/config/types.ts @@ -22,15 +22,15 @@ export type NextConfigFunctionWithSentry = ( ) => NextConfigObjectWithSentry; export type NextConfigObject = { - // custom webpack options + // Custom webpack options webpack?: WebpackConfigFunction; - // whether to build serverless functions for all pages, not just API routes + // Whether to build serverless functions for all pages, not just API routes. Removed in nextjs 12+. target?: 'server' | 'experimental-serverless-trace'; - // the output directory for the built app (defaults to ".next") + // The output directory for the built app (defaults to ".next") distDir?: string; - // the root at which the nextjs app will be served (defaults to "/") + // The root at which the nextjs app will be served (defaults to "/") basePath?: string; - // config which will be available at runtime + // Config which will be available at runtime publicRuntimeConfig?: { [key: string]: unknown }; }; @@ -39,6 +39,9 @@ export type UserSentryOptions = { // the plugin to be enabled, even in situations where it's not recommended. disableServerWebpackPlugin?: boolean; disableClientWebpackPlugin?: boolean; + + // Use `hidden-source-map` for webpack `devtool` option, which strips the `sourceMappingURL` from the bottom of built + // JS files hideSourceMaps?: boolean; // Force webpack to apply the same transpilation rules to the SDK code as apply to user code. Helpful when targeting @@ -64,9 +67,8 @@ export type NextConfigFunction = (phase: string, defaults: { defaultConfig: Next * Webpack config */ -// the format for providing custom webpack config in your nextjs options +// The two possible formats for providing custom webpack config in `next.config.js` export type WebpackConfigFunction = (config: WebpackConfigObject, options: BuildContext) => WebpackConfigObject; - export type WebpackConfigObject = { devtool?: string; plugins?: Array; @@ -81,7 +83,7 @@ export type WebpackConfigObject = { rules: Array; }; } & { - // other webpack options + // Other webpack options [key: string]: unknown; }; From 023eedec51b18b4eb35a05fb753993fa6b3817ed Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:37:38 -0700 Subject: [PATCH 14/25] add comments in launch.json --- .vscode/launch.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index d721fde3c449..2fd396c8ddbf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,13 +2,17 @@ // Use IntelliSense to learn about possible Node.js debug attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + // For available variables, visit: https://code.visualstudio.com/docs/editor/variables-reference "version": "0.2.0", "inputs": [ { + // Get the name of the package containing the file in the active tab. "id": "getPackageName", "type": "command", "command": "shellCommand.execute", "args": { + // Get the current file's absolute path, chop off everything up to and including the repo's `packages` + // directory, then split on `/` and take the first entry "command": "echo '${file}' | sed s/'.*sentry-javascript\\/packages\\/'// | grep --extended-regexp --only-matching --max-count 1 '[^\\/]+' | head -1", "cwd": "${workspaceFolder}", // normally `input` commands bring up a selector for the user, but given that there should only be one From 1e4049406feeee7721d77841af8d89c2e93959c8 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:38:11 -0700 Subject: [PATCH 15/25] clarify variable name, add docstring for `isBuiltin` --- packages/utils/src/is.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/utils/src/is.ts b/packages/utils/src/is.ts index 81ae28349a0a..8ec83089e4d5 100644 --- a/packages/utils/src/is.ts +++ b/packages/utils/src/is.ts @@ -23,9 +23,15 @@ export function isError(wat: unknown): wat is Error { return isInstanceOf(wat, Error); } } - -function isBuiltin(wat: unknown, ty: string): boolean { - return objectToString.call(wat) === `[object ${ty}]`; +/** + * Checks whether given value is an instance of the given built-in class. + * + * @param wat The value to be checked + * @param className + * @returns A boolean representing the result. + */ +function isBuiltin(wat: unknown, className: string): boolean { + return objectToString.call(wat) === `[object ${className}]`; } /** From 7d69113805780def9fbfa212c326f580957857ad Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:39:43 -0700 Subject: [PATCH 16/25] fix comment in nextjs integration test runner script --- packages/nextjs/test/run-integration-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextjs/test/run-integration-tests.sh b/packages/nextjs/test/run-integration-tests.sh index 7253c7b66130..9ca5e776c300 100755 --- a/packages/nextjs/test/run-integration-tests.sh +++ b/packages/nextjs/test/run-integration-tests.sh @@ -54,7 +54,7 @@ for NEXTJS_VERSION in 10 11 12; do echo "[nextjs@$NEXTJS_VERSION] Installing dependencies..." # set the desired version of next long enough to run yarn, and then restore the old version (doing the restoration now - # rather than during overall cleanup lets us look for "latest" in both loops) + # rather than during overall cleanup lets us look for "latest" in every loop) cp package.json package.json.bak if [[ $(uname) == "Darwin" ]]; then sed -i "" /"next.*latest"/s/latest/"${NEXTJS_VERSION}.x"/ package.json From 6010cee6e42ea6df4edecde96331f167e127a835 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:41:26 -0700 Subject: [PATCH 17/25] clarify wording of comment in `tracing/index.bundle.ts` --- packages/tracing/src/index.bundle.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/tracing/src/index.bundle.ts b/packages/tracing/src/index.bundle.ts index bb55da2cd273..b765cb0cca0a 100644 --- a/packages/tracing/src/index.bundle.ts +++ b/packages/tracing/src/index.bundle.ts @@ -75,10 +75,10 @@ const INTEGRATIONS = { }; export { INTEGRATIONS as Integrations }; -// Though in this case exporting this separately in addition to exporting it as part of `Sentry.Integrations` doesn't -// gain us any bundle size advantage (we're making the bundle here, not the user, and we can't leave anything out of -// ours), it does bring the API for using the integration in line with that recommended for users bundling Sentry -// themselves. +// Though in this case exporting `BrowserTracing` separately (in addition to exporting it as part of +// `Sentry.Integrations`) doesn't gain us any bundle size advantage (we're making the bundle here, not the user, and we +// can't leave anything out of ours), it does bring the API for using the integration in line with that recommended for +// users bundling Sentry themselves. export { BrowserTracing }; // We are patching the global object with our hub extension methods From c043043e8bb2d0e93da056fac2a23b80c09ee143 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:47:20 -0700 Subject: [PATCH 18/25] code-ify changelog entry for clarity --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da0e95f0abcf..16477efac58a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -513,7 +513,7 @@ Work in this release contributed by @7inspire, @jaeseokk, and @rchl. Thank you f This patch contains a breaking change for anyone setting the undocumented `rethrowAfterCapture` option for `@sentry/serverless`'s AWS wrapper to `false`, as its functionality has been removed. For backwards compatibility with anyone setting it to `true` (which is also the default), the option remains in the `WrapperOptions` type for now. It will be removed in the next major release, though, so we recommend removing it from your code. - ref(serverless): Remove `rethrowAfterCapture` use in AWS lambda wrapper (#4448) -- fix(utils): Remove dom is casting (#4451) +- fix(utils): Remove dom `is` casting (#4451) ## 6.17.1 From 9362548316352eb8bf6c2c2217e0c0f2efba1646 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:48:44 -0700 Subject: [PATCH 19/25] remove outdated todo in nextjs webpack config code --- packages/nextjs/src/config/webpack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 73b28038f01c..573fcb2b4e99 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -29,7 +29,7 @@ export { SentryWebpackPlugin }; * Sets: * - `devtool`, to ensure high-quality sourcemaps are generated * - `entry`, to include user's sentry config files (where `Sentry.init` is called) in the build - * - `plugins`, to add SentryWebpackPlugin (TODO: optional) + * - `plugins`, to add SentryWebpackPlugin * * @param userNextConfig The user's existing nextjs config, as passed to `withSentryConfig` * @param userSentryWebpackPluginOptions The user's SentryWebpackPlugin config, as passed to `withSentryConfig` From c58a7395a2a8ecc98219038c5b88b6eae0483e88 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 12 May 2022 00:50:32 -0700 Subject: [PATCH 20/25] add filename to error message in ts version check --- scripts/verify-packages-versions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/verify-packages-versions.js b/scripts/verify-packages-versions.js index e0efc39311bc..9e24e8090096 100644 --- a/scripts/verify-packages-versions.js +++ b/scripts/verify-packages-versions.js @@ -13,7 +13,7 @@ the package slightly less open for modifications, and prevent users from experim and from implementing some of their scenarios. If you REALLY know what you are doing, and you REALLY want to use a different version of TypeScript, -modify \`TYPESCRIPT_VERSION\` constant at the top of this file. +modify \`TYPESCRIPT_VERSION\` constant at the top of this file (\`scripts/verify-packages-versions.js\`). change: https://github.com/getsentry/sentry-javascript/pull/2848 ref: https://github.com/getsentry/sentry-javascript/issues/2845 From 50d903220d3615a3857932554cbc97b97e50e9a0 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 16 May 2022 20:28:19 -0700 Subject: [PATCH 21/25] add links to hooks docs to npm rollup plugins --- rollup/plugins/npmPlugins.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rollup/plugins/npmPlugins.js b/rollup/plugins/npmPlugins.js index 23c9e4fff864..5b60ee37811b 100644 --- a/rollup/plugins/npmPlugins.js +++ b/rollup/plugins/npmPlugins.js @@ -1,4 +1,7 @@ /** + * Rollup plugin hooks docs: https://rollupjs.org/guide/en/#build-hooks and + * https://rollupjs.org/guide/en/#output-generation-hooks + * * Regex Replace plugin docs: https://github.com/jetiny/rollup-plugin-re * Replace plugin docs: https://github.com/rollup/plugins/tree/master/packages/replace * Sucrase plugin docs: https://github.com/rollup/plugins/tree/master/packages/sucrase @@ -50,7 +53,8 @@ export function makeConstToVarPlugin() { /** * Create a plugin which can be used to pause the build process at the given hook. * - * Hooks can be found here: https://rollupjs.org/guide/en/#build-hooks. + * Hooks can be found at https://rollupjs.org/guide/en/#build-hooks and + * https://rollupjs.org/guide/en/#output-generation-hooks. * * @param hookName The name of the hook at which to pause. * @returns A plugin which inserts a debugger statement in the phase represented by the given hook From ed8550cab340f05bfb73645af6c78b0f29e39d08 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Thu, 19 May 2022 08:21:41 -0700 Subject: [PATCH 22/25] fix typo in aws lambda comment --- packages/serverless/src/awslambda.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/serverless/src/awslambda.ts b/packages/serverless/src/awslambda.ts index 50350dd922da..6cd916270cb5 100644 --- a/packages/serverless/src/awslambda.ts +++ b/packages/serverless/src/awslambda.ts @@ -250,7 +250,7 @@ export function wrapHandler( }; let timeoutWarningTimer: NodeJS.Timeout; - // AWSLambda is like Express. It makes a distinction about handlers based on it's last argument + // AWSLambda is like Express. It makes a distinction about handlers based on its last argument // async (event) => async handler // async (event, context) => async handler // (event, context, callback) => sync handler From 41991a15e3a80c017b5b3790757689f8046483f1 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 29 Aug 2022 23:11:10 -0700 Subject: [PATCH 23/25] add TODO re: v8 to hub test --- packages/hub/test/exports.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/hub/test/exports.test.ts b/packages/hub/test/exports.test.ts index b6e688e3df00..350aad7e856f 100644 --- a/packages/hub/test/exports.test.ts +++ b/packages/hub/test/exports.test.ts @@ -106,6 +106,7 @@ describe('Top Level API', () => { }); // NOTE: We left custom level as 2nd argument to not break the API. Should be removed and unified in v6. + // TODO: Before we release v8, check if this is still a thing test('Message with custom level', () => { const client: any = { captureMessage: jest.fn(async () => Promise.resolve()) }; getCurrentHub().withScope(() => { From 8fe1a80d161a3fe2db4466392e94ba9e40950835 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 29 Aug 2022 23:12:02 -0700 Subject: [PATCH 24/25] add blank lines between node client tests --- packages/node/test/client.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/node/test/client.test.ts b/packages/node/test/client.test.ts index fc098854c0e9..6c4a2193c762 100644 --- a/packages/node/test/client.test.ts +++ b/packages/node/test/client.test.ts @@ -27,6 +27,7 @@ describe('NodeClient', () => { const requestSession = scope.getRequestSession(); expect(requestSession!.status).toEqual('ok'); }); + test('when autoSessionTracking is disabled -> requestStatus should not be set', () => { const options = getDefaultNodeClientOptions({ dsn: PUBLIC_DSN, autoSessionTracking: false, release: '1.4' }); client = new NodeClient(options); @@ -42,6 +43,7 @@ describe('NodeClient', () => { const requestSession = scope.getRequestSession(); expect(requestSession!.status).toEqual('ok'); }); + test('when autoSessionTracking is enabled + requestSession status is Crashed -> requestStatus should not be overridden', () => { const options = getDefaultNodeClientOptions({ dsn: PUBLIC_DSN, autoSessionTracking: true, release: '1.4' }); client = new NodeClient(options); @@ -57,6 +59,7 @@ describe('NodeClient', () => { const requestSession = scope.getRequestSession(); expect(requestSession!.status).toEqual('crashed'); }); + test('when autoSessionTracking is enabled + error occurs within request bounds -> requestStatus should be set to Errored', () => { const options = getDefaultNodeClientOptions({ dsn: PUBLIC_DSN, autoSessionTracking: true, release: '1.4' }); client = new NodeClient(options); @@ -72,6 +75,7 @@ describe('NodeClient', () => { const requestSession = scope.getRequestSession(); expect(requestSession!.status).toEqual('errored'); }); + test('when autoSessionTracking is enabled + error occurs outside of request bounds -> requestStatus should not be set to Errored', () => { const options = getDefaultNodeClientOptions({ dsn: PUBLIC_DSN, autoSessionTracking: true, release: '1.4' }); client = new NodeClient(options); From d2400249d0463f17e50a0a7c88d7491f84f5bf08 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 29 Aug 2022 23:16:39 -0700 Subject: [PATCH 25/25] fix error messages re: full buffers --- packages/core/src/transports/base.ts | 2 +- packages/utils/src/promisebuffer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/transports/base.ts b/packages/core/src/transports/base.ts index e37365c89f63..d9c58b789706 100644 --- a/packages/core/src/transports/base.ts +++ b/packages/core/src/transports/base.ts @@ -86,7 +86,7 @@ export function createTransport( result => result, error => { if (error instanceof SentryError) { - __DEBUG_BUILD__ && logger.error('Skipped sending event due to full buffer'); + __DEBUG_BUILD__ && logger.error('Skipped sending event because buffer is full.'); recordEnvelopeLoss('queue_overflow'); return resolvedSyncPromise(); } else { diff --git a/packages/utils/src/promisebuffer.ts b/packages/utils/src/promisebuffer.ts index 3e68e6c82b83..6866a42ee4f9 100644 --- a/packages/utils/src/promisebuffer.ts +++ b/packages/utils/src/promisebuffer.ts @@ -42,7 +42,7 @@ export function makePromiseBuffer(limit?: number): PromiseBuffer { */ function add(taskProducer: () => PromiseLike): PromiseLike { if (!isReady()) { - return rejectedSyncPromise(new SentryError('Not adding Promise due to buffer limit reached.')); + return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.')); } // start the task and add its promise to the queue