Skip to content

Commit

Permalink
un-PWA-ize the app
Browse files Browse the repository at this point in the history
  • Loading branch information
hideya committed Jun 20, 2018
1 parent c540241 commit edd6e03
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 102 deletions.
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Doodle Recognition PWA with TensorFlow.js
# Doodle Recognition Web App with TensorFlow.js

This is an example [PWA](https://en.wikipedia.org/wiki/Progressive_Web_Apps)
This is an example Web App
that uses [TensorFlow.js](https://js.tensorflow.org/) and performs doodle recognition.

It loads a pre-trained CNN model that was converted to TensorFlow.js format
Expand Down Expand Up @@ -32,17 +32,6 @@ yarn start # Starts a web server and opens a page. Also watches for changes.
```

After `yarn build`, `public` directory holds the deployable files.
Note that those files need to be served via **https** to enable PWA features
(unless they are served from `localhost`).

### <a name="notes-on-debugging"></a>Notes on Debugging

This is a PWA, so the involved files will be cached
(it is different from the browser cache; it is Service Worker controlled cache).
Attention is required to make sure that each debug execution respects
the latest file changes. Please reference the document
["Debugging Service Workers"](https://developers.google.com/web/fundamentals/codelabs/debugging-service-workers/)
for details including the other aspects of debugging PWA and Service Workers.

### Updating Pre-trained Model Data

Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>Doodle Recognition with TensorFlow.js</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="./manifest.json">
<!-- link rel="manifest" href="./manifest.json" -->
<link rel="icon" type="image/png" href="./marulabo-icon.png">
<style>
body {margin: 20px; text-align: center; font-family: sans-serif;}
Expand Down
15 changes: 0 additions & 15 deletions public/manifest.json

This file was deleted.

66 changes: 0 additions & 66 deletions public/service-worker.js

This file was deleted.

14 changes: 7 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ class ResultTable {
}
}

if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./service-worker.js')
.then(success => console.log('Service Worker registered:', success))
.catch(error => console.error('Error: Failed to register Service Worker:', error));
} else {
console.log('Warning: No support for Service Workers');
}
// if ('serviceWorker' in navigator) {
// navigator.serviceWorker.register('./service-worker.js')
// .then(success => console.log('Service Worker registered:', success))
// .catch(error => console.error('Error: Failed to register Service Worker:', error));
// } else {
// console.log('Warning: No support for Service Workers');
// }

0 comments on commit edd6e03

Please sign in to comment.