Has anyone successfully got the evothings library and cordova working in an AMD-based structure, such as requirejs?
I'd be interested in how this works or if there is a recommended approach.
My tests have shown there are race issues loading the cordova library making it unavailable once all dependencies are require'd.
Cheers
evothings and AMD
Re: evothings and AMD
Hi @thegecko, there's no apparent reason why AMD couldn't be used to load both cordova and Evothings specific libraries.
Could you tell us more about your test setup? Do you load cordova directly, or do you shim it in AMD, do you let AMD/requireJS load each module dependency dynamically or are you using a build system? A link to the project would be great - if possible ^_^
Cheers,
PS
Could you tell us more about your test setup? Do you load cordova directly, or do you shim it in AMD, do you let AMD/requireJS load each module dependency dynamically or are you using a build system? A link to the project would be great - if possible ^_^
Cheers,
PS
Re: evothings and AMD
We did a "home-grown" async script loading system for the libraries used by the Evothings example apps. (See file evothings.js - https://github.com/evothings/evothings- ... othings.js)
However, this system does not use modules, still just one global address space as with script tags.
Would be much nicer with something like require.js, we looked into it, but at the time it was a too big step to implement in all examples.
We have been discussing Ionic lately, do they use any kind of async module definition? They are based on Cordova and use Angular, perhaps they have figured it out?
Lets continue looking into this.
Best, Mikael
However, this system does not use modules, still just one global address space as with script tags.
Would be much nicer with something like require.js, we looked into it, but at the time it was a too big step to implement in all examples.
We have been discussing Ionic lately, do they use any kind of async module definition? They are based on Cordova and use Angular, perhaps they have figured it out?
Lets continue looking into this.
Best, Mikael
Re: evothings and AMD
Peter just told me Ionic/Angular don't have async module support.
Best, Mikael
Best, Mikael
Re: evothings and AMD
@psvensson I tried both cordova shimming and globals and saw race conditions or deviceready timeouts with both.
Ideally I'd prefer to go all in and shim cordova, but the most stable test was keeping it global.
I just wondered if someone had got this working in a reliable manner.
@micke with so many frameworks out there, going all in on one may be a dangerous approach. At least with AMD support hte developer should be able to pick and choose their frameworks
Cheers!
Ideally I'd prefer to go all in and shim cordova, but the most stable test was keeping it global.
I just wondered if someone had got this working in a reliable manner.
@micke with so many frameworks out there, going all in on one may be a dangerous approach. At least with AMD support hte developer should be able to pick and choose their frameworks
Cheers!
Re: evothings and AMD
HI again! Creating a Evothings example using RequireJS/AMD is probably not we will do near-term, since we're quite busy creating the next version of Evo.
I did find an article describing known issues with Cordova and AMD; https://www.nothing.ch/en/research/usin ... n-phonegap
It looks like avoiding dynamic loading (which you'd do in a release/build step anyway) is key to avoiding problems.
HTH,
Cheers.
PS
I did find an article describing known issues with Cordova and AMD; https://www.nothing.ch/en/research/usin ... n-phonegap
It looks like avoiding dynamic loading (which you'd do in a release/build step anyway) is key to avoiding problems.
HTH,
Cheers.
PS
Return to “General discussion”
Who is online
Users browsing this forum: No registered users and 4 guests