[TIMOB-23818] Hyperloop: Command to trigger metabase generation
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Hyperloop, Tooling |
Labels | n/a |
Reporter | Feon Sua Xin Miao |
Assignee | Jan Vennemann |
Created | 2016-08-24T19:52:01.000+0000 |
Updated | 2017-11-10T17:08:39.000+0000 |
Description
Run a Hyperloop enable project with Liveview, modify project file with new Hyperloop requires will trigger a Liveview reload. If the required reference hasn't been generated on the first build, Liveview will spit out error, i.e
Couldn't find module: UIKit/UITableView for architecture: x86_64
.
Liveview needs a way to trigger hyperloop metabase regeneration.
*Step to Reproduce*
1. Create a project with Hyperloop enabled, add var UIView = require('UIKit/UIView');
2. Enable Liveview, run the project
3. Modify the code to reference Hyperloop, add var UITableView = require('UIKit/UITableView');
*Actual Result*
Couldn't find module: UIKit/UITableView for architecture: x86_64
error in the output.
If you look into <projectDir>/build/iphone/build/Products/Debug-iphonesimulator/<APPNAME>.app/hyperloop/uikit
folder, you'll find uitableview.js
file missing.
There is a public
generateMetabase
that could be triggered, although it would need refactoring to be called independently.As Liveview works outside of the normal build pipeline there is currently no way make it work properly with Hyperloop. Although it would be possible to regenerate missing JS files there is also some native helper code required to properly support blocks and framework function such as
CGRectMake
. Those would required a new build to be available in the app, something which Liveview is not capable of. The only way to fix that would be to generate ALL available APIs during the build, not just the ones that are actually used in the code but that would have an significant impact on the app size and i wouldn't consider that as a viable solution at all. I added a new section to the [Hyperloop FAQ](https://wiki.appcelerator.org/display/FAQ/Hyperloop+FAQ#HyperloopFAQ-Liveview) to reflect the current limitations related to Hyperloop usage with Liveview. *Edit:* Just an idea: We could try to alter the metabase generation behavior into dev and production. So in dev we generate all JS proxies and helper code so on consequent build we don't have to check for any new Hyperloop requires and Liveview would work. This should also have a positive impact on build time for consequent build. On release builds we continue with our current behavior and only generate things for APIs that are actually used.