@sentry/gatsby 7.107.0 → 8.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -34
- package/cjs/index.js +10 -3
- package/cjs/index.js.map +1 -1
- package/esm/package.json +1 -0
- package/gatsby-browser.js +2 -5
- package/package.json +20 -7
package/README.md
CHANGED
|
@@ -13,17 +13,19 @@ module.exports = {
|
|
|
13
13
|
// ...
|
|
14
14
|
plugins: [
|
|
15
15
|
{
|
|
16
|
-
resolve:
|
|
16
|
+
resolve: '@sentry/gatsby',
|
|
17
17
|
options: {
|
|
18
|
-
|
|
19
|
-
}
|
|
18
|
+
dsn: process.env.SENTRY_DSN, // this is the default
|
|
19
|
+
},
|
|
20
20
|
},
|
|
21
21
|
// ...
|
|
22
|
-
]
|
|
23
|
-
}
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Options will be passed directly to `Sentry.init`. See all available options in
|
|
26
|
+
Options will be passed directly to `Sentry.init`. See all available options in
|
|
27
|
+
[our docs](https://docs.sentry.io/error-reporting/configuration/?platform=javascript). The `environment` value defaults
|
|
28
|
+
to `NODE_ENV` (or `'development'` if `NODE_ENV` is not set).
|
|
27
29
|
|
|
28
30
|
## GitHub Actions
|
|
29
31
|
|
|
@@ -35,18 +37,21 @@ The `release` value is inferred from `COMMIT_REF`.
|
|
|
35
37
|
|
|
36
38
|
## Vercel
|
|
37
39
|
|
|
38
|
-
To automatically capture the `release` value on Vercel you will need to register appropriate
|
|
40
|
+
To automatically capture the `release` value on Vercel you will need to register appropriate
|
|
41
|
+
[system environment variable](https://vercel.com/docs/v2/build-step#system-environment-variables) (e.g.
|
|
42
|
+
`VERCEL_GITHUB_COMMIT_SHA`) in your project.
|
|
39
43
|
|
|
40
44
|
## Sentry Performance
|
|
41
45
|
|
|
42
|
-
To enable tracing, supply either `tracesSampleRate` or `tracesSampler` to the options. This will turn on the
|
|
46
|
+
To enable tracing, supply either `tracesSampleRate` or `tracesSampler` to the options. This will turn on the
|
|
47
|
+
`BrowserTracing` integration for automatic instrumentation of pageloads and navigations.
|
|
43
48
|
|
|
44
49
|
```javascript
|
|
45
50
|
module.exports = {
|
|
46
51
|
// ...
|
|
47
52
|
plugins: [
|
|
48
53
|
{
|
|
49
|
-
resolve:
|
|
54
|
+
resolve: '@sentry/gatsby',
|
|
50
55
|
options: {
|
|
51
56
|
dsn: process.env.SENTRY_DSN, // this is the default
|
|
52
57
|
|
|
@@ -60,24 +65,21 @@ module.exports = {
|
|
|
60
65
|
// for this transaction.
|
|
61
66
|
// Can return 0 to drop the transaction entirely.
|
|
62
67
|
|
|
63
|
-
if (
|
|
64
|
-
return 0.5 // These are important - take a big sample
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
else
|
|
70
|
-
return 0 //
|
|
68
|
+
if ('...') {
|
|
69
|
+
return 0.5; // These are important - take a big sample
|
|
70
|
+
} else if ('...') {
|
|
71
|
+
return 0.01; // These are less important or happen much more frequently - only take 1% of them
|
|
72
|
+
} else if ('...') {
|
|
73
|
+
return 0; // These aren't something worth tracking - drop all transactions like this
|
|
74
|
+
} else {
|
|
75
|
+
return 0.1; // Default sample rate
|
|
71
76
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
+
},
|
|
78
|
+
},
|
|
77
79
|
},
|
|
78
80
|
// ...
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
+
],
|
|
82
|
+
};
|
|
81
83
|
```
|
|
82
84
|
|
|
83
85
|
If you want to supply options to the `BrowserTracing` integration, use the `browserTracingOptions` parameter.
|
|
@@ -87,19 +89,19 @@ module.exports = {
|
|
|
87
89
|
// ...
|
|
88
90
|
plugins: [
|
|
89
91
|
{
|
|
90
|
-
resolve:
|
|
92
|
+
resolve: '@sentry/gatsby',
|
|
91
93
|
options: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
94
|
+
dsn: process.env.SENTRY_DSN, // this is the default
|
|
95
|
+
tracesSampleRate: 1, // or tracesSampler (see above)
|
|
96
|
+
browserTracingOptions: {
|
|
97
|
+
// disable creating spans for XHR requests
|
|
98
|
+
traceXHR: false,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
99
101
|
},
|
|
100
102
|
// ...
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
+
],
|
|
104
|
+
};
|
|
103
105
|
```
|
|
104
106
|
|
|
105
107
|
## Links
|
package/cjs/index.js
CHANGED
|
@@ -6,7 +6,14 @@ const sdk = require('./sdk.js');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
exports.init = sdk.init;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Object.prototype.hasOwnProperty.call(react, '__proto__') &&
|
|
10
|
+
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
11
|
+
Object.defineProperty(exports, '__proto__', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
value: react['__proto__']
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
Object.keys(react).forEach(k => {
|
|
17
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = react[k];
|
|
18
|
+
});
|
|
12
19
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
package/esm/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "module" }
|
package/gatsby-browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import { init } from '@sentry/gatsby';
|
|
2
|
+
import { getClient, init } from '@sentry/gatsby';
|
|
3
3
|
|
|
4
4
|
export function onClientEntry(_, pluginParams) {
|
|
5
5
|
const isIntialized = isSentryInitialized();
|
|
@@ -32,10 +32,7 @@ export function onClientEntry(_, pluginParams) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function isSentryInitialized() {
|
|
35
|
-
|
|
36
|
-
// is run), and `__SENTRY__.hub` is created when importing the Gatsby SDK, double
|
|
37
|
-
// check that in case something weird happens.
|
|
38
|
-
return !!(window && window.__SENTRY__ && window.__SENTRY__.hub && window.__SENTRY__.hub.getClient());
|
|
35
|
+
return !!getClient();
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
function areSentryOptionsDefined(params) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/gatsby",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.4",
|
|
4
4
|
"description": "Official Sentry SDK for Gatsby.js",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"gatsby-plugin"
|
|
12
12
|
],
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">=14.18"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"cjs",
|
|
@@ -26,6 +26,19 @@
|
|
|
26
26
|
"main": "cjs/index.js",
|
|
27
27
|
"module": "esm/index.js",
|
|
28
28
|
"types": "types/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
"./package.json": "./package.json",
|
|
31
|
+
".": {
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./types/index.d.ts",
|
|
34
|
+
"default": "./esm/index.js"
|
|
35
|
+
},
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./types/index.d.ts",
|
|
38
|
+
"default": "./cjs/index.js"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
29
42
|
"typesVersions": {
|
|
30
43
|
"<4.9": {
|
|
31
44
|
"types/index.d.ts": [
|
|
@@ -37,15 +50,15 @@
|
|
|
37
50
|
"access": "public"
|
|
38
51
|
},
|
|
39
52
|
"dependencies": {
|
|
40
|
-
"@sentry/core": "
|
|
41
|
-
"@sentry/react": "
|
|
42
|
-
"@sentry/types": "
|
|
43
|
-
"@sentry/utils": "
|
|
53
|
+
"@sentry/core": "8.0.0-alpha.4",
|
|
54
|
+
"@sentry/react": "8.0.0-alpha.4",
|
|
55
|
+
"@sentry/types": "8.0.0-alpha.4",
|
|
56
|
+
"@sentry/utils": "8.0.0-alpha.4",
|
|
44
57
|
"@sentry/webpack-plugin": "1.19.0"
|
|
45
58
|
},
|
|
46
59
|
"peerDependencies": {
|
|
47
60
|
"gatsby": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0",
|
|
48
|
-
"react": "
|
|
61
|
+
"react": "16.x || 17.x || 18.x"
|
|
49
62
|
},
|
|
50
63
|
"devDependencies": {
|
|
51
64
|
"@testing-library/react": "^13.0.0",
|