Open rotorgames opened 9 years ago
source maps would be good. I think you'll get the wrong lines with straight alloy as well (since it is precompiled).
@dbankier The problem with tishadow much deeper source map
and here plays a small role.
Tishadow uses eval
that would fulfill the source code. In this case, you can only get the error string in the main file, any errors in the require
hidden.
I'm working on source titanium, that would be able to use native tishadow require
.
Developing code for IOS, I was finished, now working with Android.
Changes for IOS: https://github.com/rotorgames/titanium_mobile/commit/dce1cb1df8ff10b8f49b7bd6ba05471b5630e20d
P.S. Code for Android is almost finished, but I have little time. I hope it will soon appear, and I'll pull request in titanium.
@rotorgames, that is TiShadow used to be back in 2012.
This commit roles it back and moves to the eval way (https://github.com/dbankier/TiShadow/commit/273ed75771369469a900980da3b1589ba0a29cc5)
These are the native commits back then for both iOS and Android that made it work. https://github.com/dbankier/titanium_mobile/commit/d332a846701df512003fdcb1fe791a6497348515 https://github.com/dbankier/titanium_mobile/commit/0b9b8abdf566ebc088edc93e0efd70e46904ebc7
I moved away from that since it meant having custom tishadow builds for every sdk release. That used to happen more frequently and it was a hassle to maintain.
It might be worth revisiting as native modules...
@dbankier I have a very different approach. Titanium does not need to know about the existence of tishadow. Titanium has only to provide methods for other plugins.
How it will work:
Tishadow adds tiapp.xml line parameter.
<Property name = "customDirectory" type = "string"> applicationDataDirectory:/{name}/{platform} </ property>
After that, any request require
will first look in the folderapplicationDataDirectory:/{name}/{platform}
For example:
require ("lib/q.js") // /data/data/com.rotorgames.myappname/app_data/MyAppName/android/lib/q.js
Then, if the file in this folder will not be made a request to the default folder.
Thus, there is no mention of tishadow, and this method may be to Use any plugin or application developer.
applicationDataDirectory tempDirectory applicationCacheDirectory externalStorageDirectory
deploytype id publisher url name version description copyright guid familyTarget // Android: phone || tablet; IOS: Iphone, Ipad platform // ios || android family // iphone || android undName // My App Name == My_App_Name
Right. nice! From what I understand, that would only work then with express/appified, unless the property can be modified at runtime. Also, I think you'd still need some standard require access... Good luck with the PR! Give a shout if you need help.
@dbankier I'll do a separate Pull Request for tishadow, which I will consider all the changes titanium.
Concerning, standard require access any ideas? How best to do it?
require ("app.js", bool);
Where bool
boolean value, true
if taken from a standard repository, if false
or undefiend
is taken from the custom warehouse.
Or make a separate function for this?
In general, is it necessary? I have done so if the require
not find the file in the custom folder, it searches the standart folder, if there is not, then an error. This is convenient but there is no control.
Any ideas?
P.S. I think if I change the way of calling require
appcelerator is unlikely to be thrilled by this.
not sure if AppC will accept that, or this:
perhaps better is require("app.js", root_path)
either way it breaks the spec so I doubt you'll get it through.
@dbankier Done, Pull Request for Android and IOS. https://github.com/appcelerator/titanium_mobile/pull/6901
Soon prepare Pull Request for Tishadow
nice - I'll be watching it.
Any updates on this? Would be awesome to have it.
In the application, Hello World (Alloy). Try to call a nonexistent function test:
The console shows:
Try to call a nonexistent function in the controller
The console shows:
Why line and even files that was a mistake, do not match? Perhaps, as you use the source map with tishadow? Without this, it becomes very difficult to debug.