6

So... as I have read through the Sencha Command documentation, it tells me that the build will automagically (using Phantom JS) be able to tell me what all of my dependencies are, and in what order. Based off of that, I am expecting the "sencha app build production" command to concatenate all of my dependencies into one js file, regardless of whether I have manually included them in the app.json file. However, I am not seeing this happen.

Do I have to manually maintain a list of JS files in the app.json? If so, then that is fine. I just have understood different from the documentation. Please help.

edit--
So my index.html is very minimal. It only has a script tag to one external resource js file, and one script tag to the 'sdk/microloader/development.js'. My app.js isn't referenced on my index.html. When I terminal into my app dir and run the "sencha app build production" command, it finishes without an error. However, it only finds 53 dependencies, when I know that we have well over 500. Here is the output in the terminal when I run the build:

aaronfrost@topnotch ~/source/ab/AreaBook/web/src/main/webapp/sencha2 $ sencha app build -e production 
[INFO] Deploying your application to /home/aaronfrost/source/ab/AreaBook/web/src/main/webapp/sencha2/build/production
[INFO] Copied sdk/sencha-touch.js
[INFO] Copied app.js
[INFO] Copied resources/css/app.css
[INFO] Copied resources/icons
[INFO] Copied resources/loading
[INFO] Resolving your application dependencies (file:////path/to/my/sencha2/index.html)
[INFO] Found 53 dependencies. Concatenating all into '/dir/to/my/sencha2/build/production/app.js'
[INFO] Processed sdk/sencha-touch.js
[INFO] Minifying sdk/sencha-touch.js
[INFO] Processed app.js
[INFO] Minifying app.js
[INFO] Minifying resources/css/app.css
[INFO] Minified sdk/sencha-touch.js
[INFO] Minified app.js
[INFO] Minified resources/css/app.css
[INFO] Generated app.json
[INFO] Embedded microloader into index.html
[INFO] Generating checksum for appCache item: index.html
[INFO] Generated cache.manifest

So then I look in my new app.js that is in my build/production folder, and it has concatenated a bunch of sencha dependencies together, but the only file of mine that get concat'd and minified is my app.js, which is the only js file referenced in my app.json. That is why I was wondering if I have to manually put it in the app.json to get it to get concat'd and minified. None of the dependencies listed in my app.js require section get included in the builded app.js.

In summary, it doesn't give me the same behavior that I would expect, to build my app.js with all of my dependencies. Any thoughts would be nice.

Titouan de Bailleul
  • 12,920
  • 11
  • 66
  • 121
frosty
  • 21,036
  • 7
  • 52
  • 74
  • Are you talking about ST2 dependencies (declared using 'requires') or are you talking about external dependencies? From what I understand, only the js files from your MVC architecture and the dependencies explicitly stated using 'requires' will be incorporated into your built app.js. If you want to include external js scripts (not related to ST2), then I think you have to mention them in app.json. Anyway, is it a good thing to mix ST2 scripts with external ones? Are these libraries? – borck May 10 '12 at 06:51
  • I am talking about ST2 dependencies. They are all inside a requires section in a class file. – frosty May 10 '12 at 06:54
  • That is strange... The number of dependencies you mention is indeed quite low. Were you able to determine which dependencies are missing? In my case, the sencha command always includes everything without the need to modify anything in app.json... Did you create your app with the sencha command? – borck May 10 '12 at 06:57
  • Yes. I did. At least knowing how it is supposed to work helps me not give up. Thank you! – frosty May 10 '12 at 07:16
  • I am thinking about ways to help you... Could you produce a minimal failing test case, and zip it maybe? – borck May 10 '12 at 07:17
  • Yeah. Let me get to it tomorrow. I really appreciate your help here! – frosty May 10 '12 at 08:03
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/11126/discussion-between-aaronfrost-and-borck) – frosty May 10 '12 at 19:13

1 Answers1

1

From my experience, I never had to modify the app.json. Everything that is mentioned in a 'Ext.requires' statement is automatically concatenated in the final (unique) js file by the sencha command.

If you still have problems, maybe you should give some more details about the files that are not correctly treated.

borck
  • 928
  • 10
  • 19