Skip to content

Commit 11ca6b0

Browse files
bobisjanmansona
authored andcommitted
Remove ember-fetch add-on
1 parent a5bfdfd commit 11ca6b0

File tree

9 files changed

+72
-246
lines changed

9 files changed

+72
-246
lines changed

Diff for: packages/ember-cli-fastboot/fastboot/instance-initializers/fetch.js

-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ function initialize(instance) {
44
}
55

66
export default {
7-
name: 'fastboot:fetch', // `ember-fetch` addon registers as `fetch`
87
initialize,
98
};

Diff for: packages/ember-cli-fastboot/test/request-details-test.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ function injectMiddlewareAddon(app) {
1212
pkg.devDependencies['body-parser'] =
1313
process.env.npm_package_devDependencies_body_parser;
1414
pkg.dependencies = pkg.dependencies || {};
15-
pkg.dependencies['fastboot'] = `file:${path.resolve(__dirname, '../../fastboot')}`
16-
pkg.dependencies['fastboot-express-middleware'] = `file:${path.resolve(__dirname, '../../fastboot-express-middleware')}`
15+
pkg.dependencies['fastboot'] = `file:${path.resolve(
16+
__dirname,
17+
'../../fastboot'
18+
)}`;
19+
pkg.dependencies['fastboot-express-middleware'] = `file:${path.resolve(
20+
__dirname,
21+
'../../fastboot-express-middleware'
22+
)}`;
1723
pkg['ember-addon'] = {
1824
paths: ['lib/post-middleware'],
1925
};

Diff for: test-packages/basic-app/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"ember-cli-uglify": "^3.0.0",
4747
"ember-data": "~3.19.0",
4848
"ember-export-application-global": "^2.0.1",
49-
"ember-fetch": "^8.0.1",
5049
"ember-load-initializers": "^2.1.1",
5150
"ember-maybe-import-regenerator": "^0.1.6",
5251
"ember-qunit": "^4.6.0",

Diff for: test-packages/basic-app/test/package-json-test.js

+56-81
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,87 @@
1-
"use strict";
1+
'use strict';
22

3-
const chai = require("chai");
3+
const chai = require('chai');
44
const expect = chai.expect;
5-
const fs = require("fs-extra");
6-
const execa = require("execa");
5+
const fs = require('fs-extra');
6+
const execa = require('execa');
77

8-
chai.use(require("chai-fs"));
8+
chai.use(require('chai-fs'));
99

10-
describe("generating package.json", function () {
10+
describe('generating package.json', function() {
1111
this.timeout(300000);
1212

13-
describe("with FastBoot builds", function () {
14-
before(async function () {
15-
await execa("yarn", ["build"]);
13+
describe('with FastBoot builds', function() {
14+
before(async function() {
15+
await execa('yarn', ['build']);
1616
});
1717

18-
it("builds a package.json", async function () {
19-
expect("dist/assets/basic-app.js").to.be.a.file();
20-
expect("dist/package.json").to.be.a.file();
18+
it('builds a package.json', async function() {
19+
expect('dist/assets/basic-app.js').to.be.a.file();
20+
expect('dist/package.json').to.be.a.file();
2121
});
2222

23-
it("merges FastBoot dependencies from multiple addons", function () {
24-
let pkg = fs.readJSONSync("dist/package.json");
23+
it('merges FastBoot dependencies from multiple addons', function() {
24+
let pkg = fs.readJSONSync('dist/package.json');
2525

2626
expect(pkg.dependencies).to.deep.equal({
27-
"abortcontroller-polyfill": "^1.4.0",
28-
foo: "1.0.0",
29-
bar: "^0.1.2",
30-
baz: "0.0.0",
31-
"node-fetch": "^2.6.0",
32-
rsvp: "^4.8.5",
27+
foo: '1.0.0',
28+
bar: '^0.1.2',
29+
baz: '0.0.0',
30+
rsvp: '^4.8.5',
3331
});
3432
});
3533

36-
it("contains a schema version", function () {
37-
let pkg = fs.readJSONSync("dist/package.json");
34+
it('contains a schema version', function() {
35+
let pkg = fs.readJSONSync('dist/package.json');
3836

3937
expect(pkg.fastboot.schemaVersion).to.deep.equal(3);
4038
});
4139

42-
it("contains a whitelist of allowed module names", function () {
43-
let pkg = fs.readJSONSync("dist/package.json");
44-
45-
expect(pkg.fastboot.moduleWhitelist).to.deep.equal([
46-
"node-fetch",
47-
"abortcontroller-polyfill",
48-
"abortcontroller-polyfill/dist/cjs-ponyfill",
49-
"path",
50-
"foo",
51-
"bar",
52-
"baz",
53-
"rsvp",
54-
]);
40+
it('contains a whitelist of allowed module names', function() {
41+
let pkg = fs.readJSONSync('dist/package.json');
42+
43+
expect(pkg.fastboot.moduleWhitelist).to.deep.equal(['path', 'foo', 'bar', 'baz', 'rsvp']);
5544
});
5645

57-
it("contains a manifest of FastBoot assets", function () {
58-
let pkg = fs.readJSONSync("dist/package.json");
46+
it('contains a manifest of FastBoot assets', function() {
47+
let pkg = fs.readJSONSync('dist/package.json');
5948

6049
expect(pkg.fastboot.manifest).to.deep.equal({
61-
appFiles: [
62-
"assets/basic-app.js",
63-
"assets/basic-app-fastboot.js",
64-
"example-addon/bar.js",
65-
],
66-
htmlFile: "index.html",
67-
vendorFiles: [
68-
"example-addon/foo.js",
69-
"assets/vendor.js",
70-
"assets/auto-import-fastboot.js",
71-
"ember-fetch/fetch-fastboot.js",
72-
],
50+
appFiles: ['assets/basic-app.js', 'assets/basic-app-fastboot.js', 'example-addon/bar.js'],
51+
htmlFile: 'index.html',
52+
vendorFiles: ['example-addon/foo.js', 'assets/vendor.js', 'assets/auto-import-fastboot.js'],
7353
});
7454
});
7555

76-
it("contains a list of whitelisted hosts from environment.js", function () {
77-
let pkg = fs.readJSONSync("dist/package.json");
56+
it('contains a list of whitelisted hosts from environment.js', function() {
57+
let pkg = fs.readJSONSync('dist/package.json');
7858

7959
expect(pkg.fastboot.hostWhitelist).to.deep.equal([
80-
"example.com",
81-
"subdomain.example.com",
82-
"/localhost:\\d+/",
60+
'example.com',
61+
'subdomain.example.com',
62+
'/localhost:\\d+/',
8363
]);
8464
});
8565

86-
it("contains app name", function () {
87-
let pkg = fs.readJSONSync("dist/package.json");
66+
it('contains app name', function() {
67+
let pkg = fs.readJSONSync('dist/package.json');
8868

89-
expect(pkg.fastboot.appName).to.equal("basic-app");
69+
expect(pkg.fastboot.appName).to.equal('basic-app');
9070
});
9171

92-
it("contains the application config", function () {
93-
let pkg = fs.readJSONSync("dist/package.json");
72+
it('contains the application config', function() {
73+
let pkg = fs.readJSONSync('dist/package.json');
9474

95-
let config = pkg.fastboot.config["basic-app"];
75+
let config = pkg.fastboot.config['basic-app'];
9676

9777
expect(config.APP.version).to.be;
9878

9979
delete config.APP.version;
10080
expect(config).to.deep.equal({
101-
modulePrefix: "basic-app",
102-
environment: "development",
103-
rootURL: "/",
104-
locationType: "auto",
81+
modulePrefix: 'basic-app',
82+
environment: 'development',
83+
rootURL: '/',
84+
locationType: 'auto',
10585
EmberENV: {
10686
EXTEND_PROTOTYPES: {
10787
Date: false,
@@ -113,45 +93,40 @@ describe("generating package.json", function () {
11393
_TEMPLATE_ONLY_GLIMMER_COMPONENTS: true,
11494
},
11595
APP: {
116-
name: "basic-app",
96+
name: 'basic-app',
11797
autoboot: false,
11898
},
11999
fastboot: {
120-
hostWhitelist: [
121-
"example.com",
122-
"subdomain.example.com",
123-
"/localhost:\\d+/",
124-
],
100+
hostWhitelist: ['example.com', 'subdomain.example.com', '/localhost:\\d+/'],
125101
},
126102
exportApplicationGlobal: true,
127103
});
128104
});
129105

130-
it("contains additional config from example-addon", function () {
131-
let pkg = fs.readJSONSync("dist/package.json");
106+
it('contains additional config from example-addon', function() {
107+
let pkg = fs.readJSONSync('dist/package.json');
132108

133-
expect(pkg.fastboot.config["foo"]).to.equal("bar");
109+
expect(pkg.fastboot.config['foo']).to.equal('bar');
134110
});
135-
136111
});
137112

138-
describe("with production FastBoot builds", function () {
139-
before(async function () {
140-
await execa("yarn", ["build", "--environment=production"]);
113+
describe('with production FastBoot builds', function() {
114+
before(async function() {
115+
await execa('yarn', ['build', '--environment=production']);
141116
});
142117

143-
it("contains a manifest of FastBoot assets", function () {
144-
let pkg = fs.readJSONSync("dist/package.json");
118+
it('contains a manifest of FastBoot assets', function() {
119+
let pkg = fs.readJSONSync('dist/package.json');
145120

146121
let manifest = pkg.fastboot.manifest;
147122

148-
manifest.appFiles.forEach((file) => {
123+
manifest.appFiles.forEach(file => {
149124
expect(`dist/${file}`).to.be.a.file();
150125
});
151126

152127
expect(`dist/${manifest.htmlFile}`).to.be.a.file();
153128

154-
manifest.vendorFiles.forEach((file) => {
129+
manifest.vendorFiles.forEach(file => {
155130
expect(`dist/${file}`).to.be.a.file();
156131
});
157132
});

Diff for: test-packages/custom-fastboot-app/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"ember-cli-uglify": "^3.0.0",
4343
"ember-data": "~3.19.0",
4444
"ember-export-application-global": "^2.0.1",
45-
"ember-fetch": "^8.0.1",
4645
"ember-load-initializers": "^2.1.1",
4746
"ember-maybe-import-regenerator": "^0.1.6",
4847
"ember-qunit": "^4.6.0",

Diff for: test-packages/custom-sandbox-app/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"ember-cli-uglify": "^3.0.0",
3838
"ember-data": "~3.19.0",
3939
"ember-export-application-global": "^2.0.1",
40-
"ember-fetch": "^8.0.1",
4140
"ember-load-initializers": "^2.1.1",
4241
"ember-maybe-import-regenerator": "^0.1.6",
4342
"ember-qunit": "^4.6.0",

Diff for: test-packages/ember-cli-fastboot-testing-app/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"ember-cli-uglify": "^3.0.0",
3838
"ember-data": "~3.19.0",
3939
"ember-export-application-global": "^2.0.1",
40-
"ember-fetch": "^8.0.1",
4140
"ember-load-initializers": "^2.1.1",
4241
"ember-maybe-import-regenerator": "^0.1.6",
4342
"ember-qunit": "^4.6.0",

Diff for: test-packages/hot-swap-app/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"ember-cli-uglify": "^3.0.0",
3838
"ember-data": "~3.19.0",
3939
"ember-export-application-global": "^2.0.1",
40-
"ember-fetch": "^8.0.1",
4140
"ember-load-initializers": "^2.1.1",
4241
"ember-maybe-import-regenerator": "^0.1.6",
4342
"ember-qunit": "^4.6.0",

0 commit comments

Comments
 (0)