Skip to content

Commit c357efe

Browse files
authored
Merge branch 'master' into jb/bundle/drop-severity
2 parents 291d0e1 + f32cd36 commit c357efe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3794
-539
lines changed

.github/workflows/build.yml

+27
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,33 @@ jobs:
271271
${{ github.workspace }}/packages/**/*.tgz
272272
${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip
273273
274+
job_browser_playwright_tests:
275+
name: Browser Playwright Tests
276+
needs: job_build
277+
runs-on: ubuntu-latest
278+
steps:
279+
- name: Check out current commit (${{ github.sha }})
280+
uses: actions/checkout@v2
281+
- name: Set up Node
282+
uses: actions/setup-node@v1
283+
with:
284+
node-version: '16'
285+
- name: Check dependency cache
286+
uses: actions/cache@v2
287+
with:
288+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
289+
key: ${{ needs.job_build.outputs.dependency_cache_key }}
290+
- name: Check build cache
291+
uses: actions/cache@v2
292+
with:
293+
path: ${{ env.CACHED_BUILD_PATHS }}
294+
key: ${{ env.BUILD_CACHE_KEY }}
295+
- name: Run Playwright tests
296+
run: |
297+
cd packages/integration-tests
298+
yarn run playwright install-deps webkit
299+
yarn test:ci
300+
274301
job_browser_integration_tests:
275302
name: Browser Integration Tests (${{ matrix.browser }})
276303
needs: job_build

.size-limit.js

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ module.exports = [
55
gzip: true,
66
limit: '100 KB',
77
},
8+
{
9+
name: '@sentry/browser - CDN Bundle (minified)',
10+
path: 'packages/browser/build/bundle.min.js',
11+
gzip: false,
12+
limit: '120 KB',
13+
},
814
{
915
name: '@sentry/browser - Webpack',
1016
path: 'packages/browser/esm/index.js',

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"pack:changed": "lerna run pack --since",
2020
"prepublishOnly": "lerna run --stream --concurrency 1 prepublishOnly",
2121
"postpublish": "make publish-docs && lerna run --stream --concurrency 1 postpublish",
22-
"test": "lerna run --stream --concurrency 1 --sort test"
22+
"test": "lerna run --ignore @sentry-internal/browser-integration-tests --stream --concurrency 1 --sort test"
2323
},
2424
"volta": {
2525
"node": "14.17.0",
@@ -34,6 +34,7 @@
3434
"packages/eslint-plugin-sdk",
3535
"packages/gatsby",
3636
"packages/hub",
37+
"packages/integration-tests",
3738
"packages/integrations",
3839
"packages/minimal",
3940
"packages/nextjs",

packages/browser/rollup.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ const commitHash = require('child_process')
99
.trim();
1010

1111
const terserInstance = terser({
12+
compress: {
13+
// Tell env.ts that we're building a browser bundle and that we do not
14+
// want to have unnecessary debug functionality.
15+
global_defs: {
16+
__SENTRY_BROWSER_BUNDLE__: true,
17+
__SENTRY_NO_DEBUG__: true,
18+
},
19+
},
1220
mangle: {
1321
// captureExceptions and captureMessage are public API methods and they don't need to be listed here
1422
// as mangler doesn't touch user-facing thing, however sentryWrapped is not, and it would be mangled into a minified version.

packages/browser/src/helpers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { API, captureException, withScope } from '@sentry/core';
1+
import { captureException, getReportDialogEndpoint, withScope } from '@sentry/core';
22
import { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';
33
import { addExceptionMechanism, addExceptionTypeValue, getGlobalObject, logger } from '@sentry/utils';
44

@@ -210,7 +210,7 @@ export function injectReportDialog(options: ReportDialogOptions = {}): void {
210210

211211
const script = global.document.createElement('script');
212212
script.async = true;
213-
script.src = new API(options.dsn).getReportDialogEndpoint(options);
213+
script.src = getReportDialogEndpoint(options.dsn, options);
214214

215215
if (options.onLoad) {
216216
// eslint-disable-next-line @typescript-eslint/unbound-method

0 commit comments

Comments
 (0)