Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23971] Hyperloop: iOS not working in 2.0.0 (regression) #83

Merged
merged 2 commits into from
Oct 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion iphone/plugin/hyperloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ HyperloopiOSBuilder.prototype.patchJSFile = function patchJSFile(file, cb) {
}

// replace the require to point to our generated file path
return "require('" + ref + "')";
return "require('/" + ref + "')";
}.bind(this));

if (contents === newContents) {
Expand Down
2 changes: 1 addition & 1 deletion iphone/titanium/HyperloopModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ static TiObjectRef CreateJSClassFromModulePath (NSString *path, id obj, TiClassR
* returns a generic wrapper if not found
*/
static TiObjectRef CreateJSClassFromNSClass (NSString *framework, NSString *clsname, id obj, TiClassRef classRef) {
NSString *path = [NSString stringWithFormat:@"hyperloop/%@/%@", [framework lowercaseString], [clsname lowercaseString]];
NSString *path = [NSString stringWithFormat:@"/hyperloop/%@/%@", [framework lowercaseString], [clsname lowercaseString]];
return CreateJSClassFromModulePath(path, obj, classRef, YES);
}

Expand Down
2 changes: 1 addition & 1 deletion metabase/ios/lib/generate/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Parser.write = function (dir, state, metabase) {
}
};
classgen.generate(dir, metabase, cls, state);
mappings[cls.name] = 'hyperloop/' + (cls.framework + '/' + cls.name).toLowerCase();
mappings[cls.name] = '/hyperloop/' + (cls.framework + '/' + cls.name).toLowerCase();
});
}

Expand Down
2 changes: 1 addition & 1 deletion metabase/ios/lib/generate/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ function getObjCReturnResult (value, name, returns, asPointer) {
}

function generateImport (name, fp) {
return '\t$imports.' + name + ' = require(\'hyperloop/' + fp.toLowerCase() + '\');';
return '\t$imports.' + name + ' = require(\'/hyperloop/' + fp.toLowerCase() + '\');';
}

function makeImports (json, imports) {
Expand Down
2 changes: 1 addition & 1 deletion metabase/ios/templates/class.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var $dispatch = Hyperloop.dispatch,
$class;

<% if (data.superclass && data.superclass.framework && data.superclass.name) { %>
var <%= data.superclass.name %> = require('hyperloop/<%= data.superclass.framework.toLowerCase() %>/<%= data.superclass.name.toLowerCase() %>');
var <%= data.superclass.name %> = require('/hyperloop/<%= data.superclass.framework.toLowerCase() %>/<%= data.superclass.name.toLowerCase() %>');
<% } %>

/**
Expand Down