[TIMOB-20469] Hyperloop is re-writing source JS then failing subsequent clean builds
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-05-10T17:21:38.000+0000 |
Affected Version/s | Release 5.2.0 |
Fix Version/s | Release 5.4.0 |
Components | Hyperloop, iOS, Tooling |
Labels | hyperloop, hyperloop-metabase, ios |
Reporter | kosso |
Assignee | Jeff Haynie |
Created | 2016-02-27T00:33:29.000+0000 |
Updated | 2016-07-28T22:13:22.000+0000 |
Description
I posted this first (at length) with all the info and how to reproduce over on SO here :
http://stackoverflow.com/questions/35663301/hyperloop-is-re-writing-source-js-then-failing-subsequent-clean-builds
I've just updated to the latest 5.2.0.GA and am trying a simple Hyperloop test app.
Building the app causes references to hyperloop code in the source JavaScript to be re-written. Then it will fail the next rebuild due to Skipping Hyperloop compile, no usage found ... error, since JS code was re-written...
This issue is related to the Hyperloop metabase, updating labels accordingly.
I think it's an expected behavior for Hyperloop to rewrite the JS files in the Resource folder. I would suggest that you can stick to the alloy format, and edit files in the app folder instead so that hyperloop can work it's magic in the Resource folder. [~hansknoechel] Am i right? However, there is definitely a bug with regards to building after a ti clean. This PR will address that https://github.com/appcelerator/hyperloop.next/pull/18
Steps to test
1. *appc new* 2. install the hyperloop module locally 3. *appc ti build -p ios* 4. *appc ti clean* 5. *appc ti build -p ios* 6. repeat step 5Expected result
app will build with no error for all the steps above.*Nothing* should be permanently modifying my (Re)*source* JavaScript files at all. It renders them useless for the next build. I do not use Alloy at all. Always 'classic'. I do not want or intend to use Alloy. And if anything, Hyperloop will make it even easier for me to avoid having to do so. I have yet to get Hyperloop to work as demonstrated and instructed. Has anyone? The docs are in a PDF (seriously?). The link on the main Labs page links to a version 1.1.0 Beta : http://labs.appcelerator.com/project/55f74a9f421c44837717716b/Hyperloop-Module The Example Application contains version 1.0.1. So what's going on? What version should people be trying to use? Why is this even a discussion? It's not working as expected.
[~kosso] I haven't been active in the hyperloop project, which is why i asked and addressed the rest of the team about the re-writing just to check. Please understand that hyperloop hasn't productised and is still in the labs, so things aren't completely functional and documenting is not up to par. But our team is actively working hard on the project, and soon it will be much more stable and documents will be clearer when it GAs. Thank you for your patience, and these reports are of great help to us, and we greatly appreciate it.
Hi. I totally understand that it's not released yet. Please clarify, document and link to a *working* version for those us who spend our own time trying to help get these projects to a state of productisation. Or we just waste our time. :) I've watched a couple of video demonstrations of the features of Hyperloop and neither of them had their actual source JavaScript re-written after building the apps.
Hi [~kosso], thanks for your feedback! The fact that we have a 1.0.0 in labs and 1.0.1 in hyperloop-examples is my fault, you can blame me for that ;-). We will update both this week after one outstanding blocker and this ticket are resolved. Thank you!
Agreed. Hyperloop should NOT modify any files that aren't in the
build
directory. This includes theResources
directory andtiapp.xml
.Just tested the latest version and it does not seem to work with classic projects: 1. ti create 2. install the hyperloop module + plugin locally 3. Copy the required tiapp flags:
5. Insert one Hyperloop component e.g. app.js:
4. Run the project:
ti build -p ios
5. Inspect the error:6. Run the project again:
ti build -p ios
7. Watch the logs:8. The build now succeeds, but throws a new error:
9. Inspect the above app.js and notice, that the contents have been rewritten to:
Now, when you look at your app.js, has it changed
require('UIKit/UIView')
torequire('hyperloop/uikit/uiview')
?[~kosso] Just updated my comment, yes it does.
I think we made a business decision early on to only support Alloy projects. We'll need to make changes to support classic which I think is ok
For this to work with both classic and alloy, i'm going to need to re-write a bit of the plugin... not too bad, but will take me a few hours. i'm working on it now.
PR: https://github.com/appcelerator/hyperloop.next/pull/27
Steps to test
1. With the latest PR, do *./build.sh* 2. Using latest 5.4.0 master(i used *5.4.0.v20160508201414*), create a new classic project *appc new --t titanium --classic* 3. in tiapp.xml, include these properties:4. install the built hyperloop module in hyperloop.next/dist into this new project 5. overwrite app.js with https://gist.github.com/hansemannn/3ea14512f894bc507a5cea57336b7f77 6. *appc run -p ios*
Expected Result
app.js content does not change. Here's the environment i used: appc cli core 5.3.0-43 appc npm 4.2.5-5 xcode 7.3Steps to test
1. With the latest PR, do *./build.sh* 2. Using latest 5.4.0 master(i used *5.4.0.v20160508201414*), create a new classic project *appc new --t titanium --classic* 3. in tiapp.xml, include these properties:4. install the built hyperloop module in hyperloop.next/dist into this new project 5. overwrite app.js with https://gist.github.com/hansemannn/3ea14512f894bc507a5cea57336b7f77 6. *appc run -p ios*
Expected Result
app.js content does not change. on device and on simulator. Here's the environment i used: appc cli core 5.3.0-43 appc npm 4.2.5-5 xcode 7.3 device: iPhone 6s plus iOS 9.3.1After building Hyperloop 1.2.0 from PR https://github.com/appcelerator/hyperloop.next/pull/27, I was able to: * Install a Classic and Alloy app to an iOS device/simulator. * Install a Classic and Alloy app to an Android device/emulator. * Install multiple times from a clean and dirty builds i.e.
appc ti clean
. Tested on: Hyperloop: 1.2.0 Appc CLI NPM: 4.2.5-5 Appc CLI Core: 5.3.0-44 Arrow: 1.7.31 SDK: 5.4.0.v20160509073931 Node: v4.4.0 OS: El Capitan (10.11.4) Xcode: 7.3 Devices: iphone simulator (9.3), iphone 6 plus (9.1), Nexus S (6.0), Android Emulator (5.0)[~wluu] Just to be sure, you added Hyperloop-related content in your app, e.g.
var UIView = require("UIKit/UIView");
?If someone can provide a link to a pre-built 1.2.0 hyperloop module I can try this too. I'm updated everywhere else. Thanks. I'm excited to get this working. ;)
[~hansknoechel], Yep. Used your gist here for iOS: https://gist.github.com/hansemannn/3ea14512f894bc507a5cea57336b7f77. And, used the Hyperloop label example for Android; this part:
Thanks Wilson, just merged! [~kosso]: As we are near code-freeze for 5.4.0, there will probably not be another public beta before GA release in mid-june.
@hansKnoechel so no chance of testing the bug fixes? I've a few ones that I would like to test. Thanks!
Thanks @Hans. Do you have a link to the 1.2.0 Hyperloop module zip? I'm on the 5.4.0+ SDK.
Closing ticket as fixed. Verified that if you use Hyperloop in your classic or Alloy project, then JS will not fail on subsequent clean/dirty builds. Note: Applied the workaround from TIMOB-23629 first in order to verify the fix. Tested on: Appc CLI NPM: 4.2.7 Appc CLI Core: 5.4.0-35 Arrow: 1.8.2 SDK: 5.4.0.v20160725003348 Node: v4.4.7 OS: Mac OS X (10.11.6) Xcode: 7.3.1 Devices: iphone 6 plus (9.1), iphone 6s simulator (9.3)