Skip to content

[Gitflow] Merge develop into master #7017

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 10 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ jobs:
- name: Pack
run: yarn build:tarball
- name: Archive artifacts
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
name: ${{ github.sha }}
path: |
Expand Down Expand Up @@ -833,7 +833,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v3.1.2
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
with:
name: ${{ steps.process.outputs.artifactName }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gitflow-sync-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
destination_branch: ${{ env.DEV_BRANCH }}
pr_title: '[Gitflow] Merge ${{ github.ref_name }} into ${{ env.DEV_BRANCH }}'
pr_body: 'Merge ${{ github.ref_name }} branch into ${{ env.DEV_BRANCH }}'
pr_label: 'Dev: Gitflow'

# https://github.com/marketplace/actions/enable-pull-request-automerge
- name: Enable automerge for PR
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gitflow-sync-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
destination_branch: ${{ env.MAIN_BRANCH }}
pr_title: '[Gitflow] Merge ${{ github.ref_name }} into ${{ env.MAIN_BRANCH }}'
pr_body: 'Merge ${{ github.ref_name }} branch into ${{ env.MAIN_BRANCH }}'
pr_label: 'Dev: Gitflow'

# https://github.com/marketplace/actions/enable-pull-request-automerge
- name: Enable automerge for PR
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.35.0

Session Replay is deprecating privacy options in favor of a more streamlined API. Please see the [Replay migration guide](https://github.com/getsentry/sentry-javascript/blob/master/packages/replay/MIGRATION.md) for further information.
Additionally, the following configuration options will no longer be configurable: `slimDOMOptions`, `recordCanvas`, `inlineStylesheet`, `collectFonts`, `inlineImages`.

- feat(browser): Track if cdn or npm bundle (#6976)
- feat(core): Add aria label to breadcrumb attributes (#6955)
- feat(core): Add Offline Transport wrapper (#6884)
- feat(loader): Add SENTRY_SDK_SOURCE to track loader stats (#6985)
- feat(loader): Sync loader with Sentry template (#7001)
- feat(replay): Deprecate privacy options in favor of a new API, remove some recording options (#6645)
- feat(replay): Move sample rate tags into event context (#6659)
- fix(nextjs): Add isomorphic versions of `ErrorBoundary`, `withErrorBoundary` and `showReportDialog` (#6987)
- fix(nextjs): Don't modify require calls in wrapping loader (#6979)
- fix(nextjs): Don't share I/O resources in between requests (#6980)
- fix(nextjs): Inject client config into `_app` instead of `main` (#7009)
- fix(nextjs): Use Proxies to wrap to preserve static methods (#7002)
- fix(replay): Catch style mutation handling & null events in rrweb (#7010)
- fix(replay): Handle compression failures more robustly (#6988)
- fix(replay): Only call `scope.getLastBreadcrumb` if available (#6969)
- fix(utils): Account for null prototype during normalization (#6925)
- ref(replay): Log warning if sample rates are all undefined (#6959)

## 7.34.0

This release adds automatic injection of the Next.js SDK into serverside `app` directory bundles, allowing users to call the Sentry SDK in server components.
Expand Down
5 changes: 5 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Deprecations in 7.x

## Replay options changed (since 7.35.0) - #6645

Some options for replay have been depracted in favor of new APIs.
See [Replay Migration docs](./packages/replay/MIGRATION.md#upgrading-replay-from-7340-to-7350) for details.

## Renaming of Next.js wrapper methods (since 7.31.0) - #6790

We updated the names of the functions to wrap data fetchers and API routes to better reflect what they are doing.
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
var _currentScriptTag = _document.scripts[0];
var _newScriptTag = _document.createElement(_script);
_newScriptTag.src = _sdkBundleUrl;
_newScriptTag.setAttribute('crossorigin', 'anonymous');
_newScriptTag.crossOrigin = 'anonymous';

// Once our SDK is loaded
_newScriptTag.addEventListener('load', function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ type AppGetInitialProps = typeof App['getInitialProps'];
* so we are consistent with the serverside implementation.
*/
export function wrapAppGetInitialPropsWithSentry(origAppGetInitialProps: AppGetInitialProps): AppGetInitialProps {
return async function (this: unknown, ...args: Parameters<AppGetInitialProps>): ReturnType<AppGetInitialProps> {
return await origAppGetInitialProps.apply(this, args);
};
return new Proxy(origAppGetInitialProps, {
apply: async (wrappingTarget, thisArg, args: Parameters<AppGetInitialProps>) => {
return await wrappingTarget.apply(thisArg, args);
},
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ type DocumentGetInitialProps = typeof Document.getInitialProps;
export function wrapDocumentGetInitialPropsWithSentry(
origDocumentGetInitialProps: DocumentGetInitialProps,
): DocumentGetInitialProps {
return async function (
this: unknown,
...args: Parameters<DocumentGetInitialProps>
): ReturnType<DocumentGetInitialProps> {
return await origDocumentGetInitialProps.apply(this, args);
};
return new Proxy(origDocumentGetInitialProps, {
apply: async (wrappingTarget, thisArg, args: Parameters<DocumentGetInitialProps>) => {
return await wrappingTarget.apply(thisArg, args);
},
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ type ErrorGetInitialProps = (context: NextPageContext) => Promise<ErrorProps>;
export function wrapErrorGetInitialPropsWithSentry(
origErrorGetInitialProps: ErrorGetInitialProps,
): ErrorGetInitialProps {
return async function (this: unknown, ...args: Parameters<ErrorGetInitialProps>): ReturnType<ErrorGetInitialProps> {
return await origErrorGetInitialProps.apply(this, args);
};
return new Proxy(origErrorGetInitialProps, {
apply: async (wrappingTarget, thisArg, args: Parameters<ErrorGetInitialProps>) => {
return await wrappingTarget.apply(thisArg, args);
},
});
}

/**
Expand Down
8 changes: 5 additions & 3 deletions packages/nextjs/src/client/wrapGetInitialPropsWithSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ type GetInitialProps = Required<NextPage>['getInitialProps'];
* so we are consistent with the serverside implementation.
*/
export function wrapGetInitialPropsWithSentry(origGetInitialProps: GetInitialProps): GetInitialProps {
return async function (this: unknown, ...args: Parameters<GetInitialProps>): Promise<ReturnType<GetInitialProps>> {
return origGetInitialProps.apply(this, args);
};
return new Proxy(origGetInitialProps, {
apply: async (wrappingTarget, thisArg, args: Parameters<GetInitialProps>) => {
return await wrappingTarget.apply(thisArg, args);
},
});
}

/**
Expand Down
9 changes: 7 additions & 2 deletions packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,13 @@ function shouldAddSentryToEntryPoint(
return entryPointName.startsWith('pages/');
} else if (runtime === 'browser') {
return (
entryPointName === 'main' || // entrypoint for `/pages` pages
entryPointName === 'main-app' // entrypoint for `/app` pages
// entrypoint for `/pages` pages - this is included on all clientside pages
// It's important that we inject the SDK into this file and not into 'main' because in 'main'
// some important Next.js code (like the setup code for getCongig()) is located and some users
// may need this code inside their Sentry configs
entryPointName === 'pages/_app' ||
// entrypoint for `/app` pages
entryPointName === 'main-app'
);
} else {
// User-specified pages to skip. (Note: For ease of use, `excludeServerRoutes` is specified in terms of routes,
Expand Down
28 changes: 15 additions & 13 deletions packages/nextjs/src/edge/wrapApiHandlerWithSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@ export function wrapApiHandlerWithSentry<H extends EdgeRouteHandler>(
handler: H,
parameterizedRoute: string,
): (...params: Parameters<H>) => Promise<ReturnType<H>> {
return async function (this: unknown, ...args: Parameters<H>): Promise<ReturnType<H>> {
const req = args[0];
return new Proxy(handler, {
apply: async (wrappingTarget, thisArg, args: Parameters<H>) => {
const req = args[0];

const activeSpan = !!getCurrentHub().getScope()?.getSpan();
const activeSpan = !!getCurrentHub().getScope()?.getSpan();

const wrappedHandler = withEdgeWrapping(handler, {
spanDescription:
activeSpan || !(req instanceof Request)
? `handler (${parameterizedRoute})`
: `${req.method} ${parameterizedRoute}`,
spanOp: activeSpan ? 'function' : 'http.server',
mechanismFunctionName: 'wrapApiHandlerWithSentry',
});
const wrappedHandler = withEdgeWrapping(wrappingTarget, {
spanDescription:
activeSpan || !(req instanceof Request)
? `handler (${parameterizedRoute})`
: `${req.method} ${parameterizedRoute}`,
spanOp: activeSpan ? 'function' : 'http.server',
mechanismFunctionName: 'wrapApiHandlerWithSentry',
});

return await wrappedHandler.apply(this, args);
};
return await wrappedHandler.apply(thisArg, args);
},
});
}

/**
Expand Down
12 changes: 8 additions & 4 deletions packages/nextjs/src/edge/wrapMiddlewareWithSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import { withEdgeWrapping } from './utils/edgeWrapperUtils';
export function wrapMiddlewareWithSentry<H extends EdgeRouteHandler>(
middleware: H,
): (...params: Parameters<H>) => Promise<ReturnType<H>> {
return withEdgeWrapping(middleware, {
spanDescription: 'middleware',
spanOp: 'middleware.nextjs',
mechanismFunctionName: 'withSentryMiddleware',
return new Proxy(middleware, {
apply: async (wrappingTarget, thisArg, args: Parameters<H>) => {
return withEdgeWrapping(wrappingTarget, {
spanDescription: 'middleware',
spanOp: 'middleware.nextjs',
mechanismFunctionName: 'withSentryMiddleware',
}).apply(thisArg, args);
},
});
}
31 changes: 0 additions & 31 deletions packages/nextjs/src/server/utils/nextLogger.ts

This file was deleted.

Loading