Git Product home page Git Product logo

your-first-pwapp's Issues

Need a What to do next section/chapter

After they complete this code lab, what should they do next? Ideally I'd like them to do the push notification code lab.

It should also include deeper resources on fetch, caches, service workers, etc

Low pri - for after IWD

Delete unnecessary files from repo

The following files aren't needed for the codelab and should be deleted to not confuse students:

  • resources/final-gulpfile.js
  • resources/package.json
  • firebase.json
  • generate-sw.js
  • gulpfile.js
  • index.html (in root only)
  • make-zip.sh
  • package.json
  • server.js

I also believe that /images and /styles can be yanked, but will file a separate issue for those two.

Nonsensical code comments

Step 5 has us paste the following snippet into app.js:

// Save list of cities to localStorage, see note below about localStorage.
app.saveSelectedCities = function() {
  var selectedCities = JSON.stringify(app.selectedCities);
  // IMPORTANT: See notes about use of localStorage.

The comment above apparently refers to the comment below, which refers to... The first one? Something in the codelab itself?

I spent about five minutes reading through the first half of this step trying to figure out
which notes they were referring to. Then I finally gave up and went on to the next step, which involves pasting in a big comment... D'oh!

This was unnecessarily confusing. At a minimum, please combine these two comments into one, so they don't appear to refer to each other. "See note below" might prompt one to look lower in the codelab, if it weren't for the second comment, which confuses the issue.

Update sample code across service worker resources

We need to make sure that the sample code is up-to-date across our resources, in particular, any resources linked to in 'is service worker ready' resources list.

Also, can we organize our sample code noting the APIs that are used in them in a complete list? That way if someone wants to look at a great sample showing cache API, they can see that the sample matches what they are looking for.

Copying in app.js and uncommenting updateForecastCard()

Existing line:

Copy app.js from the resources/step4 directory to your scripts folder.
Should read:
Copy app.js from the resources/step-04 directory to your scripts folder.

Suggested step:

To see how the fake weather data is rendered, uncomment the line below at the bottom of your scripts/app.js file
The call is already uncommented in the file.

Explain what 'bump cacheName' means

The phrase 'bump cacheName' in Step 6 is assuming a lot of pre-knowledge. You're assuming people know you mean increment the string with the variable name cacheName at the top of service-worker.js.

How can I test that this works offline?

Especially given that I am running this on localhost, which is never "offline", how can I test that all the stuff I did in step 6 actually had an effect?

Maybe I should be testing from my phone using some kind of localhost-to-internet tunnel?

indexOf() === 0 could be startsWith

if (e.request.url.indexOf(dataUrl) === 0)

could be

if (e.request.url.startsWith(dataUrl))

Every browser that supports service workers supports startsWith.

Step #2 Documentation: "PWA-GettingStarted-codelab" naming incorrect

At the very beginning of step 2, the documentation suggests to Unpack the downloaded zip file. This will unpack a root folder (PWA-GettingStarted-codelab) but the zip (and unpacked folder) are named your-first-pwapp-master

This seems like a bit of documentation that needs to be updated.

Debugging 2 async requests

Step 7 - debugging the 2 requests at once approach is really weird. Should I only see one request in the network panel or two?

Best practice for "inject the weather forecast data" in a production app

In the tutorial, when it says:

...but in a production app, the latest weather forecast data would be injected by the server....

Could you please clarify a recommended way to achieve that? I mean, should I do that generating data into a script tag with the weather content (the first way I thought), or there's a better and recommended option?

In step 4 copying app.js gives javascript errors

The javascript adds listeners for butAdd, butAddCity and ButAddCancel, but only butAdd is in the html-file we're using. They will probably go into the div dialog-container later, but they're not there yet.

Adding

    <button id="butAddCity" class="dialogbutton"></button>
    <button id="butAddCancel" class="dialogbutton"></button>

in the dialog-container fixes the errors, and doesn't show them on the screen.

Remove images and styles directory

Remove the images and styles directory from the root of the project, the files all exist in the individual step-0x folders.

Let's hang off on this one until after IWD

typo in pwapp codelab step 7

"Our app won’t work offline quite yet. We’ve implemented caching and retrieval for the app shell, but even though we’re caching the data, we’re still dependant on the network."

s/dependant/dependent/

Adding close button

Hi Pete,

Great progressive app tutorial. Just a quick suggestion - can you add a remove button to close the weather cards?

image

"We'll start with a new index.html"

Step 2 says "we'll start with a new index.html" which folks think means create a new index.html. Really they should use the one from step-02

Icon paths in inline.css wrong

The paths for .weather-forecast .icon, #butRefresh, and #butAdd in the inline.css file of the work folder result in the images not being rendered. The paths should direct to the parent directory since inline.css is in the styles directory (i.e., ../images/).

Of course, this may be OBE if inline.css is moved to the root directory by issue #4.

Better 'why' for updating cacheName

Let's describe a bit better when the cacheName gets changed, and why that's important, and what's going on in the background if you don't update the cacheName.

It's not clear that `caches` is a global

Using self.caches throughout to be consistent with addEventListener would be good. Also, maybe explain that self in a service worker is analogous to window in the normal page would be helpful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.