0

I am developing a large single-page web application in ExtJS 6 (classic toolkit) that primarily consists of a tab panel. There will eventually be several hundred different "screens" that can be opened as tabs.

The core structure of the app, and various components that are common across screens (grids, forms, etc), will be loaded with the page as usual (minified by Sencha Cmd for production or discovered via requires declarations in development). But the view components for each screen will only be loaded when that specific screen is requested, via an Ext.require() call.

Changes to the core components of the app will require a browser refresh to update the page with the changes, and that is fine. These will be relatively rare. But during the development of a single screen, changing its specific view component and refreshing to observe changes will also require a browser refresh.

Refreshing the whole app in this case seems like unnecessary overhead. Given that I'm downloading the relevant screen-based JS file on-the-fly anyway (at least the first time it is required), it seems it should be possible to force a re-download of it so that just the screen being worked on can be refreshed.

So, is it possible to force such a re-download, using Ext.require() or some other method?

oogles
  • 1,202
  • 1
  • 20
  • 29
  • 1
    Not really, because when you download the class the first time you're also wiring a bunch of stuff up. – Evan Trimboli Mar 27 '17 at 21:54
  • It is not possible to trick extjs/javascript into "forgetting" about the class, allowing the re-download to take place and re-wire all that stuff up? – oogles Mar 27 '17 at 22:21
  • Not easily no. You may be able to do some kind of really naive replacement, like this: https://gist.github.com/evantrimboli/ff17ed915324ec834720e4b5c57e2372 but you're still likely to run into problems doing that. – Evan Trimboli Mar 27 '17 at 22:36
  • Ugh, no, if there isn't something considerably neater than that, I'll just live with it :). Thanks for the help. If you want to post an answer, I'll mark it accepted. – oogles Mar 28 '17 at 00:01

0 Answers0