Skip to content

Commit 83fefa6

Browse files
committed
Test ember main + scope bag object cleanup
1 parent 82b0695 commit 83fefa6

10 files changed

Lines changed: 89 additions & 798 deletions

app/adapters/application.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ export default class Application extends JSONAPIAdapter {
8080
throw new Error('Unexpected model lookup');
8181
}
8282

83-
const base = this.fastboot.isFastBoot
84-
? config.APP.domain
85-
: window.location.origin;
83+
const base = window.location.origin;
8684

8785
url = `${base}/${url}.json`;
8886
try {

app/instance-initializers/ember-meta-store.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/routes/application.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ export default class ApplicationRoute extends Route {
1414
@service
1515
router;
1616

17-
@service
18-
fastboot;
19-
2017
@service
2118
metrics;
2219

@@ -25,21 +22,19 @@ export default class ApplicationRoute extends Route {
2522

2623
constructor() {
2724
super(...arguments);
28-
if (!this.fastboot.isFastBoot) {
29-
this.router.on('routeDidChange', this.trackPage);
25+
this.router.on('routeDidChange', this.trackPage);
3026

31-
/* Hax from https://github.com/DockYard/ember-router-scroll/issues/263
32-
to handle router scroll behavior when the page was initially served
27+
/* Hax from https://github.com/DockYard/ember-router-scroll/issues/263
28+
to handle router scroll behavior when the page was initially served
3329
with fastboot
3430
*/
35-
this.routerScroll.set('preserveScrollPosition', true);
36-
37-
setTimeout(() => {
38-
if (!isDestroying(this) && !isDestroyed(this)) {
39-
this.routerScroll.set('preserveScrollPosition', false);
40-
}
41-
}, 1000);
42-
}
31+
this.routerScroll.set('preserveScrollPosition', true);
32+
33+
setTimeout(() => {
34+
if (!isDestroying(this) && !isDestroyed(this)) {
35+
this.routerScroll.set('preserveScrollPosition', false);
36+
}
37+
}, 1000);
4338
}
4439

4540
trackPage = () => {

app/routes/not-found.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
import Route from '@ember/routing/route';
2-
import { service } from '@ember/service';
32

43
export default class NotFoundRoute extends Route {
5-
@service fastboot;
6-
7-
beforeModel() {
8-
if (!this.fastboot.isFastBoot) {
9-
return;
10-
}
11-
12-
this.fastboot.response.statusCode = 404;
13-
}
14-
154
redirect() {
165
if (typeof window === 'undefined' || !window.location) {
176
return;

app/routes/project-version.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import getLastVersion from 'ember-api-docs/utils/get-last-version';
77
import config from 'ember-api-docs/config/environment';
88

99
export default class ProjectVersionRoute extends Route {
10-
@service
11-
fastboot;
12-
1310
@service
1411
headData;
1512

@@ -117,10 +114,7 @@ export default class ProjectVersionRoute extends Route {
117114
this.headData.compactVersion = model.get('compactVersion');
118115
this.headData.urlVersion = projectVersion;
119116
if (!this.headData.isRelease) {
120-
let request = this.fastboot.request;
121-
let href = this.fastboot.isFastBoot
122-
? `${config.APP.domain}/${request.path}`
123-
: window.location.href;
117+
let href = window.location.href;
124118
let version = new RegExp(model.get('compactVersion'), 'g');
125119
let canonicalUrl = href.replace(version, 'release');
126120
this.headData.canonicalUrl = canonicalUrl;

app/utils/url-hash-polyfill.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { schedule } from '@ember/runloop';
99
import { waitForPromise } from '@ember/test-waiters';
1010

1111
/* Taken from ember-url-hash-polyfill (https://github.com/CrowdStrike/ember-url-hash-polyfill/)
12-
and modified to not run in Fastboot. The original addon is not maintained.
12+
and modified to not run in Fastboot. The original addon is not maintained.
1313
There is a PR to add it to ember-primitives https://github.com/universal-ember/ember-primitives/pull/529
1414
*/
1515

@@ -73,10 +73,6 @@ async function setupHashSupport(router) {
7373
let initialURL;
7474
let owner = getOwner(router);
7575

76-
if (owner.lookup('service:fastboot').isFastBoot) {
77-
return;
78-
}
79-
8076
await new Promise((resolve) => {
8177
let interval = setInterval(() => {
8278
let { currentURL, currentRouteName } = router; /* Private API */

ember-cli-build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ module.exports = function (defaults) {
5656
staticComponents: true,
5757
});
5858

59-
return require('prember').prerender(app, appTree);
59+
return appTree;
6060
};
Binary file not shown.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"ember-cli-deploy-build": "^3.0.0",
6666
"ember-cli-deploy-gzip": "^3.0.0",
6767
"ember-cli-deprecation-workflow": "^3.4.0",
68-
"ember-cli-fastboot": "^4.1.5",
6968
"ember-cli-head": "^2.0.0",
7069
"ember-cli-htmlbars": "^6.3.0",
7170
"ember-cli-inject-live-reload": "^2.1.0",
@@ -74,7 +73,6 @@
7473
"ember-composable-helpers": "^5.0.0",
7574
"ember-concurrency": "^4.0.6",
7675
"ember-data": "~4.12.8",
77-
"ember-data-fastboot": "https://github.com/mainmatter/ember-data-fastboot#update-babel",
7876
"ember-decorators": "^6.1.1",
7977
"ember-eslint-parser": "^0.5.11",
8078
"ember-inflector": "^6.0.0",
@@ -116,7 +114,6 @@
116114
"lodash.values": "^4.3.0",
117115
"minimist": "^1.2.6",
118116
"normalize.css": "^8.0.1",
119-
"prember": "^2.1.0",
120117
"prettier": "^3.6.2",
121118
"prettier-plugin-ember-template-tag": "^2.1.0",
122119
"qunit": "^2.24.1",
@@ -137,6 +134,7 @@
137134
"packageManager": "pnpm@10.30.2",
138135
"pnpm": {
139136
"overrides": {
137+
"ember-source": "file:ember-source-6.12.0-alpha.1.scope-bag-object-cleanup+c8574657.tgz",
140138
"ember-data>ember-inflector": "^6.0.0"
141139
}
142140
},

0 commit comments

Comments
 (0)