GithubHelp home page GithubHelp logo

Comments (8)

amiuhle avatar amiuhle commented on July 20, 2024

I just noticed there might be some stuff regarding this in the v3 branch, will have a look at it!

from offline-plugin.

NekR avatar NekR commented on July 20, 2024

I just noticed there might be some stuff regarding this in the v3 branch, will have a look at it!

Hi @amiuhle, yes, this is resolved in v3, but it's not ready yet. CHANGELOG contains all the information about what was changed, but if you will need any help--let me know.

Right now I can refresh the Browser all day, unless I close the tab the SW will always give me the old, cached content...

Yes, this is how SW works by default unless you tell to it to behave differently.

For AppCache, this results in a changed manifest file, which will download the new files and fire an updateready event. I can then tell the user that there is new content available and refresh the page.

Fun fact, at first I started making those events for AppCache first, but events are so buggy and inconsistent between browsers when AppCache is used from iframe. I literally spent 2 weeks trying to make it "right" and then gave up. I will probably make AppCache disabled by default in v3, because I have it now, but still will support it as fallback.

Should we close this now or may be you have some suggestions here?

from offline-plugin.

amiuhle avatar amiuhle commented on July 20, 2024

Thanks for the feedback!

I just started playing with the v3 branch. I'll mention this issue, should I make any PRs regarding v3 functionality.

from offline-plugin.

NekR avatar NekR commented on July 20, 2024

should I make any PRs regarding v3 functionality.

Yes, please. Feel free to do that. Any help is welcome :-)

from offline-plugin.

amiuhle avatar amiuhle commented on July 20, 2024

So, I'm successfully using the v3 now, using updateStrategy: 'all'.

I'm supplying all supported callbacks for runtime.install, and onUpdateReady is called when the version changes. However, I can do a window.location.reload(true), but the old SW will still only serve my old content, and the new one is not updated.

Do you have update functionality working? Can you supply your configuration, please?

Also, the README is not up to date in the v3 branch. I understand you don't want to update the documentation before the features are final, but maybe you could open an issue as a roadmap for v3 where you have a TODO list and a rough outline of where you want to go with v3. I really would like to help, but without understanding where you're going with the next version, it's kind of hard...

from offline-plugin.

amiuhle avatar amiuhle commented on July 20, 2024

I just saw the applyUpdate function, so forget the top half of my last comment.

I still think a 'v3 Roadmap' issue would be a good idea though!

from offline-plugin.

NekR avatar NekR commented on July 20, 2024

Also, the README is not up to date in the v3 branch.

I am working on update README, but yes, it's not in priority.

but maybe you could open an issue as a roadmap for v3 where you have a TODO list and a rough outline of where you want to go with v3.

Sounds good. I can do that. Basically what I plan for v3 is marked as milestone 3.0 in issue. Not all issues marked 3.0 must be in it, but this is how I mark them "for next release".

I will make a pull request from v3 to master and will describe what I plan for v3. But I still prefer to track thing in issues, e.g. one issue per problem/feature. Probably I can just make a list of issues in that PR.

... and, thanks for your suggestions and willingness to help :-)

from offline-plugin.

NekR avatar NekR commented on July 20, 2024

Btw, this is how I use update events:

const runtime = require('offline-plugin/runtime');

runtime.install({
  onUpdating: () => {
    console.log('SW Event:', 'onUpdating');
  },
  onUpdateReady: () => {
    console.log('SW Event:', 'onUpdateReady');
    runtime.applyUpdate();
  },
  onUpdated: () => {
    console.log('SW Event:', 'onUpdated');
    window.location.reload();
  },

  onUninstalled: () => {
    console.log('SW Event:', 'onUninstalled');
  }
});

from offline-plugin.

Related Issues (20)

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.