Search code examples
extjsextjs6extjs6-classicextjs7

ExtJS7: Working of onAppUpdate for Application


I am asking this as I could not find guide related to same on official Documentation. Here is I am experiencing so far in my testing.

1.) User browses the ExtJS v7 app

2.) User refreshesh it, ExtJS detects stale cache

3.) onAppUpdate is triggered and on confirmation does the hard reload or expire cache and reload

Here is what I was expecting

1.) User browses the ExtJS v7 app

2.) On any request to server after new build sends response that notifies app of new build

3.) onAppUpdate is triggered and on confirmation does the hard reload or expire cache and reload

Because while using ExtJS v7 app or SPA, user rarely will refresh making this feature not as useful.

Is there a way that we could curate a request to backend that would tell us if new build is there and onAppUpdate can be triggered by api call?


Solution

  • The onAppUpdate functionality is done during the microloader, as part of loading the Javascript from the server. It's not triggered while the app is still running.

    If you need that functionality, you could have a timer task that polls a version file (that you'd need to manage and package as part of the build process); if the timer task detects that the version has changed, you can refresh the page to reload the app.