This looks like a big change via the diff, but there's no change between from the previous var joli = { ... }, it's just wrapped in a new joliCreator() function now. There's a second small change at the end to make CommonJS work -- instead of replacing the exports object, we need to add properties to it. I don't know if replacing exports worked in 1.7.x, but it doesn't work in 1.8.x.
The two changes are:
1) For CommonJS usage, a single var joli in the module doesn't work if you want multiple db instances. Subsequent require('joli').connect()s will overwrite previous connection since they're using the same joli var in the module. Instead, a new joliCreator() function is used that will return a new joli object on each call. For parity with Ti.include(), create a module joli var with this function right away. This allows us to have multiple joli connections with CommonJS usage.
This looks like a big change via the diff, but there's no change between from the previous
var joli = { ... }
, it's just wrapped in a newjoliCreator()
function now. There's a second small change at the end to make CommonJS work -- instead of replacing theexports
object, we need to add properties to it. I don't know if replacingexports
worked in 1.7.x, but it doesn't work in 1.8.x.The two changes are:
1) For CommonJS usage, a single
var joli
in the module doesn't work if you want multiple db instances. Subsequentrequire('joli').connect()
s will overwrite previous connection since they're using the same joli var in the module. Instead, a newjoliCreator()
function is used that will return a new joli object on each call. For parity withTi.include()
, create a module joli var with this function right away. This allows us to have multiple joli connections with CommonJS usage.2) CommonJS usage shouldn't replace the entire exports object, it should add to the object as needed. (https://jira.appcelerator.org/browse/TIMOB-5406)