Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ env:
${{ github.workspace }}/dev-packages/*/build
${{ github.workspace }}/packages/*/build
${{ github.workspace }}/packages/*/lib
${{ github.workspace }}/packages/ember/*.d.ts
${{ github.workspace }}/packages/ember/dist
${{ github.workspace }}/packages/ember/declarations
${{ github.workspace }}/packages/gatsby/*.d.ts
BUILD_CACHE_TARBALL_KEY: tarball-${{ github.event.inputs.commit || github.sha }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ import Resolver from 'ember-resolver';
import config from './config/environment';

Sentry.init({
dsn: config.sentryDsn,
tracesSampleRate: 1,
replaysSessionSampleRate: 1,
replaysOnErrorSampleRate: 1,
browserTracingOptions: {
_experiments: {
// Long-task spans are noisy in e2e and make assertions flaky.
enableLongTask: false,
},
},
tracePropagationTargets: ['localhost', 'doesntexist.example'],
Comment thread
cursor[bot] marked this conversation as resolved.
tunnel: `http://localhost:3031/`, // proxy server
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare const config: {
podModulePrefix: string;
locationType: 'history' | 'hash' | 'none' | 'auto';
rootURL: string;
sentryDsn: string;
APP: Record<string, unknown>;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<script>if(window.performance&&window.performance.mark){window.performance.mark('@sentry/ember:initial-load-start');}</script>
Comment thread
aklkv marked this conversation as resolved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly if we are doing such a big refactor I'd just drop this stuff as built-in functionality - you can build this yourself if needed but likely for simplicity this can go away.


{{content-for "head"}}

<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css" />
Expand All @@ -19,6 +21,8 @@
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/ember-classic.js"></script>

<script>if(window.performance&&window.performance.mark){window.performance.mark('@sentry/ember:initial-load-end');}</script>

{{content-for "body-footer"}}
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type ApplicationInstance from '@ember/application/instance';
import { setupPerformance } from '@sentry/ember';

export function initialize(appInstance: ApplicationInstance): void {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I am taking another look over this as we are getting closer to planning the next major, where this could go in.

Ideally, we'd align this more closely with how we handle sentry init in other places as well - which would be, to keep things centralized in Sentry.init(). Is there a way we can make this work reliably? I am thinking of something like this:

// app.ts
export default class App extends Application {
  modulePrefix = config.modulePrefix;
  podModulePrefix = config.podModulePrefix;
  Resolver = Resolver;
}

Sentry.init({
  // ...
  integrations: [
    Sentry.browserTracingIntegration({ emberApp: App })
  ]
});

and somehow derive/wrap the necessary thing inside of this? That would be the ideal solution IMHO, or something along these lines. then we can also get rid of all the async import and special options for performance etc. and just pass this directly to the (ember-specific) browser tracing integration 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or alternatively, if this cannot be made to work nicely, we could also do this in the initializer, which would be more "sentry native":

import * as Sentry from '@sentry/ember';

export function initialize(appInstance) {
  Sentry.addIntegration(Sentry.browserTracingIntegration({ 
    appInstance,
    // other options here
  }); 
}

this would possibly loose tiny bits of timing info but should overall be likely OK...

Then, we need to export a custom browserTracingIntegration from the ember package here, similar to e.g. the vue browserTracingIntegration, where we can run the actual logic.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into PRing into this PR some changes for this!

setupPerformance(appInstance, {
minimumRunloopQueueDuration: 0,
minimumComponentRenderDuration: 0,
});
}
Comment thread
aklkv marked this conversation as resolved.

export default {
initialize,
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,7 @@ module.exports = function (environment) {
},
};

ENV['@sentry/ember'] = {
sentry: {
tracesSampleRate: 1,
dsn: process.env.E2E_TEST_DSN,
tracePropagationTargets: ['localhost', 'doesntexist.example'],
browserTracingOptions: {
_experiments: {
// This lead to some flaky tests, as that is sometimes logged
enableLongTask: false,
},
},
},
ignoreEmberOnErrorWarning: true,
minimumRunloopQueueDuration: 0,
minimumComponentRenderDuration: 0,
};
ENV.sentryDsn = process.env.E2E_TEST_DSN;

if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';

Sentry.init({
dsn: config.sentryDsn,
tracesSampleRate: 1,
replaysSessionSampleRate: 1,
replaysOnErrorSampleRate: 1,
browserTracingOptions: {
_experiments: {
// Long-task spans are noisy in e2e and make assertions flaky.
enableLongTask: false,
},
},
tracePropagationTargets: ['localhost', 'doesntexist.example'],
tunnel: `http://localhost:3031/`, // proxy server
});
export default class App extends Application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare const config: {
podModulePrefix: string;
locationType: 'history' | 'hash' | 'none' | 'auto';
rootURL: string;
sentryDsn: string;
APP: Record<string, unknown>;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<script>if(window.performance&&window.performance.mark){window.performance.mark('@sentry/ember:initial-load-start');}</script>

{{content-for "head"}}

<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css" />
Expand All @@ -19,6 +21,8 @@
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/ember-embroider.js"></script>

<script>if(window.performance&&window.performance.mark){window.performance.mark('@sentry/ember:initial-load-end');}</script>

{{content-for "body-footer"}}
</body>
</html>
Comment thread
aklkv marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type ApplicationInstance from '@ember/application/instance';
import { setupPerformance } from '@sentry/ember';

export function initialize(appInstance: ApplicationInstance): void {
setupPerformance(appInstance, {
minimumRunloopQueueDuration: 0,
minimumComponentRenderDuration: 0,
});
}

export default {
initialize,
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,7 @@ module.exports = function (environment) {
},
};

ENV['@sentry/ember'] = {
sentry: {
tracesSampleRate: 1,
dsn: process.env.E2E_TEST_DSN,
tracePropagationTargets: ['localhost', 'doesntexist.example'],
browserTracingOptions: {
_experiments: {
// This lead to some flaky tests, as that is sometimes logged
enableLongTask: false,
},
},
},
ignoreEmberOnErrorWarning: true,
minimumRunloopQueueDuration: 0,
minimumComponentRenderDuration: 0,
};
ENV.sentryDsn = process.env.E2E_TEST_DSN;

if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
Expand Down
19 changes: 19 additions & 0 deletions packages/ember/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
15 changes: 0 additions & 15 deletions packages/ember/.ember-cli

This file was deleted.

8 changes: 8 additions & 0 deletions packages/ember/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file is committed to git and should not contain any secrets.
#
# Vite recommends using .env.local or .env.[mode].local if you need to manage secrets
# SEE: https://vite.dev/guide/env-and-mode.html#env-files for more information.


# Default NODE_ENV with vite build --mode=test is production
NODE_ENV=development
48 changes: 16 additions & 32 deletions packages/ember/.gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/
dist/
dist-tests/
declarations/

# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
# from scenarios
tmp/
config/optional-features.json
ember-cli-build.cjs

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
# npm/pnpm/yarn pack output
*.tgz

# broccoli-debug
/DEBUG/
# deps & caches
node_modules/
.eslintcache
.prettiercache
.npm-deps/

# These get created when packaging
/instance-initializers
index.d.ts
runloop.d.ts
types.d.ts
# potentially containing secrets
*.local
38 changes: 0 additions & 38 deletions packages/ember/.npmignore

This file was deleted.

16 changes: 16 additions & 0 deletions packages/ember/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/
/dist-*/
/declarations/

# misc
/coverage/
pnpm-lock.yaml
config/ember-cli-update.json
*.yaml
*.yml
*.md
*.html
12 changes: 12 additions & 0 deletions packages/ember/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
plugins: ['prettier-plugin-ember-template-tag'],
overrides: [
{
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
options: {
singleQuote: true,
templateSingleQuote: false,
},
},
],
};
5 changes: 0 additions & 5 deletions packages/ember/.template-lintrc.js

This file was deleted.

4 changes: 4 additions & 0 deletions packages/ember/.template-lintrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
extends: 'recommended',
checkHbsTemplateLiterals: false,
};
3 changes: 0 additions & 3 deletions packages/ember/.watchmanconfig

This file was deleted.

21 changes: 0 additions & 21 deletions packages/ember/LICENSE

This file was deleted.

Loading