`ts run -u` : update option send only update files, But alloy compiles all files. #388

Closed
yomybaby opened this Issue Jan 9, 2015 · 19 comments

Projects

None yet

6 participants

@yomybaby
Contributor
yomybaby commented Jan 9, 2015

I love ts @ run -u command! Because it's so fast to check out changes.

But these day I feel that it's much slower than before.

Alloy compiler make all file even there is -u option.

see below log: I just change reservation.xml file. But Alloy compiles all files & optimizes all files.

[DEBUG] changed: /Users/yomybaby/Documents/TiWorkspace/sss/app/views/reservation.xml
[INFO] Beginning Build Process
[INFO] Compiling Alloy for ios
[INFO]  [config.json] regenerating CFG.js from config.json...
[INFO] ----- MVC GENERATION -----
[INFO] [global style] loading from cache...
[INFO] [day.xml] yo.calendar view processing...
[INFO]   style:      "day.tss"
[INFO]   view:       "day.xml"
[INFO]   created:    "Resources/iphone/alloy/widgets/yo.calendar/controllers/day.js"
[INFO]   created:     "Resources/iphone/alloy/widgets/yo.calendar/styles/day.js"
[INFO] [widget.xml] yo.calendar view processing...
[INFO]   style:      "widget.tss"
[INFO]   view:       "widget.xml"
[INFO]   controller: "widget.js"
[INFO]   created:    "Resources/iphone/alloy/widgets/yo.calendar/controllers/widget.js"
[INFO]   created:     "Resources/iphone/alloy/widgets/yo.calendar/styles/widget.js"
[INFO] [history.xml] view processing...
[INFO]   style:      "history.tss"
[INFO]   view:       "history.xml"
[INFO]   controller: "history.js"
[INFO]   created:    "Resources/iphone/alloy/controllers/history.js"
[INFO]   created:     "Resources/iphone/alloy/styles/history.js"
[INFO] [index.xml] view processing...
[INFO]   style:      "index.tss"
[INFO]   view:       "index.xml"
[INFO]   controller: "index.js"
[INFO]   created:    "Resources/iphone/alloy/controllers/index.js"
[INFO]   created:     "Resources/iphone/alloy/styles/index.js"
[INFO] [main.xml] view processing...
[INFO]   style:      "main.tss"
[INFO]   view:       "main.xml"
[INFO]   controller: "main.js"
[INFO]   created:    "Resources/iphone/alloy/controllers/main.js"
[INFO]   created:     "Resources/iphone/alloy/styles/main.js"
[INFO] [menu.xml] view processing...
[INFO]   style:      "menu.tss"
[INFO]   view:       "menu.xml"
[INFO]   controller: "menu.js"
[INFO]   created:    "Resources/iphone/alloy/controllers/menu.js"
[INFO]   created:     "Resources/iphone/alloy/styles/menu.js"
[INFO] [notice.xml] view processing...
[INFO]   style:      "notice.tss"
[INFO]   view:       "notice.xml"
[INFO]   controller: "notice.js"
[INFO]   created:    "Resources/iphone/alloy/controllers/notice.js"
[INFO]   created:     "Resources/iphone/alloy/styles/notice.js"
[INFO] [point.xml] view processing...
[INFO]   style:      "point.tss"
[INFO]   view:       "point.xml"
[INFO]   controller: "point.js"
[INFO]   created:    "Resources/iphone/alloy/controllers/point.js"
[INFO]   created:     "Resources/iphone/alloy/styles/point.js"
[INFO] [reservation.xml] view processing...
[INFO]   style:      "reservation.tss"
[INFO]   view:       "reservation.xml"
[INFO]   controller: "reservation.js"
[INFO]   created:    "Resources/iphone/alloy/controllers/reservation.js"
[INFO]   created:     "Resources/iphone/alloy/styles/reservation.js"
[INFO] [setting.xml] view processing...
[INFO]   style:      "setting.tss"
[INFO]   view:       "setting.xml"
[INFO]   controller: "setting.js"
[INFO]   created:    "Resources/iphone/alloy/controllers/setting.js"
[INFO]   created:     "Resources/iphone/alloy/styles/setting.js"
[INFO] 
[INFO] [app.js] using cached app.js...
[INFO] 
[INFO] ----- OPTIMIZING -----
[INFO] - alloy/moment.js
[INFO] - iphone/alloy.js
[INFO] - iphone/colors.js
[INFO] - iphone/moment.i18n.js
[INFO] - iphone/q.js
[INFO] - iphone/xp.ui.js
[INFO] - iphone/yo.ui.js
[INFO] - iphone/alloy/moment.js
[INFO] - iphone/alloy/sync/localStorage.js
[INFO] - iphone/alloy/sync/properties.js
[INFO] - iphone/alloy/sync/sql.js
[INFO] - iphone/alloy/widgets/yo.calendar/controllers/day.js
[INFO] - iphone/alloy/widgets/yo.calendar/controllers/widget.js
[INFO] - iphone/alloy/widgets/yo.calendar/styles/day.js
[INFO] - iphone/alloy/widgets/yo.calendar/styles/widget.js
[INFO] 
[INFO] Alloy compiled in 4.91001s
[INFO] 1 file(s) bundled.
[INFO] Uploading...
OK[INFO] [iphone, 8.1, 172.30.22.1] Unpacking new bundle:
@dbankier
Owner
dbankier commented Jan 9, 2015

Yep. This is a known issue and it is a limitation with alloy.
BUT - you can do it. (Sort of).

Read this blog post by @xavierlacot.

The PR was just merged: appcelerator/alloy#625
According the JIRA its due for Alloy 1.7.0.

Xavier does it with a nifty grunt file (which I've used), but once the change is in an official release, I'll updated tishadow.

(There are cases where it doesn't work and a full alloy compilation is necessary, but we'll take care of those cases.)

@yomybaby
Contributor
yomybaby commented Jan 9, 2015

Cool!! ๐Ÿ‘

@dbankier dbankier added a commit that closed this issue Feb 5, 2015
@dbankier closes #388 - selective alloy compilation
Please read the issue for more details.
bc95715
@dbankier dbankier closed this in bc95715 Feb 5, 2015
@dbankier
Owner
dbankier commented Feb 5, 2015

All done. For this to work today you need to use:

  • alloy from master - the merged change from @xavierlacot isn't in production.
  • tishadow from master - haven't released this change either.
  • use the ts config --boost command to turn on selective compilation for watched (@) changes.

If you are using another build system, run and spec now support the -f or --alloy-compile-file <filename> flag to selectively compile an alloy file.

@yomybaby
Contributor
yomybaby commented Feb 5, 2015

Cool!! Thanks.

@xavierlacot

๐Ÿ‘ @dbankier, thanks!

@dbankier
Owner
dbankier commented Feb 5, 2015

Thanks @xavierlacot, it is mostly your work on the alloy side, I'm just hooking into it.

@dbankier
Owner
dbankier commented Feb 6, 2015

FWIW - here is how JAST uses it in its Gruntfile.
https://github.com/dbankier/JAST/blob/master/Gruntfile.js

@jkotchoff

Hey, wow, awesome!

I just updated our JAST stack to your new one @dbankier and noticed that TiShadow is now flying through the alloy stuff but still taking about 12 seconds to process a list of all the javascript files under the '----- OPTIMIZING -----' heading in the log output
ie.

...
[INFO] [components/security.xml] view processing...
[INFO]   Not matching the file restriction, skipping
[INFO] [tablet/securities.xml] view processing...
[INFO]   Not matching the file restriction, skipping
[INFO] [article_fullscreen.js] controller processing...
[INFO]   controller: "article_fullscreen.js"
[INFO]   created:    "Resources/android/alloy/controllers/article_fullscreen.js"
[INFO]   created:     "Resources/android/alloy/styles/article_fullscreen.js"
[INFO] 
[INFO] ----- OPTIMIZING -----
[INFO] - android/alloy.js
[INFO] - android/alloy/moment.js
[INFO] - android/alloy/models/Article.js
[INFO] - android/alloy/models/Dividend.js
[INFO] - android/alloy/models/Education_category.js
[INFO] - android/alloy/models/Filtered_security.js
[INFO] - android/alloy/models/Market_sector.js
...

Is anyone else experiencing this and does it ring a bell as something that can be disabled or sped up with configuration somewhere?

@dbankier
Owner
dbankier commented Feb 6, 2015

@jkotchoff, just fixed that in JAST. (You were getting a false positive.)

Have a look at the readme file. You need to set boost to true in the Gruntfile.js there to turn this feature on.

@yomybaby
Contributor
yomybaby commented Feb 6, 2015

It skips MVC GENERATION properly, But it still optimize all js files.
It looks like a bug of alloy master version.

@dbankier
Owner
dbankier commented Feb 6, 2015

@yomybaby, that happens when you tell it to compile a file that does not exist. In JAST I was passing "false" when boost was turned off. That is fixed.

@dbankier
Owner
dbankier commented Feb 6, 2015

Actually that doesn't make sense according to that trace. It skips optimisation for me. I will have look later.

@yomybaby
Contributor
yomybaby commented Feb 6, 2015

I solved this problem and make PR to alloy. : appcelerator/alloy#661

There is a restrictionPath missing when call parseAlloyComponent for controller that has no correcpoding view markup.

@dbankier
Owner
dbankier commented Feb 6, 2015

Great!
On 06/02/2015 5:54 pm, "Jong Eun Lee" notifications@github.com wrote:

I solved this problem and make PR to alloy. : appcelerator/alloy#661
appcelerator/alloy#661

There is a restrictionPath missing when call parseAlloyComponent for controller
that has no correcpoding view markup.

โ€”
Reply to this email directly or view it on GitHub
#388 (comment).

@casevictor

So much great!

@dbankier dbankier referenced this issue in dbankier/JAST Feb 12, 2015
Closed

Alloy Compile Error #6

@dbankier
Owner

ts 2.8.0 released to support this.
you still need the ts config --boost to turn it on.

@nuno
nuno commented Feb 12, 2015

Hey @dbankier if I turn boost on ts config --boost this feature work well on express?
ex. ti build -p ios --shadow

@dbankier
Owner

It should. Make sure you are using alloy from master.

@nuno
nuno commented Feb 12, 2015

Thanks @dbankier!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment