Skip to content

Commit 44e300b

Browse files
committed
refactor(sw): Delete the service worker manifest generation functionality from the CLI (angular#609)
1 parent 011d4b4 commit 44e300b

File tree

4 files changed

+1
-125
lines changed

4 files changed

+1
-125
lines changed

README.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -183,21 +183,7 @@ You can modify the these scripts in `package.json` to run whatever tool you pref
183183

184184
### Support for offline applications
185185

186-
By default a file `manifest.appcache` will be generated which lists all files included in
187-
a project's output, along with SHA1 hashes of all file contents. This file can be used
188-
directly as an AppCache manifest (for now, `index.html` must be manually edited to set this up).
189-
190-
The manifest is also annotated for use with `angular2-service-worker`. Some manual operations
191-
are currently required to enable this usage. The package must be installed, and `worker.js`
192-
manually copied into the project `src` directory:
193-
194-
```bash
195-
npm install angular2-service-worker
196-
cp node_modules/angular2-service-worker/dist/worker.js src/
197-
```
198-
199-
Then, the commented snippet in `index.html` must be uncommented to register the worker script
200-
as a service worker.
186+
The index.html file includes a commented-out code snippet for installing the angular2-service-worker. This support is experimental, please see the angular/mobile-toolkit project for documentation on how to make use of this functionality.
201187

202188
### Commands autocompletion
203189

lib/broccoli/angular2-app.js

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const isProduction = require('./is-production');
66
const BroccoliPlugin = require('broccoli-writer');
77
const BroccoliConfigReplace = require('./broccoli-config-replace');
88
const BroccoliTypescript = require('./broccoli-typescript');
9-
const BroccoliSwManifest = require('./service-worker-manifest').default;
109
const BundlePlugin = require('./angular-broccoli-bundle');
1110
const BroccoliFunnel = require('broccoli-funnel');
1211
const BroccoliMergeTrees = require('broccoli-merge-trees');
@@ -136,7 +135,6 @@ class Angular2App extends BroccoliPlugin {
136135

137136
if (isProduction) {
138137
merged = this._getBundleTree(merged);
139-
merged = new BroccoliMergeTrees([merged, new BroccoliSwManifest([merged])]);
140138
}
141139

142140
return new BroccoliFunnel(merged, {

lib/broccoli/service-worker-manifest.js

-97
This file was deleted.

tests/e2e/e2e_workflow.spec.js

-11
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,6 @@ describe('Basic end-to-end Workflow', function () {
7272
expect(sh.exec('git status --porcelain').output).to.be.equal(undefined);
7373
});
7474

75-
it('Produces a service worker manifest after production build', function () {
76-
var manifestPath = path.join(process.cwd(), 'dist', 'manifest.appcache');
77-
expect(existsSync(manifestPath)).to.be.equal(true);
78-
// Read the worker.
79-
//TODO: Commenting this out because it makes eslint fail(need to figure out why this expect was commented out)
80-
// var lines = fse.readFileSync(manifestPath, {encoding: 'utf8'}).trim().split('\n');
81-
82-
// Check that a few critical files have been detected.
83-
// expect(lines).to.include(`${path.sep}index.html`);
84-
});
85-
8675
it('Can run `ng build` in created project', function () {
8776
this.timeout(420000);
8877

0 commit comments

Comments
 (0)