Skip to content

Commit ec6bce6

Browse files
authored
Merge branch 'master' into vue-types
2 parents d000285 + 4e552ec commit ec6bce6

39 files changed

+590
-61
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
## Unreleased
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
6+
- [react] feat: Add @sentry/react package (#2631)
7+
8+
## 5.16.1
9+
10+
- [node] fix: Requests to old `/store` endpoint need the `x-sentry-auth` header in node (#2637)
611

712
## 5.16.0
813

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lerna": "3.4.0",
3-
"version": "5.16.0",
3+
"version": "5.16.1",
44
"packages": "packages/*",
55
"npmClient": "yarn",
66
"useWorkspaces": true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"packages/integrations",
2727
"packages/minimal",
2828
"packages/node",
29-
"packages/opentracing",
29+
"packages/react",
3030
"packages/types",
3131
"packages/typescript",
3232
"packages/utils"

packages/apm/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/apm",
3-
"version": "5.16.0",
3+
"version": "5.16.1",
44
"description": "Extensions for APM",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/apm",
@@ -16,11 +16,11 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/browser": "5.16.0",
20-
"@sentry/hub": "5.16.0",
21-
"@sentry/minimal": "5.16.0",
22-
"@sentry/types": "5.16.0",
23-
"@sentry/utils": "5.16.0",
19+
"@sentry/browser": "5.16.1",
20+
"@sentry/hub": "5.16.1",
21+
"@sentry/minimal": "5.16.1",
22+
"@sentry/types": "5.16.1",
23+
"@sentry/utils": "5.16.1",
2424
"tslib": "^1.9.3"
2525
},
2626
"devDependencies": {

packages/browser/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/browser",
3-
"version": "5.16.0",
3+
"version": "5.16.1",
44
"description": "Official Sentry SDK for browsers",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -16,9 +16,9 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/core": "5.16.0",
20-
"@sentry/types": "5.16.0",
21-
"@sentry/utils": "5.16.0",
19+
"@sentry/core": "5.16.1",
20+
"@sentry/types": "5.16.1",
21+
"@sentry/utils": "5.16.1",
2222
"tslib": "^1.9.3"
2323
},
2424
"devDependencies": {

packages/browser/src/transports/fetch.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export class FetchTransport extends BaseTransport {
3535
referrerPolicy: (supportsReferrerPolicy() ? 'origin' : '') as ReferrerPolicy,
3636
};
3737

38+
if (this.options.fetchParameters !== undefined) {
39+
Object.assign(options, this.options.fetchParameters);
40+
}
41+
3842
if (this.options.headers !== undefined) {
3943
options.headers = this.options.headers;
4044
}

packages/browser/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export const SDK_NAME = 'sentry.javascript.browser';
2-
export const SDK_VERSION = '5.16.0';
2+
export const SDK_VERSION = '5.16.1';

packages/browser/test/unit/transports/fetch.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,5 +156,29 @@ describe('FetchTransport', () => {
156156
}),
157157
).equal(true);
158158
});
159+
160+
it('passes in fetch parameters', async () => {
161+
transport = new Transports.FetchTransport({
162+
dsn: testDsn,
163+
fetchParameters: {
164+
credentials: 'include',
165+
},
166+
});
167+
const response = { status: 200 };
168+
169+
fetch.returns(Promise.resolve(response));
170+
171+
const res = await transport.sendEvent(payload);
172+
173+
expect(res.status).equal(Status.Success);
174+
expect(
175+
fetch.calledWith(transportUrl, {
176+
body: JSON.stringify(payload),
177+
credentials: 'include',
178+
method: 'POST',
179+
referrerPolicy: 'origin',
180+
}),
181+
).equal(true);
182+
});
159183
});
160184
});

packages/core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/core",
3-
"version": "5.16.0",
3+
"version": "5.16.1",
44
"description": "Base implementation for all Sentry JavaScript SDKs",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
@@ -16,10 +16,10 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/hub": "5.16.0",
20-
"@sentry/minimal": "5.16.0",
21-
"@sentry/types": "5.16.0",
22-
"@sentry/utils": "5.16.0",
19+
"@sentry/hub": "5.16.1",
20+
"@sentry/minimal": "5.16.1",
21+
"@sentry/types": "5.16.1",
22+
"@sentry/utils": "5.16.1",
2323
"tslib": "^1.9.3"
2424
},
2525
"devDependencies": {

packages/core/src/api.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ export class API {
8080

8181
/**
8282
* Returns an object that can be used in request headers.
83-
*
84-
* @deprecated in favor of `getStoreEndpointWithUrlEncodedAuth` and `getEnvelopeEndpointWithUrlEncodedAuth`.
83+
* This is needed for node and the old /store endpoint in sentry
8584
*/
8685
public getRequestHeaders(clientName: string, clientVersion: string): { [key: string]: string } {
8786
const dsn = this._dsnObject;

packages/core/test/lib/base.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { TestClient } from '../mocks/client';
77
import { TestIntegration } from '../mocks/integration';
88
import { FakeTransport } from '../mocks/transport';
99

10-
const PUBLIC_DSN = 'https://username@domain/path';
10+
const PUBLIC_DSN = 'https://username@domain/123';
1111
declare var global: any;
1212

1313
jest.mock('@sentry/utils', () => {

packages/core/test/lib/sdk.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { TestClient } from '../mocks/client';
66

77
declare var global: any;
88

9-
const PUBLIC_DSN = 'https://username@domain/path';
9+
const PUBLIC_DSN = 'https://username@domain/123';
1010

1111
jest.mock('@sentry/hub', () => ({
1212
getCurrentHub(): {

packages/hub/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/hub",
3-
"version": "5.16.0",
3+
"version": "5.16.1",
44
"description": "Sentry hub which handles global state managment.",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/hub",
@@ -16,8 +16,8 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/types": "5.16.0",
20-
"@sentry/utils": "5.16.0",
19+
"@sentry/types": "5.16.1",
20+
"@sentry/utils": "5.16.1",
2121
"tslib": "^1.9.3"
2222
},
2323
"devDependencies": {

packages/integrations/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/integrations",
3-
"version": "5.16.0",
3+
"version": "5.16.1",
44
"description": "Pluggable integrations that can be used to enhance JS SDKs",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/integrations",
@@ -16,8 +16,8 @@
1616
"module": "esm/index.js",
1717
"types": "dist/index.d.ts",
1818
"dependencies": {
19-
"@sentry/types": "5.16.0",
20-
"@sentry/utils": "5.16.0",
19+
"@sentry/types": "5.16.1",
20+
"@sentry/utils": "5.16.1",
2121
"tslib": "^1.9.3"
2222
},
2323
"devDependencies": {

packages/minimal/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/minimal",
3-
"version": "5.16.0",
3+
"version": "5.16.1",
44
"description": "Sentry minimal library that can be used in other packages",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/minimal",
@@ -16,8 +16,8 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/hub": "5.16.0",
20-
"@sentry/types": "5.16.0",
19+
"@sentry/hub": "5.16.1",
20+
"@sentry/types": "5.16.1",
2121
"tslib": "^1.9.3"
2222
},
2323
"devDependencies": {

packages/node/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/node",
3-
"version": "5.16.0",
3+
"version": "5.16.1",
44
"description": "Offical Sentry SDK for Node.js",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -16,11 +16,11 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/apm": "5.16.0",
20-
"@sentry/core": "5.16.0",
21-
"@sentry/hub": "5.16.0",
22-
"@sentry/types": "5.16.0",
23-
"@sentry/utils": "5.16.0",
19+
"@sentry/apm": "5.16.1",
20+
"@sentry/core": "5.16.1",
21+
"@sentry/hub": "5.16.1",
22+
"@sentry/types": "5.16.1",
23+
"@sentry/utils": "5.16.1",
2424
"cookie": "^0.3.1",
2525
"https-proxy-agent": "^4.0.0",
2626
"lru_map": "^0.3.3",

packages/node/src/transports/base.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as http from 'http';
66
import * as https from 'https';
77
import * as url from 'url';
88

9-
// import { SDK_NAME, SDK_VERSION } from '../version';
9+
import { SDK_NAME, SDK_VERSION } from '../version';
1010

1111
/**
1212
* Internal used interface for typescript.
@@ -59,14 +59,13 @@ export abstract class BaseTransport implements Transport {
5959
/** Returns a build request option object used by request */
6060
protected _getRequestOptions(uri: url.URL): http.RequestOptions | https.RequestOptions {
6161
const headers = {
62-
// The auth headers are not included because auth is done via query string to match @sentry/browser.
63-
//
64-
// ...this._api.getRequestHeaders(SDK_NAME, SDK_VERSION)
62+
...this._api.getRequestHeaders(SDK_NAME, SDK_VERSION),
6563
...this.options.headers,
6664
};
67-
const { hostname, pathname, port, protocol, search } = uri;
65+
const { hostname, pathname, port, protocol } = uri;
6866
// See https://github.com/nodejs/node/blob/38146e717fed2fabe3aacb6540d839475e0ce1c6/lib/internal/url.js#L1268-L1290
69-
const path = `${pathname}${search}`;
67+
// We ignore the query string on purpose
68+
const path = `${pathname}`;
7069

7170
return {
7271
agent: this.client,

packages/node/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export const SDK_NAME = 'sentry.javascript.node';
2-
export const SDK_VERSION = '5.16.0';
2+
export const SDK_VERSION = '5.16.1';

packages/node/test/transports/http.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { HTTPTransport } from '../../src/transports/http';
66

77
const mockSetEncoding = jest.fn();
88
const dsn = 'http://[email protected]:8989/mysubpath/50622';
9-
const transportPath = '/mysubpath/api/50622/store/?sentry_key=9e9fd4523d784609a5fc0ebb1080592f&sentry_version=7';
9+
const transportPath = '/mysubpath/api/50622/store/';
1010
let mockReturnCode = 200;
1111
let mockHeaders = {};
1212

@@ -28,7 +28,7 @@ function createTransport(options: TransportOptions): HTTPTransport {
2828
}
2929

3030
function assertBasicOptions(options: any): void {
31-
expect(options.headers).not.toContain('X-Sentry-Auth'); // auth is part of the query string
31+
expect(options.headers['X-Sentry-Auth']).toBeTruthy();
3232
expect(options.port).toEqual('8989');
3333
expect(options.path).toEqual(transportPath);
3434
expect(options.hostname).toEqual('sentry.io');

packages/node/test/transports/https.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { HTTPSTransport } from '../../src/transports/https';
66

77
const mockSetEncoding = jest.fn();
88
const dsn = 'https://[email protected]:8989/mysubpath/50622';
9-
const transportPath = '/mysubpath/api/50622/store/?sentry_key=9e9fd4523d784609a5fc0ebb1080592f&sentry_version=7';
9+
const transportPath = '/mysubpath/api/50622/store/';
1010
let mockReturnCode = 200;
1111
let mockHeaders = {};
1212

@@ -34,7 +34,7 @@ function createTransport(options: TransportOptions): HTTPSTransport {
3434
}
3535

3636
function assertBasicOptions(options: any): void {
37-
expect(options.headers).not.toContain('X-Sentry-Auth'); // auth is part of the query string
37+
expect(options.headers['X-Sentry-Auth']).toBeTruthy();
3838
expect(options.port).toEqual('8989');
3939
expect(options.path).toEqual(transportPath);
4040
expect(options.hostname).toEqual('sentry.io');

packages/react/.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!/dist/**/*
3+
!/esm/**/*
4+
*.tsbuildinfo

packages/react/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019, Sentry
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/react/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<p align="center">
2+
<a href="https://sentry.io" target="_blank" align="center">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4+
</a>
5+
<br />
6+
</p>
7+
8+
# Official Sentry SDK for ReactJS
9+
10+
## Links
11+
12+
- [Official SDK Docs](https://docs.sentry.io/quickstart/)
13+
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)

0 commit comments

Comments
 (0)