@sentry/ember 7.0.0-beta.0 → 7.0.0-rc.0

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 CHANGED
@@ -1,8 +1,7 @@
1
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">
2
+ <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3
+ <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4
4
  </a>
5
- <br />
6
5
  </p>
7
6
 
8
7
  # Official Sentry SDK for Ember.js
@@ -380,7 +380,22 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
380
380
  }),
381
381
  ];
382
382
 
383
- if (isTesting() && Sentry.getCurrentHub()?.getIntegration(tracing.Integrations.BrowserTracing)) {
383
+ class FakeBrowserTracingClass {
384
+ static id = tracing.BROWSER_TRACING_INTEGRATION_ID;
385
+ public name = FakeBrowserTracingClass.id;
386
+ setupOnce() {
387
+ // noop - We're just faking this class for a lookup
388
+ }
389
+ }
390
+
391
+ if (
392
+ isTesting() &&
393
+ Sentry.getCurrentHub()?.getIntegration(
394
+ // This is a temporary hack because the BrowserTracing integration cannot have a static `id` field for tree
395
+ // shaking reasons. However, `getIntegration` needs that field.
396
+ FakeBrowserTracingClass,
397
+ )
398
+ ) {
384
399
  // Initializers are called more than once in tests, causing the integrations to not be setup correctly.
385
400
  return;
386
401
  }
package/index.d.ts CHANGED
@@ -13,4 +13,3 @@ export declare const instrumentRoutePerformance: (BaseRoute: any) => {
13
13
  };
14
14
  export * from '@sentry/browser';
15
15
  export declare const init: typeof InitSentryForEmber;
16
- //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -1,10 +1,21 @@
1
1
  'use strict';
2
2
  const fs = require('fs');
3
+ const crypto = require('crypto');
3
4
 
4
5
  function readSnippet(fileName) {
5
- return `<script>${fs.readFileSync(`${__dirname}/vendor/${fileName}`, 'utf8')}</script>`;
6
+ return fs.readFileSync(`${__dirname}/vendor/${fileName}`, 'utf8');
6
7
  }
7
8
 
9
+ function hashSha256base64(string) {
10
+ return crypto.createHash('sha256').update(string).digest('base64');
11
+ }
12
+
13
+ const initialLoadHeadSnippet = readSnippet('initial-load-head.js');
14
+ const initialLoadBodySnippet = readSnippet('initial-load-body.js');
15
+
16
+ const initialLoadHeadSnippetHash = hashSha256base64(initialLoadHeadSnippet);
17
+ const initialLoadBodySnippetHash = hashSha256base64(initialLoadBodySnippet);
18
+
8
19
  module.exports = {
9
20
  name: require('./package').name,
10
21
  options: {
@@ -24,16 +35,18 @@ module.exports = {
24
35
 
25
36
  contentFor(type, config) {
26
37
  const addonConfig = config['@sentry/ember'] || {};
27
-
28
38
  const { disablePerformance, disableInitialLoadInstrumentation } = addonConfig;
39
+
29
40
  if (disablePerformance || disableInitialLoadInstrumentation) {
30
41
  return;
31
42
  }
43
+
32
44
  if (type === 'head') {
33
- return readSnippet('initial-load-head.js');
34
- }
35
- if (type === 'body-footer') {
36
- return readSnippet('initial-load-body.js');
45
+ return `<script type="text/javascript">${initialLoadHeadSnippet}</script>`;
46
+ } else if (type === 'body-footer') {
47
+ return `<script type="text/javascript">${initialLoadBodySnippet}</script>`;
37
48
  }
38
49
  },
50
+
51
+ injectedScriptHashes: [initialLoadHeadSnippetHash, initialLoadBodySnippetHash],
39
52
  };
@@ -9,4 +9,3 @@ declare const _default: {
9
9
  initialize: typeof initialize;
10
10
  };
11
11
  export default _default;
12
- //# sourceMappingURL=sentry-performance.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/ember",
3
- "version": "7.0.0-beta.0",
3
+ "version": "7.0.0-rc.0",
4
4
  "description": "Official Sentry SDK for Ember.js",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/ember",
@@ -18,8 +18,9 @@
18
18
  },
19
19
  "scripts": {
20
20
  "build": "ember build --environment=production",
21
+ "build:extras": "yarn build",
21
22
  "build:npm": "ember ts:precompile && npm pack && ember ts:clean",
22
- "link:yarn": "yarn link",
23
+ "clean": "yarn rimraf sentry-ember-*.tgz",
23
24
  "lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
24
25
  "lint:hbs": "ember-template-lint .",
25
26
  "lint:js": "eslint . --cache --cache-location '../../eslintcache/'",
@@ -29,10 +30,10 @@
29
30
  },
30
31
  "dependencies": {
31
32
  "@embroider/macros": "~0.47.2",
32
- "@sentry/browser": "7.0.0-beta.0",
33
- "@sentry/tracing": "7.0.0-beta.0",
34
- "@sentry/types": "7.0.0-beta.0",
35
- "@sentry/utils": "7.0.0-beta.0",
33
+ "@sentry/browser": "7.0.0-rc.0",
34
+ "@sentry/tracing": "7.0.0-rc.0",
35
+ "@sentry/types": "7.0.0-rc.0",
36
+ "@sentry/utils": "7.0.0-rc.0",
36
37
  "ember-auto-import": "~1.12.1 || ~2.2.0",
37
38
  "ember-cli-babel": "~7.26.6",
38
39
  "ember-cli-htmlbars": "^6.0.1",
package/types.d.ts CHANGED
@@ -21,4 +21,3 @@ export declare type OwnConfig = {
21
21
  export declare type GlobalConfig = {
22
22
  __sentryEmberConfig: EmberSentryConfig['sentry'];
23
23
  };
24
- //# sourceMappingURL=types.d.ts.map