Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add manifest.json and cache static assets for offline use #331

Merged
merged 8 commits into from
Oct 26, 2018

Conversation

Mridul97
Copy link

@Mridul97 Mridul97 commented Sep 8, 2018

No description provided.

@Mridul97
Copy link
Author

Mridul97 commented Sep 8, 2018

Fixes #326

Changes: add a manifest.json file and cache static assets for offline use

@tech4GT
Copy link
Member

tech4GT commented Sep 8, 2018

@Mridul97 One thing, since the issue is a multi-task issue we don't want to close it with this pull request but the fixes commit will close it automatically. We should avoid this since we can miss re-opening. Great work though!!

@tech4GT
Copy link
Member

tech4GT commented Sep 8, 2018

I'll test your branch out in my browser now!!

@Mridul97
Copy link
Author

Mridul97 commented Sep 8, 2018

Oh I didn't know that. Thanks! I will keep that in mind for the future.

@tech4GT
Copy link
Member

tech4GT commented Sep 9, 2018

hmm @Mridul97 I was trying this out in my browser and this doesn't seem to work. I'm sorry actually I'm a little busy right now so I'll review this asap.

@Mridul97
Copy link
Author

Mridul97 commented Sep 9, 2018

Could you please tell that which all files are to be added in cache storage? as there are a lot of files in the project. Thanks!

@jywarren
Copy link
Member

I think everything in /examples/ and in /dist/ and that should be everything?

@jywarren
Copy link
Member

Ah yes, and some files in /node_modules -- whatever's included into examples/index.html!

@tech4GT
Copy link
Member

tech4GT commented Sep 10, 2018

I got an idea! One thing we can do is just cache every outgoing request. Since our project does not consume any API as of now that should work perfectly and we'll not miss anything.

@Mridul97
Copy link
Author

Cool! but if we update any of the files and change the cache name, then the user will have to send each request again to store those files in cache. So will this approach be better than caching all the files on install event in our case? Just a thought.

@tech4GT
Copy link
Member

tech4GT commented Sep 11, 2018

Yeah that's true. But since we don't update our files that often anyway (all data is static) it shouldn't be a problem.

@Mridul97
Copy link
Author

Great! I will implement this approach and push changes. Thanks!

@Mridul97
Copy link
Author

Mridul97 commented Sep 11, 2018

I have made the changes. Please take a look. @tech4GT

@jywarren
Copy link
Member

jywarren commented Sep 11, 2018 via email

@tech4GT
Copy link
Member

tech4GT commented Sep 21, 2018

Having a look at this one now!! Sorry for the delay.

@tech4GT
Copy link
Member

tech4GT commented Sep 22, 2018

Hmm, this does not seem to work. I'll try to fix this up and push the changes.
I think something is wrong with sw.js, taking a look now!!

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
@tech4GT
Copy link
Member

tech4GT commented Sep 24, 2018

Hmm, could you please allow edits from maintainers on this. Thanks!

@Mridul97
Copy link
Author

Allow edits from maintainers check-box is already ticked. Do I have to do anything else to allow edits from maintainers?

@ghost ghost assigned tech4GT Sep 24, 2018
@ghost ghost added the in-progress label Sep 24, 2018
@tech4GT
Copy link
Member

tech4GT commented Sep 24, 2018

Oh sorry, my bad!! I just made a small change that enables caching on the first page load itself!! Have a look.

@Mridul97
Copy link
Author

Mridul97 commented Oct 5, 2018

I have made changes to add a button to clear cache. By clicking on the button, all the versions of the cache will be deleted and on next reload latest version of the cache will be saved. I will make the changes to show save time. Please have a look!

@jywarren
Copy link
Member

jywarren commented Oct 5, 2018 via email

@Mridul97
Copy link
Author

Mridul97 commented Oct 5, 2018

Done! Please have a look!

@jywarren
Copy link
Member

jywarren commented Oct 5, 2018

Hmm, i'm not seeing the changes. Is it possible that the previous cache is not letting the new cache through?

screen shot 2018-10-05 at 2 00 16 pm

@jywarren
Copy link
Member

jywarren commented Oct 5, 2018

Yes! I think so - i had to do a hard cache flush with:

image

This proves out our case, doesn't it? 😄

I'd like to ask for a style change - can we do this?

    <hr style="margin:20px;"><center><a class="color:grey;" id="clear-cache">Clear offline cache</a></center>

Also, sorry -- just thinking ahead -- if somebody does /not/ manually flush the cache, will it still update itself in the background? Why didn't that happen for me?

@Mridul97
Copy link
Author

Mridul97 commented Oct 5, 2018

Yes, I think it is possible, because I didn't change the cache version. Could you please manually delete the old cache. Thanks!

@jywarren
Copy link
Member

jywarren commented Oct 5, 2018

Ah, i see. and so for pull requests we should add to the template to change the cache version to ensure people see new changes. With the style changes, can you change the cache version and we'll check to see it works this time? this is good troubleshooting 😄

Finally, let's add a page refresh when you click the "clear cache" button -- otherwise there's no feedback. Make sense?

Awesome work!

@Mridul97
Copy link
Author

Mridul97 commented Oct 5, 2018

Actually it happened because I didn't change the cache version. The cache version is same as before so it didn't update the cache!

@jywarren
Copy link
Member

jywarren commented Oct 5, 2018

Oh one more thing - can we append the cache version to the clear button, like Clear offline cache (v___) so that we know what version people are running? This will help with troubleshooting with people :-)

👍 👍 👍

@Mridul97
Copy link
Author

Mridul97 commented Oct 5, 2018

Awesome! I will make these changes and also change the version of cache this time!!

@Mridul97
Copy link
Author

Mridul97 commented Oct 5, 2018

I have made the changes. Please have a look!

It may happen that changes are not visible at the first time. If that happens then please do not force load the page, just close the tab and open the link again in a new tab. Thanks!

@Mridul97
Copy link
Author

Mridul97 commented Oct 8, 2018

@jywarren Please have a look!

@jywarren
Copy link
Member

jywarren commented Oct 8, 2018 via email

@tech4GT
Copy link
Member

tech4GT commented Oct 18, 2018

@jywarren This looks good!

@Mridul97
Copy link
Author

@jywarren @tech4GT scope for local host is /examples/ and for github pages it is /image-sequencer/ what should we keep the scope? Right now it is /examples/

@tech4GT
Copy link
Member

tech4GT commented Oct 18, 2018

oh, Jeff changed the url, it's sequencer.publiclab.org

@tech4GT
Copy link
Member

tech4GT commented Oct 18, 2018

SO It should work on examples

@Mridul97
Copy link
Author

Mridul97 commented Oct 18, 2018

Awesome!

@jywarren jywarren merged commit 15513ed into publiclab:master Oct 26, 2018
@jywarren
Copy link
Member

Merged this after one final check! This is awesome. Great work, everyone!

@jywarren
Copy link
Member

Hmm, oddly the cache footer line doesn't seem to be appearing in the demo: https://sequencer.publiclab.org/

i wonder how this happened, but the manifest line seems to be gone? Let's figure out what happened!

@jywarren
Copy link
Member

Yikes! This was merged into master, not main. Opening a new PR to rebase and merge again!

jywarren added a commit that referenced this pull request Nov 21, 2018
* Add manifest.json

* cache static assets for offline use

* update cache

* add meta theme-color and change static files to be cache

* cache the files on network request

* caching on first run

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add a button to clear cache

* add styling to clear cache link
jywarren pushed a commit that referenced this pull request Jan 4, 2019
…le to crop and overlay module. (#592)

* Add manifest.json and cache static assets for offline use (#331)

* Add manifest.json

* cache static assets for offline use

* update cache

* add meta theme-color and change static files to be cache

* cache the files on network request

* caching on first run

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add a button to clear cache

* add styling to clear cache link

* Update Modules.js (#452)

I've arranged the modules in alphabetical order.

* Added a function to parse Input coordinates and added the functionality for crop and overlay modules

* Added changed dist files

* Revert "Added changed dist files"

This reverts commit dbda25a.

* Changed function name and added the functionaity to src/utils folder

* Added unit test

* Added unit test to /test/util
jywarren pushed a commit that referenced this pull request Jan 4, 2019
* updated drop down

* fixed greyscale (#593)

* add local to locally stored modules (#596)

* Add drawing rectangles module (#566)

* add drawing rectangle module

* changes

* White balance module (#585)

* white baalance module

* improved algorithm

* limit check

* Ability to set background color when "over cropping" to enlarge canvas (#563)

* ability to set background color when over cropping to enlarge canvas

* changes

* Clarify that saved sequence will only be available in this browser (#587)

* clarify that saved sequence will only be available in this browser

* changes

* changes

* changes

* Added a function to sequencer and then made the functionality available to crop and overlay module. (#592)

* Add manifest.json and cache static assets for offline use (#331)

* Add manifest.json

* cache static assets for offline use

* update cache

* add meta theme-color and change static files to be cache

* cache the files on network request

* caching on first run

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add a button to clear cache

* add styling to clear cache link

* Update Modules.js (#452)

I've arranged the modules in alphabetical order.

* Added a function to parse Input coordinates and added the functionality for crop and overlay modules

* Added changed dist files

* Revert "Added changed dist files"

This reverts commit dbda25a.

* Changed function name and added the functionaity to src/utils folder

* Added unit test

* Added unit test to /test/util

* Add border thickness and color in DrawRectangle module (#602)

* added border thickness functionality

* add color functionality
jywarren pushed a commit that referenced this pull request Jan 4, 2019
* fixed fastie

* fixed greyscale (#593)

* add local to locally stored modules (#596)

* Add drawing rectangles module (#566)

* add drawing rectangle module

* changes

* White balance module (#585)

* white baalance module

* improved algorithm

* limit check

* Ability to set background color when "over cropping" to enlarge canvas (#563)

* ability to set background color when over cropping to enlarge canvas

* changes

* Clarify that saved sequence will only be available in this browser (#587)

* clarify that saved sequence will only be available in this browser

* changes

* changes

* changes

* Added a function to sequencer and then made the functionality available to crop and overlay module. (#592)

* Add manifest.json and cache static assets for offline use (#331)

* Add manifest.json

* cache static assets for offline use

* update cache

* add meta theme-color and change static files to be cache

* cache the files on network request

* caching on first run

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add a button to clear cache

* add styling to clear cache link

* Update Modules.js (#452)

I've arranged the modules in alphabetical order.

* Added a function to parse Input coordinates and added the functionality for crop and overlay modules

* Added changed dist files

* Revert "Added changed dist files"

This reverts commit dbda25a.

* Changed function name and added the functionaity to src/utils folder

* Added unit test

* Added unit test to /test/util

* Add border thickness and color in DrawRectangle module (#602)

* added border thickness functionality

* add color functionality

* Bump tape from 4.9.1 to 4.9.2 (#579)

Bumps [tape](https://github.com/substack/tape) from 4.9.1 to 4.9.2.
- [Release notes](https://github.com/substack/tape/releases)
- [Commits](tape-testing/tape@v4.9.1...v4.9.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump looks-same from 4.1.0 to 5.0.1 (#559)

Bumps [looks-same](https://github.com/gemini-testing/looks-same) from 4.1.0 to 5.0.1.
- [Release notes](https://github.com/gemini-testing/looks-same/releases)
- [Changelog](https://github.com/gemini-testing/looks-same/blob/master/CHANGELOG.md)
- [Commits](gemini-testing/looks-same@v4.1.0...v5.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump jsqr from 0.2.2 to 1.1.1 (#532)

Bumps [jsqr](https://github.com/cozmo/jsQR) from 0.2.2 to 1.1.1.
- [Release notes](https://github.com/cozmo/jsQR/releases)
- [Commits](https://github.com/cozmo/jsQR/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update color drop down (#595)

* updated drop down

* fixed greyscale (#593)

* add local to locally stored modules (#596)

* Add drawing rectangles module (#566)

* add drawing rectangle module

* changes

* White balance module (#585)

* white baalance module

* improved algorithm

* limit check

* Ability to set background color when "over cropping" to enlarge canvas (#563)

* ability to set background color when over cropping to enlarge canvas

* changes

* Clarify that saved sequence will only be available in this browser (#587)

* clarify that saved sequence will only be available in this browser

* changes

* changes

* changes

* Added a function to sequencer and then made the functionality available to crop and overlay module. (#592)

* Add manifest.json and cache static assets for offline use (#331)

* Add manifest.json

* cache static assets for offline use

* update cache

* add meta theme-color and change static files to be cache

* cache the files on network request

* caching on first run

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add a button to clear cache

* add styling to clear cache link

* Update Modules.js (#452)

I've arranged the modules in alphabetical order.

* Added a function to parse Input coordinates and added the functionality for crop and overlay modules

* Added changed dist files

* Revert "Added changed dist files"

This reverts commit dbda25a.

* Changed function name and added the functionaity to src/utils folder

* Added unit test

* Added unit test to /test/util

* Add border thickness and color in DrawRectangle module (#602)

* added border thickness functionality

* add color functionality

* rebuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants