Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20469] Hyperloop is re-writing source JS then failing subsequent clean builds

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-05-10T17:21:38.000+0000
Affected Version/sRelease 5.2.0
Fix Version/sRelease 5.4.0
ComponentsHyperloop, iOS, Tooling
Labelshyperloop, hyperloop-metabase, ios
Reporterkosso
AssigneeJeff Haynie
Created2016-02-27T00:33:29.000+0000
Updated2016-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...

Comments

  1. Hans Knöchel 2016-02-28

    This issue is related to the Hyperloop metabase, updating labels accordingly.
  2. Chee Kiat Ng 2016-04-18

    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 5

    Expected result

    app will build with no error for all the steps above.
  3. kosso 2016-04-18

    *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.
  4. Chee Kiat Ng 2016-04-18

    [~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.
  5. kosso 2016-04-18

    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.
  6. Hans Knöchel 2016-04-18

    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!
  7. Chris Barber 2016-04-18

    Agreed. Hyperloop should NOT modify any files that aren't in the build directory. This includes the Resources directory and tiapp.xml.
  8. Hans Knöchel 2016-04-19

    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:
       <property name="run-on-main-thread" type="bool">true</property>
       <ios>
           <use-jscore-framework>true</use-jscore-framework>
       </ios>
       
    5. Insert one Hyperloop component e.g. app.js:
       var UIView = require("UIKit/UIView");
       
    4. Run the project: ti build -p ios 5. Inspect the error:
       [INFO]  Starting Hyperloop assembly
       [DEBUG] Using Hyperloop library -> libhyperloop-jscore.a
       [DEBUG] [Hyperloop] No CocoaPods file found
       [DEBUG] No change, skipping /Users/hans/Desktop/test/Resources/app.js
       [DEBUG] No change, skipping /Users/hans/Desktop/test/Resources/colorpicker.js
       [INFO]  Skipping Hyperloop compile, no usage found ...
       [TRACE] Forcing regeneration of wrappers
       [DEBUG] Generating stubs
       Caught exception: TypeError: Cannot convert undefined or null to object
       
    6. Run the project again: ti build -p ios 7. Watch the logs:
       [WARN]  Hyperloop is currently available in Beta and should not be used for production applications.
       [INFO]  Starting Hyperloop assembly
       [DEBUG] Using Hyperloop library -> libhyperloop-jscore.a
       [DEBUG] [Hyperloop] No CocoaPods file found
       [DEBUG] No change, skipping /Users/hans/Desktop/test/Resources/app.js
       [DEBUG] No change, skipping /Users/hans/Desktop/test/Resources/colorpicker.js
       [INFO]  Skipping Hyperloop compile, no usage found ...
       [TRACE] Symbol references up-to-date
       [DEBUG] Skipping stub generation
       [INFO]  Finished Hyperloop assembly in 0.98 seconds
       
    8. The build now succeeds, but throws a new error:
       Couldn't find module "hyperloop/uikit/uiview for architecture ...
       
    9. Inspect the above app.js and notice, that the contents have been rewritten to:
       var UIView = require("hyperloop/uikit/uiview");
       
  9. kosso 2016-04-19

    Now, when you look at your app.js, has it changed require('UIKit/UIView') to require('hyperloop/uikit/uiview') ?
  10. Hans Knöchel 2016-04-19

    [~kosso] Just updated my comment, yes it does.
  11. Jeff Haynie 2016-04-26

    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
  12. Jeff Haynie 2016-04-26

    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.
  13. Hans Knöchel 2016-05-06

    PR: https://github.com/appcelerator/hyperloop.next/pull/27
  14. Chee Kiat Ng 2016-05-09

    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:
            <property name="run-on-main-thread" type="bool">true</property>
            <ios>
            	<use-jscore-framework>true</use-jscore-framework>
            </ios>
            	<modules>
        		<module>hyperloop</module>
        	</modules>
        	<plugins>
        		<plugin>hyperloop</plugin>
        	</plugins>
        
    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.3
  15. Chee Kiat Ng 2016-05-09

    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:
            <property name="run-on-main-thread" type="bool">true</property>
            <ios>
            	<use-jscore-framework>true</use-jscore-framework>
            </ios>
            	<modules>
        		<module>hyperloop</module>
        	</modules>
        	<plugins>
        		<plugin>hyperloop</plugin>
        	</plugins>
        
    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.1
  16. Wilson Luu 2016-05-09

    After 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)
  17. Hans Knöchel 2016-05-10

    [~wluu] Just to be sure, you added Hyperloop-related content in your app, e.g. var UIView = require("UIKit/UIView");?
  18. kosso 2016-05-10

    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. ;)
  19. Wilson Luu 2016-05-10

    [~hansknoechel], Yep. Used your gist here for iOS: https://gist.github.com/hansemannn/3ea14512f894bc507a5cea57336b7f77. And, used the Hyperloop label example for Android; this part:
        	var TextView = require('android.widget.TextView'),
        		Activity = require('android.app.Activity'),
        		Color = require('android.graphics.Color'),
        		View = require('android.view.View'),
        		TypedValue = require('android.util.TypedValue'),
        		Typeface = require('android.graphics.Typeface'),
        		activity = new Activity(Ti.Android.currentActivity);
        
  20. Hans Knöchel 2016-05-10

    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.
  21. Brian García 2016-05-10

    @hansKnoechel so no chance of testing the bug fixes? I've a few ones that I would like to test. Thanks!
  22. kosso 2016-05-10

    Thanks @Hans. Do you have a link to the 1.2.0 Hyperloop module zip? I'm on the 5.4.0+ SDK.
  23. Wilson Luu 2016-07-26

    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)

JSON Source