Skip to content

Commit efd9f73

Browse files
committed
Merge branch 'master' of https://github.com/getsentry/sentry-javascript into onur/node-integration-tests
2 parents dec31e3 + 04e5429 commit efd9f73

File tree

16 files changed

+435
-282
lines changed

16 files changed

+435
-282
lines changed

.size-limit.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ module.exports = [
5757
gzip: true,
5858
limit: '100 KB',
5959
},
60+
{
61+
name: '@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)',
62+
path: 'packages/tracing/build/bundle.tracing.es6.min.js',
63+
gzip: true,
64+
limit: '100 KB',
65+
},
6066
];

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44

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

7+
## 6.18.2
8+
9+
If you are using `@sentry-internal/eslint-config-sdk`, please note that this release turns on the [quotes rule](https://eslint.org/docs/rules/quotes) to enforce usage of single quotes.
10+
11+
This release also removes `@sentry/tracing` as a dependency of `@sentry/node`. Please explicitly install and import `@sentry/tracing` if you want to use performance monitoring capabilities. For more details, [see our docs on setting up Node Performance Monitoring](https://docs.sentry.io/platforms/node/performance/).
12+
13+
We also now produce an ES6 version of our [CDN tracing bundle](https://docs.sentry.io/platforms/javascript/install/cdn/#performance-bundle), which can be accessed with `bundle.tracing.es6.min.js`.
14+
15+
- chore(eslint): Turn on quotes rules ([#4671](https://github.com/getsentry/sentry-javascript/pull/4671))
16+
- fix(node): prevent errors thrown on flush from breaking response ([#4667](https://github.com/getsentry/sentry-javascript/pull/4667))
17+
- ref(node): Remove dependency on @sentry/tracing ([#4647](https://github.com/getsentry/sentry-javascript/pull/4647))
18+
- fix(tracing): Make method required in transactionSampling type ([#4657](https://github.com/getsentry/sentry-javascript/pull/4657))
19+
- feat(tracing): Add ES6 tracing bundle ([#4674](https://github.com/getsentry/sentry-javascript/pull/4674))
20+
21+
Work in this release contributed by @Ignigena. Thank you for your contribution!
22+
723
## 6.18.1
824

925
- fix(ember): use _backburner if it exists ([#4603](https://github.com/getsentry/sentry-javascript/pull/4603))

packages/browser/rollup.config.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,17 @@
1-
import { makeBaseBundleConfig, makeLicensePlugin, terserPlugin } from '../../rollup.config';
1+
import { makeBaseBundleConfig, makeMinificationVariants } from '../../rollup.config';
22

33
const builds = [];
44

5-
const licensePlugin = makeLicensePlugin();
6-
75
['es5', 'es6'].forEach(jsVersion => {
86
const baseBundleConfig = makeBaseBundleConfig({
97
input: 'src/index.ts',
108
isAddOn: false,
119
jsVersion,
10+
licenseTitle: '@sentry/browser',
1211
outputFileBase: `build/bundle${jsVersion === 'es6' ? '.es6' : ''}`,
1312
});
1413

15-
builds.push(
16-
...[
17-
{
18-
...baseBundleConfig,
19-
output: {
20-
...baseBundleConfig.output,
21-
file: `${baseBundleConfig.output.file}.js`,
22-
},
23-
plugins: [...baseBundleConfig.plugins, licensePlugin],
24-
},
25-
{
26-
...baseBundleConfig,
27-
output: {
28-
...baseBundleConfig.output,
29-
file: `${baseBundleConfig.output.file}.min.js`,
30-
},
31-
plugins: [...baseBundleConfig.plugins, terserPlugin, licensePlugin],
32-
},
33-
],
34-
);
14+
builds.push(...makeMinificationVariants(baseBundleConfig));
3515
});
3616

3717
export default builds;

packages/browser/src/transports/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export abstract class BaseTransport implements Transport {
226226
}
227227
return true;
228228
} else if (raHeader) {
229-
this._rateLimits.all = new Date(now + parseRetryAfterHeader(now, raHeader));
229+
this._rateLimits.all = new Date(now + parseRetryAfterHeader(raHeader, now));
230230
return true;
231231
}
232232
return false;

packages/integration-tests/utils/generatePlugin.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ const BUNDLE_PATHS: Record<string, Record<string, string>> = {
2929
esm: 'esm/index.js',
3030
bundle_es5: 'build/bundle.tracing.js',
3131
bundle_es5_min: 'build/bundle.tracing.min.js',
32-
// `tracing` doesn't have an es6 build yet
33-
bundle_es6: 'build/bundle.tracing.js',
34-
bundle_es6_min: 'build/bundle.tracing.min.js',
32+
bundle_es6: 'build/bundle.tracing.es6.js',
33+
bundle_es6_min: 'build/bundle.tracing.es6.min.js',
3534
},
3635
};
3736

packages/integrations/rollup.config.js

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,25 @@ import * as fs from 'fs';
22

33
import commonjs from '@rollup/plugin-commonjs';
44

5-
import { makeBaseBundleConfig, terserPlugin } from '../../rollup.config';
6-
7-
function allIntegrations() {
8-
return fs.readdirSync('./src').filter(file => file != 'index.ts');
9-
}
10-
11-
function loadAllIntegrations() {
12-
const builds = [];
13-
14-
allIntegrations().forEach(file => {
15-
const baseBundleConfig = makeBaseBundleConfig({
16-
input: `src/${file}`,
17-
isAddOn: true,
18-
jsVersion: 'es5',
19-
outputFileBase: `build/${file.replace('.ts', '')}`,
20-
});
21-
22-
[
23-
{
24-
extension: '.js',
25-
plugins: [...baseBundleConfig.plugins, commonjs()],
26-
},
27-
{
28-
extension: '.min.js',
29-
plugins: [...baseBundleConfig.plugins, commonjs(), terserPlugin],
30-
},
31-
].forEach(build => {
32-
builds.push({
33-
...baseBundleConfig,
34-
output: {
35-
...baseBundleConfig.output,
36-
file: `${baseBundleConfig.output.file}${build.extension}`,
37-
},
38-
plugins: build.plugins,
39-
});
40-
});
5+
import { insertAt, makeBaseBundleConfig, makeMinificationVariants } from '../../rollup.config';
6+
7+
const builds = [];
8+
9+
const integrationSourceFiles = fs.readdirSync('./src').filter(file => file != 'index.ts');
10+
11+
integrationSourceFiles.forEach(file => {
12+
const baseBundleConfig = makeBaseBundleConfig({
13+
input: `src/${file}`,
14+
isAddOn: true,
15+
jsVersion: 'es5',
16+
licenseTitle: '@sentry/integrations',
17+
outputFileBase: `build/${file.replace('.ts', '')}`,
4118
});
4219

43-
return builds;
44-
}
20+
// TODO We only need `commonjs` for localforage (used in the offline plugin). Once that's fixed, this can come out.
21+
baseBundleConfig.plugins = insertAt(baseBundleConfig.plugins, -2, commonjs());
22+
23+
builds.push(...makeMinificationVariants(baseBundleConfig));
24+
});
4525

46-
export default loadAllIntegrations();
26+
export default builds;

packages/node/src/transports/base/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export abstract class BaseTransport implements Transport {
181181
}
182182
return true;
183183
} else if (raHeader) {
184-
this._rateLimits.all = new Date(now + parseRetryAfterHeader(now, raHeader));
184+
this._rateLimits.all = new Date(now + parseRetryAfterHeader(raHeader, now));
185185
return true;
186186
}
187187
return false;

packages/tracing/rollup.config.js

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
1-
import { makeBaseBundleConfig, makeLicensePlugin, terserPlugin } from '../../rollup.config';
1+
import { makeBaseBundleConfig, makeMinificationVariants } from '../../rollup.config';
22

3-
const licensePlugin = makeLicensePlugin('@sentry/tracing & @sentry/browser');
3+
const builds = [];
44

5-
const baseBundleConfig = makeBaseBundleConfig({
6-
input: 'src/index.bundle.ts',
7-
isAddOn: false,
8-
jsVersion: 'es5',
9-
outputFileBase: 'build/bundle.tracing',
5+
['es5', 'es6'].forEach(jsVersion => {
6+
const baseBundleConfig = makeBaseBundleConfig({
7+
input: 'src/index.bundle.ts',
8+
isAddOn: false,
9+
jsVersion,
10+
licenseTitle: '@sentry/tracing & @sentry/browser',
11+
outputFileBase: `build/bundle.tracing${jsVersion === 'es6' ? '.es6' : ''}`,
12+
});
13+
14+
builds.push(...makeMinificationVariants(baseBundleConfig));
1015
});
1116

12-
export default [
13-
// ES5 Browser Tracing Bundle
14-
{
15-
...baseBundleConfig,
16-
output: {
17-
...baseBundleConfig.output,
18-
file: `${baseBundleConfig.output.file}.js`,
19-
},
20-
plugins: [...baseBundleConfig.plugins, licensePlugin],
21-
},
22-
{
23-
...baseBundleConfig,
24-
output: {
25-
...baseBundleConfig.output,
26-
file: `${baseBundleConfig.output.file}.min.js`,
27-
},
28-
plugins: [...baseBundleConfig.plugins, terserPlugin, licensePlugin],
29-
},
30-
];
17+
export default builds;

packages/utils/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ export * from './tracing';
2424
export * from './env';
2525
export * from './envelope';
2626
export * from './clientreport';
27+
export * from './ratelimit';

packages/utils/src/misc.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -188,31 +188,6 @@ export function parseSemver(input: string): SemVer {
188188
};
189189
}
190190

191-
const defaultRetryAfter = 60 * 1000; // 60 seconds
192-
193-
/**
194-
* Extracts Retry-After value from the request header or returns default value
195-
* @param now current unix timestamp
196-
* @param header string representation of 'Retry-After' header
197-
*/
198-
export function parseRetryAfterHeader(now: number, header?: string | number | null): number {
199-
if (!header) {
200-
return defaultRetryAfter;
201-
}
202-
203-
const headerDelay = parseInt(`${header}`, 10);
204-
if (!isNaN(headerDelay)) {
205-
return headerDelay * 1000;
206-
}
207-
208-
const headerDate = Date.parse(`${header}`);
209-
if (!isNaN(headerDate)) {
210-
return headerDate - now;
211-
}
212-
213-
return defaultRetryAfter;
214-
}
215-
216191
/**
217192
* This function adds context (pre/post/line) lines to the provided frame
218193
*

0 commit comments

Comments
 (0)