incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <>
Subject Re: [jira] [Commented] (CB-304) Cordova's require/define can't be used with Dojo's require/define
Date Fri, 09 Mar 2012 07:32:59 GMT
The closure created by
e268f23359b44dfb9a6#L1R107 and
e268f23359b44dfb9a6#L1R125 is sufficient for bootstrap.js to know what
require is.

As Gord said, API-wise inside any core plugins in cordova-js you can
simply use the "require" syntax. Third party plugin authors would have to
use "cordova.require" and "cordova.define" if their scripts are included
after cordova.js.

Hope that's sufficient - I'll add a section to the readme about authoring

On 3/8/12 6:36 PM, "" <> wrote:

>I think with some builder sugaring magic we can have the best of both
>Ie.. Cordova.require for native and require for everyone else.
>All the modules should be fine with require, the only place we would need
>to update would be the injection of the bootstrap.js file.
>Sent on the TELUS Mobility network with BlackBerry
>-----Original Message-----
>From: "Patrick Mueller (Commented) (JIRA)" <>
>Date: Fri, 9 Mar 2012 02:31:57
>To: <>
>Subject: [jira] [Commented] (CB-304) Cordova's require/define can't be
> with Dojo's require/define
>    [ 
>-13225795 ] 
>Patrick Mueller commented on CB-304:
>Having to hang {{require}} off of {{Cordova}} is believable for the
>reason you mention.
>I will note, again, that we need to make sure folks don't start using
>that {{require()}} instead of the {{require()}} they are passed (if
>they're in a module), as that won't resolve relative module ids correctly
>(when we implement that).
>So, I'd recommend we not actually call it {{require}} there.
>{{rootRequire}}, {{requireRoot}}, {{baseRequire}}, etc come to mind as
>> Cordova's require/define can't be used with Dojo's require/define
>> -----------------------------------------------------------------
>>                 Key: CB-304
>>                 URL:
>>             Project: Apache Callback
>>          Issue Type: Bug
>>          Components: Android, CordovaJS
>>            Reporter: Patrick Mueller
>>            Assignee: Filip Maj
>> summarized from 
>> {quote}
>> I was targeting Android and used Phonegap 1.2.0 in combination with
>>Dojo 1.7 which worked fine. Now I switched to Phonegap 1.5.0 and found a
>>severe problem. The new module system in Phonegap 1.5.0 uses global
>>functions "define" and "require". Dojo 1.7 does the same for its own
>>module system. Hence, whatever is loaded first, breaks the other one.
>> Could the Phonegap developers consider to modify the module system in a
>>way that it is compatible with Dojo's?
>> {quote}
>This message is automatically generated by JIRA.
>If you think it was sent incorrectly, please contact your JIRA
>For more information on JIRA, see:

View raw message