GitHub Issue | n/a |
Type | Sub-task |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-09-16T23:06:32.000+0000 |
Affected Version/s | Release 2.1.0, Release 2.1.4, Release 3.1.1, Release 3.1.2 |
Fix Version/s | Sprint 2012-14 Core, Release 3.0.0 |
Components | iOS |
Labels | core |
Reporter | Stephen Tramer |
Assignee | Stephen Tramer |
Created | 2012-06-13T16:02:18.000+0000 |
Updated | 2016-05-16T17:42:24.000+0000 |
See umbrella bug for description. MobileWeb has already implemented this; see the ticket for the full details, but the general structure is:
* require('module.id') requires the main module JS
* require('module.id/sub-lib') requires the JS file 'sub-lib.js' which is loaded in the module
Introducing this may require some significant changes in iOS' module-loading infrastructure.
TESTING
----Module build
Create a new module project for iOS with the id
com.foo.bar
- only the ID matters. This module MUST be created with 2.1.0 SDK being tested with.Download the attached
assets.tar.gz
untar
assets.tar.gz
in the directory of the new module projectrun the module's
*PASS*:build.py
The module has built correctly
The module's
#* A nontrivialComFooBarModuleAssets
file contains:moduleAsset
method #* A nontrivialresolveModuleAsset:
method which contains the hash keys: #** com_foo_bar_js #** test1_js #** subdir/test2_js Once the module build passes testing, install it in~/Library/Application Support/Titanium
in the usual way.Project (2.1.0)
Download the attached
timob9524.tar.gz
and untar itImport the resulting directory into TiStudio
Run project
*PASS:* The console output from the app will include the following:This looks redundant but tests ALL of the following features: * Relative pathing outside modules * Relative pathing inside modules * Absolute pathing outside modules * Absolute pathing inside modules * Loading module resource before module * Loading module as
module.id/module.id
*IMPORTANT*: These modules are NOT compatible with any earlier versions of the SDK; this is both because of symbol loading errors, and because any module which loads resources outside of its main asset file will generate an exception.Module assets and timob project for testing.
Pull#2414 merged.
I just tried to do that and my "resolveModuleAsset" does not get filled with my modules js files I cant find where that method gets filled in the build process. Any help? THanks
Got it working, it was jspacker which wasnt liking some of my js files. Running from inside xcode you dont see the error from jspacker. Have to do it from the commandline
Following the described steps in SDK 3.1.0.GA , this doesn't seem to be working. I think the culprit may be changes to the build.py script.
Issue remains open for new SDK, tested on 2.1.4.GA and 3.1.2.GA SDK.
I tested the attached module zip (test(3.1.2.GA SDK) and testone(2.1.4.GA SDK)) using 3.1.2.GA and 2.1.4.GA SDK and issue is still reproducible using them.
This problem was fixed if I required all the files under the native module like this: var woo = require('
Closing based on Varun's comment.
I am not able to get this to work. I've tried the posted solution without luck. Can someone post a working example? Varun?
Ralph, Did you try with the suggestion posted? Here is a working module https://www.dropbox.com/s/ui2j55dgi455q7q/TestModule.zip To test, you can just use the sample app provided in this ticket.