How can I speed up debugging in Sencha Touch? - sencha-touch

I'd like to be able to speed-up the debugging process when building Sencha Touch apps. At the moment I have to disable caching as any changes I make to the source would not get updated when refreshing the application and I also want to persist breakpoints in Chrome.
How can I both cache the files that are unlikely to change but refresh those that do?
Currently, when I press Ctrl+F5, it takes 4-5 seconds to load the app. It's loading all the Sencha Touch required .js files as well as any for the app itself. I think what I would like to do is cache on a path basis, so any files on the sencha touch source folder are cached and not re-loaded, but app files aren't.

try using an application cache manifest you can learn to configure one here. Application cache is not for folders though but for files so you have to include all files that you want to be cached permanantly.

Related

how could we access the images located outside the expo project?

I created a mobile app by expo (react native), I would like to display profile image, knowing that the images are located outside my project.
when I want to access any image I do not get there, and I get this type of error
"SHA-1 for file (D:\Workspace\ImagesProfile\images3.jpg) is not computed".
this is the hierarchy of my workspace.
-Workspace
--ImagesProfile
--Myproject
Pleace how can we solve this problem?
The way the react-native packager works right now, it's just going to scan the roots of your project and below when creating the JavaScript bundle, so it will be really hard to do this.
You basically just need to put the files under the root of your directory. There are some tools out there for syncing files from another directory into a directory under the root so you could use one of those if you really need to.
Some people are working on ways to make symlinks work with this. Notably, you might look at Haul from Callstack. https://github.com/callstack-io/haul But that isn't integrated into Expo yet.
Okay at first you should understand what you are doing. You're creating a react native application, which means this application is running on external devices and not on your PC. Your simulator or expo client running your application encapsulated from your PC using only project files. When you wanna use external images in your application you need to host them. You can create a local docker instance as image server ( e.g. an express application with a static folder ).
To make it clear, it's not possible to use images inside your filesystem which are not a part of your react native application. You can use external image server like "imgbb" for test purposes, but it's not recommended to use them in your final version.
Happy Coding!

How can I prevent calabash-android from pushing the apk for every feature file?

When I run calabash-android, it appears to push the apk to the device for every feature file. I would prefer to push the apk once and reuse it, as each push takes about half a second, and I expect eventually to have enough feature files for this to matter. I'd be happy with a solution which doesn't push the apk at all and to push it myself in an earlier step.
Is it pushing the app each time or just restarting the app? My tests restart between each step by default but I have always had to control the installations.
I deal with the installation by tagging the scenarios that require a reinstall and looking for the tag in my before hook.
If it is the restarting between scenarios that you want to control then you can use the RESET_BETWEEN_SCENARIOS setting.

How to disable phonegap autoreload (At least during dev)

Here is my issue:
I've installed phonegap and phonegap desktop.
http://code.riffzone.net/phonegap-install-msw/
Now, when I'm working on my application (Jquery Mobile), I'm testing it on a browser, but the application is reloading again and again after every 2 seconds and I can't even write something in the form input, reloading to fast..
I don't understand where this is coming from?
Here is the screen shot of my browser and the firebug console where you can see the page reloading over and over (1) and the api_auto_reload in the console (2).
Thanks a lot :)
The reload should be triggered only when some of your source files is changed. For some reason it does detect change on your files constantly. That reason is quite hard to find out without debugging more. You can, though, turn the auto reload off with --no-autoreload switch for phonegap serve like this
phonegap serve --no-autoreload
It was phonegap desktop beta (the minimalist server) and not phonegap (command line) which was causing this bug.
If you have the same issue, make sure you are not using it.

How to reduce the size of Sencha Touch Application?

I am building a Sencha Touch application. Even the most basic application is of size 27 MB. Now I want to commit the code online. The touch folder inside the application is of 20 MB which is way too much.
So how can I compress my application and reduce the size of my application?
use sencha cmd to minify to one js file.
from the application's root in the terminal or command prompt, run "sencha app build production" or "sencha app build testing" dependent on if you want the source code minified also.
Make sure you have sencha cmd installed first.
Also make sure each of your classes is requiring only the source components you need. What you're doing right now is deploying every single line of sencha touch, whereas in reality, if you're not using the carousel component, for instance, you don't need this in your deployed app.
Requiring in the classes you need only, and then building the app file in this way, will give you a nice compact single js file that is many many times smaller.
At first, what do you want is not clear. Why you want to compress the application?
If you want to run it on device, you can minify it using sencha cmd. From within your application folder run this command
sencha app build production
and you can see your app size(build version) will reduce drastically. Further you can make apk and/or ipa with this build version only.

How do I speed up load times for Sencha Touch

I am currently developing a Sencha Touch application using Cloud 9 IDE. I created the app on my local machine and later imported the project to Cloud 9. Everything works fine but an annoyance that happens is the load times for my page are greater than a minute. I think it has to do with all the files that are being individually loaded.
What is the best way to speed up the sdk load times? I am unsure how to use the sdk tools and do not know if you can even install them into Cloud 9. Would it be better to abandon the sdk tools and load Sencha manually?
Key is to minify & aggregate all the JS & CSS so that less number of bytes are transferred in less number of http calls. Sencha Cmd has the feature to do all this and create a packaged build to load fast, here is what you have to do from your app directory:
sencha app build package
This will create .>build>package folder with minified version of your app.
For more details read http://docs.sencha.com/touch/2-1/#!/guide/command and look at this http://vimeo.com/55148644 for illustration