Skip to content

Commit d5cafe5

Browse files
committed
WIP
1 parent d381ace commit d5cafe5

File tree

99 files changed

+2712
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2712
-44
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,8 @@ jobs:
10011001
'create-remix-app-express',
10021002
'create-remix-app-express-vite-dev',
10031003
'debug-id-sourcemaps',
1004+
'ember-classic',
1005+
'ember-embroider',
10041006
# 'esm-loader-node-express-app', # This is currently broken for upstream reasons. See https://github.com/getsentry/sentry-javascript/pull/11338#issuecomment-2025450675
10051007
'nextjs-app-dir',
10061008
'nextjs-14',

.github/workflows/canary.yml

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ jobs:
8989
- test-application: 'standard-frontend-react'
9090
build-command: 'test:build-canary'
9191
label: 'standard-frontend-react (canary)'
92+
- test-application: 'ember-classic'
93+
build-command: 'test:build-latest'
94+
label: 'ember-classic (latest)'
95+
- test-application: 'ember-embroider'
96+
build-command: 'test:build-latest'
97+
label: 'ember-embroider (latest)'
9298

9399
steps:
94100
- name: Check out current commit
@@ -145,44 +151,3 @@ jobs:
145151
with:
146152
filename: .github/CANARY_FAILURE_TEMPLATE.md
147153
update_existing: true
148-
149-
job_ember_canary_test:
150-
name: Ember Canary Tests
151-
runs-on: ubuntu-20.04
152-
timeout-minutes: 30
153-
strategy:
154-
fail-fast: false
155-
matrix:
156-
scenario: [ember-release, embroider-optimized, ember-4.0]
157-
steps:
158-
- name: 'Check out current commit'
159-
uses: actions/checkout@v4
160-
with:
161-
ref: ${{ env.HEAD_COMMIT }}
162-
- name: Set up Node
163-
uses: actions/setup-node@v4
164-
with:
165-
node-version-file: 'package.json'
166-
- name: Install dependencies
167-
run: yarn install --ignore-engines --frozen-lockfile
168-
169-
- name: Build dependencies
170-
run: |
171-
yarn lerna run build:types --scope=@sentry/ember --include-dependencies
172-
yarn lerna run build:transpile --scope=@sentry/ember --include-dependencies
173-
174-
- name: Run Ember tests
175-
run: |
176-
cd packages/ember
177-
yarn ember try:one ${{ matrix.scenario }} --skip-cleanup=true
178-
179-
- name: Create Issue
180-
if: failure() && github.event_name == 'schedule'
181-
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5
182-
env:
183-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
184-
RUN_LINK: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
185-
TITLE: Ember Canary ${{ matrix.scenario }} Test Failed
186-
with:
187-
filename: .github/CANARY_FAILURE_TEMPLATE.md
188-
update_existing: true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.hbs]
16+
insert_final_newline = false
17+
18+
[*.{diff,md}]
19+
trim_trailing_whitespace = false
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
/**
3+
Ember CLI sends analytics information by default. The data is completely
4+
anonymous, but there are times when you might want to disable this behavior.
5+
6+
Setting `disableAnalytics` to true will prevent any data from being sent.
7+
*/
8+
"disableAnalytics": false,
9+
10+
/**
11+
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
12+
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
13+
*/
14+
"isTypeScriptProject": false
15+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist/
5+
/tmp/
6+
7+
# dependencies
8+
/bower_components/
9+
/node_modules/
10+
11+
# misc
12+
/.env*
13+
/.pnp*
14+
/.sass-cache
15+
/.eslintcache
16+
/connect.lock
17+
/coverage/
18+
/libpeerconnection.log
19+
/npm-debug.log*
20+
/testem.log
21+
/yarn-error.log
22+
23+
# ember-try
24+
/.node_modules.ember-try/
25+
/bower.json.ember-try
26+
/npm-shrinkwrap.json.ember-try
27+
/package.json.ember-try
28+
/package-lock.json.ember-try
29+
/yarn.lock.ember-try
30+
31+
# broccoli-debug
32+
/DEBUG/
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignore_dirs": ["tmp", "dist"]
3+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# ember-classic
2+
3+
This README outlines the details of collaborating on this Ember application.
4+
A short introduction of this app could easily go here.
5+
6+
## Prerequisites
7+
8+
You will need the following things properly installed on your computer.
9+
10+
* [Git](https://git-scm.com/)
11+
* [Node.js](https://nodejs.org/) (with npm)
12+
* [Ember CLI](https://cli.emberjs.com/release/)
13+
* [Google Chrome](https://google.com/chrome/)
14+
15+
## Installation
16+
17+
* `git clone <repository-url>` this repository
18+
* `cd ember-classic`
19+
* `npm install`
20+
21+
## Running / Development
22+
23+
* `ember serve`
24+
* Visit your app at [http://localhost:4200](http://localhost:4200).
25+
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
26+
27+
### Code Generators
28+
29+
Make use of the many generators for code, try `ember help generate` for more details
30+
31+
### Running Tests
32+
33+
* `ember test`
34+
* `ember test --server`
35+
36+
### Linting
37+
38+
* `npm run lint`
39+
* `npm run lint:fix`
40+
41+
### Building
42+
43+
* `ember build` (development)
44+
* `ember build --environment production` (production)
45+
46+
### Deploying
47+
48+
Specify what it takes to deploy your app.
49+
50+
## Further Reading / Useful Links
51+
52+
* [ember.js](https://emberjs.com/)
53+
* [ember-cli](https://cli.emberjs.com/release/)
54+
* Development Browser Extensions
55+
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
56+
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Application from '@ember/application';
2+
import * as Sentry from '@sentry/ember';
3+
import loadInitializers from 'ember-load-initializers';
4+
import Resolver from 'ember-resolver';
5+
6+
import config from './config/environment';
7+
8+
Sentry.init({
9+
replaysSessionSampleRate: 1,
10+
replaysOnErrorSampleRate: 1,
11+
tunnel: `http://localhost:3031/`, // proxy server
12+
});
13+
14+
export default class App extends Application {
15+
public modulePrefix = config.modulePrefix;
16+
public podModulePrefix = config.podModulePrefix;
17+
public Resolver = Resolver;
18+
}
19+
20+
loadInitializers(App, config.modulePrefix);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<a href={{this.href}} class={{if this.isActive 'active'}} {{on 'click' this.onClick}}>
2+
{{yield}}
3+
</a>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { action } from '@ember/object';
2+
import type RouterService from '@ember/routing/router-service';
3+
import { inject as service } from '@ember/service';
4+
import Component from '@glimmer/component';
5+
6+
interface Args {
7+
route: string;
8+
}
9+
10+
/*
11+
Note: We use this custom component instead of the built-in `<LinkTo>`,
12+
as that is an ember component in older versions, and a glimmer component in newer versions.
13+
14+
Since glimmer components are, as of now, not instrumented, this leads to different test results.
15+
*/
16+
export default class LinkComponent extends Component<Args> {
17+
@service public declare router: RouterService;
18+
19+
public get href(): string {
20+
return this.router.urlFor(this.args.route);
21+
}
22+
23+
public get isActive(): boolean {
24+
return this.router.currentRouteName === this.args.route;
25+
}
26+
27+
@action
28+
public onClick(event: MouseEvent): void {
29+
event.preventDefault();
30+
31+
void this.router.transitionTo(this.args.route);
32+
}
33+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* eslint-disable ember/no-empty-glimmer-component-classes */
2+
import Component from '@glimmer/component';
3+
4+
export default class SlowLoadingGCList extends Component {}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* eslint-disable ember/no-classic-classes */
2+
/* eslint-disable ember/no-classic-components */
3+
import Component from '@ember/component';
4+
import { computed } from '@ember/object';
5+
6+
interface Args {
7+
title?: string;
8+
items: number;
9+
}
10+
11+
export default Component.extend({
12+
tagName: '',
13+
14+
_title: computed('title', function () {
15+
return (this as Args).title || 'Slow Loading List';
16+
}),
17+
18+
rowItems: computed('items', function () {
19+
return new Array((this as Args).items).fill(0).map((_, index) => {
20+
return {
21+
index: index + 1,
22+
};
23+
});
24+
}),
25+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* eslint-disable ember/no-classic-classes */
2+
/* eslint-disable ember/no-classic-components */
3+
/* eslint-disable ember/require-tagless-components */
4+
import Component from '@ember/component';
5+
6+
export default Component.extend({});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Type declarations for
3+
* import config from './config/environment'
4+
*
5+
* For now these need to be managed by the developer
6+
* since different ember addons can materialize new entries.
7+
*/
8+
declare const config: {
9+
environment: string;
10+
modulePrefix: string;
11+
podModulePrefix: string;
12+
locationType: 'history' | 'hash' | 'none' | 'auto';
13+
rootURL: string;
14+
APP: Record<string, unknown>;
15+
};
16+
17+
export default config;
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import Controller from '@ember/controller';
2+
import EmberError from '@ember/error';
3+
import { action } from '@ember/object';
4+
import { scheduleOnce } from '@ember/runloop';
5+
import { tracked } from '@glimmer/tracking';
6+
import { Promise } from 'rsvp';
7+
8+
export default class IndexController extends Controller {
9+
@tracked public showComponents = false;
10+
11+
@action
12+
public createError(): void {
13+
// @ts-expect-error this is fine
14+
this.nonExistentFunction();
15+
}
16+
17+
@action
18+
public createEmberError(): void {
19+
throw new EmberError('Whoops, looks like you have an EmberError');
20+
}
21+
22+
@action
23+
public createCaughtEmberError(): void {
24+
try {
25+
throw new EmberError('Looks like you have a caught EmberError');
26+
} catch (e) {
27+
// do nothing
28+
}
29+
}
30+
31+
@action
32+
public createFetchError(): void {
33+
void fetch('http://doesntexist.example');
34+
}
35+
36+
@action
37+
public createAfterRenderError(): void {
38+
function throwAfterRender(): void {
39+
throw new Error('After Render Error');
40+
}
41+
scheduleOnce('afterRender', null, throwAfterRender);
42+
}
43+
44+
@action
45+
public createRSVPRejection(): Promise<void> {
46+
const promise = new Promise<void>((resolve, reject) => {
47+
reject('Promise rejected');
48+
});
49+
return promise;
50+
}
51+
52+
@action
53+
public createRSVPError(): Promise<void> {
54+
const promise = new Promise<void>(() => {
55+
throw new Error('Error within RSVP Promise');
56+
});
57+
return promise;
58+
}
59+
60+
@action
61+
public toggleShowComponents(): void {
62+
this.showComponents = !this.showComponents;
63+
}
64+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Controller from '@ember/controller';
2+
import { action } from '@ember/object';
3+
import type RouterService from '@ember/routing/router-service';
4+
import { inject as service } from '@ember/service';
5+
6+
export default class SlowLoadingRouteController extends Controller {
7+
@service public declare router: RouterService;
8+
9+
@action
10+
public back(): void {
11+
void this.router.transitionTo('tracing');
12+
}
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Controller from '@ember/controller';
2+
3+
export default class SlowLoadingRouteController extends Controller {
4+
public slowLoadingTemplateOnlyItems = new Array(2000).fill(0).map((_, index) => index);
5+
}

0 commit comments

Comments
 (0)