[AC-6144] SDK 7.5.0 breaks support for external javascript libraries
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2019-03-06T22:26:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Peter Ladis |
Assignee | Shak Hossain |
Created | 2019-02-20T00:57:54.000+0000 |
Updated | 2019-03-06T22:26:50.000+0000 |
Description
I use libraries like moment.js , linq.js.
In 7.4.0 I have code like this in my app.js
function include(file) {
return eval(Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, file).read().text);
}
include('ui/common/moment.js');
include('ui/common/linq.min.js');
include('ui/common/mustache.js');
And then thought my code files I can reference moment(). etc.....is there a workaround for this in 7.5.0 SDK
Which platform are you having this issue on? Android? iOS? I assume iOS. Because Android didn't support
File.read()
of JS files for device/production builds until 7.5.0 as can be seen here [TIMOB-16678].Why not use
require
?Hello [~peterladis], Can you follow up here? did you follow Gary's guide on using require instead of include? Let us know. Thanks.
[~peterladis], Did you manage to follow Gary's suggestion and test this on SDK 7.5.1.GA . Please update it on your end by executing *appc ti sdk install latest* and let us know the results.
Hello, We haven't heard back from you since our last response. I am just following up to check the status of this case and if you need further help on it.