Does sencha load all files of all profiles while deploying to a particular profile?

StackOverflow https://stackoverflow.com/questions/22582448

  •  19-06-2023
  •  | 
  •  

Question

I am developing a Sencha Touch2 application. I am using profiles for creating different views for different device types like tablets, desktops and mobile. But when the application is loaded in any particular device type say mobile, does it load only files related to mobile or does it loads all the files of all device types.

Was it helpful?

Solution

If you are listing profiles as such:

Ext.application({
    profiles : [ 'Phone', 'Tablet' //etc ]
})

Then yes, Sencha Touch will load each of the profile classes and any dependencies listed in their requires blocks. It does this because the framework will look at each profile to determine which is "active" at any given time, and it's better to take the time to load dependencies at startup than randomly at runtime.

Now you could write some logic before running Ext.application() to manually load the necessary profile data... but that's going to be tricky in most cases.

In either case, you should be using Sencha Cmd to minify your code into a production build - so the memory footprint would be smaller and the application would load much faster.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top