Skip to content

Commit 8c7102a

Browse files
authored
Merge branch 'master' into fix/res-end-never-called
2 parents 82dcb93 + f8aeeea commit 8c7102a

Some content is hidden

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

63 files changed

+700
-752
lines changed

.craft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ changelogPolicy: simple
33
preReleaseCommand: bash scripts/craft-pre-release.sh
44
targets:
55
- name: aws-lambda-layer
6-
includeNames: /^sentry-node-serverless-\d+(\.\d+)*\.zip$/
6+
includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha)\.\d+)?\.zip$/
77
layerName: SentryNodeServerlessSDK
88
compatibleRuntimes:
99
- name: node

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"chai": "^4.1.2",
2828
"chokidar": "^3.0.2",
2929
"jsdom": "^15.0.0",
30-
"karma": "^4.1.0",
30+
"karma": "^6.3.16",
3131
"karma-chai": "^0.1.0",
3232
"karma-chrome-launcher": "^2.2.0",
3333
"karma-firefox-launcher": "^2.1.2",

packages/browser/rollup.config.js

Lines changed: 29 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,37 @@
1-
import { terser } from 'rollup-plugin-terser';
2-
import typescript from 'rollup-plugin-typescript2';
1+
import { makeBaseBundleConfig, makeLicensePlugin, terserPlugin } from '../../rollup.config';
32

4-
import {
5-
baseBundleConfig,
6-
makeLicensePlugin,
7-
markAsBrowserBuild,
8-
nodeResolvePlugin,
9-
paths,
10-
typescriptPluginES5,
11-
} from '../../rollup.config';
3+
const builds = [];
124

135
const licensePlugin = makeLicensePlugin();
146

15-
const terserInstance = terser({
16-
compress: {
17-
// Tell env.ts that we're building a browser bundle and that we do not
18-
// want to have unnecessary debug functionality.
19-
global_defs: {
20-
__SENTRY_NO_DEBUG__: false,
21-
},
22-
},
23-
mangle: {
24-
// captureExceptions and captureMessage are public API methods and they don't need to be listed here
25-
// as mangler doesn't touch user-facing thing, however sentryWrapped is not, and it would be mangled into a minified version.
26-
// We need those full names to correctly detect our internal frames for stripping.
27-
// I listed all of them here just for the clarity's sake, as they are all used in the frame-manipulation process.
28-
reserved: ['captureException', 'captureMessage', 'sentryWrapped'],
29-
properties: {
30-
regex: /^_[^_]/,
31-
// This exclusion prevents most of the occurrences of the bug linked below:
32-
// https://github.com/getsentry/sentry-javascript/issues/2622
33-
// The bug is caused by multiple SDK instances, where one is minified and one is using non-mangled code.
34-
// Unfortunatelly we cannot fix it reliably (thus `typeof` check in the `InboundFilters` code),
35-
// as we cannot force people using multiple instances in their apps to sync SDK versions.
36-
reserved: ['_mergeOptions'],
37-
},
38-
},
39-
output: {
40-
comments: false,
41-
},
42-
});
43-
44-
const plugins = [
45-
typescriptPluginES5,
46-
// replace `__SENTRY_BROWSER_BUNDLE__` with `true` to enable treeshaking of non-browser code
47-
markAsBrowserBuild,
48-
nodeResolvePlugin,
49-
];
50-
51-
const bundleConfig = {
52-
...baseBundleConfig,
53-
input: 'src/index.ts',
54-
output: {
55-
...baseBundleConfig.output,
56-
format: 'iife',
57-
name: 'Sentry',
58-
},
59-
context: 'window',
60-
plugins: [...plugins, licensePlugin],
61-
};
7+
['es5', 'es6'].forEach(jsVersion => {
8+
const baseBundleConfig = makeBaseBundleConfig({
9+
input: 'src/index.ts',
10+
isAddOn: false,
11+
jsVersion,
12+
outputFileBase: `build/bundle${jsVersion === 'es6' ? '.es6' : ''}`,
13+
});
6214

63-
export default [
64-
// ES5 Browser Bundle
65-
{
66-
...bundleConfig,
67-
output: {
68-
...bundleConfig.output,
69-
file: 'build/bundle.js',
70-
},
71-
},
72-
{
73-
...bundleConfig,
74-
output: {
75-
...bundleConfig.output,
76-
file: 'build/bundle.min.js',
77-
},
78-
// Uglify has to be at the end of compilation, BUT before the license banner
79-
plugins: bundleConfig.plugins.slice(0, -1).concat(terserInstance).concat(bundleConfig.plugins.slice(-1)),
80-
},
81-
// ------------------
82-
// ES6 Browser Bundle
83-
{
84-
...bundleConfig,
85-
output: {
86-
...bundleConfig.output,
87-
file: 'build/bundle.es6.js',
88-
},
89-
plugins: [
90-
typescript({
91-
tsconfig: 'tsconfig.esm.json',
92-
tsconfigOverride: {
93-
compilerOptions: {
94-
declaration: false,
95-
declarationMap: false,
96-
paths,
97-
baseUrl: '.',
98-
target: 'es6',
99-
},
15+
builds.push(
16+
...[
17+
{
18+
...baseBundleConfig,
19+
output: {
20+
...baseBundleConfig.output,
21+
file: `${baseBundleConfig.output.file}.js`,
10022
},
101-
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
102-
}),
103-
...plugins.slice(1).concat(bundleConfig.plugins.slice(-1)),
104-
],
105-
},
106-
{
107-
...bundleConfig,
108-
output: {
109-
...bundleConfig.output,
110-
file: 'build/bundle.es6.min.js',
111-
},
112-
plugins: [
113-
typescript({
114-
tsconfig: 'tsconfig.esm.json',
115-
tsconfigOverride: {
116-
compilerOptions: {
117-
declaration: false,
118-
declarationMap: false,
119-
paths,
120-
baseUrl: '.',
121-
target: 'es6',
122-
},
23+
plugins: [...baseBundleConfig.plugins, licensePlugin],
24+
},
25+
{
26+
...baseBundleConfig,
27+
output: {
28+
...baseBundleConfig.output,
29+
file: `${baseBundleConfig.output.file}.min.js`,
12330
},
124-
include: ['*.ts+(|x)', '**/*.ts+(|x)', '../**/*.ts+(|x)'],
125-
}),
126-
...plugins.slice(1).slice(0, -1).concat(terserInstance).concat(bundleConfig.plugins.slice(-1)),
31+
plugins: [...baseBundleConfig.plugins, terserPlugin, licensePlugin],
32+
},
12733
],
128-
},
129-
// ------------------
130-
];
34+
);
35+
});
36+
37+
export default builds;

packages/browser/src/backend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
4040
* @inheritDoc
4141
*/
4242
public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {
43-
return eventFromException(this._options, exception, hint);
43+
return eventFromException(exception, hint, this._options.attachStacktrace);
4444
}
4545
/**
4646
* @inheritDoc
4747
*/
4848
public eventFromMessage(message: string, level: Severity = Severity.Info, hint?: EventHint): PromiseLike<Event> {
49-
return eventFromMessage(this._options, message, level, hint);
49+
return eventFromMessage(message, level, hint, this._options.attachStacktrace);
5050
}
5151

5252
/**

0 commit comments

Comments
 (0)