Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Commit 7c0a3ac

Browse files
committed
Release 0.9.0
1 parent 8333a1c commit 7c0a3ac

File tree

4 files changed

+170
-41
lines changed

4 files changed

+170
-41
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
<a name="v0.9.0"></a>
2+
## v0.9.0 (2014-11-23)
3+
4+
5+
#### Bug Fixes
6+
7+
* **package:** use non minified artifact as 'main' ([72b51654](http://github.com/knalli/angular-vertxbus/commit/72b51654618d6d3e0519845b2a8f35c83b7e9c98), closes [#27](http://github.com/knalli/angular-vertxbus/issues/27))
8+
9+
10+
#### Features
11+
12+
* improve debugger-readibility w/ fn.displayName ([8e5006e7](http://github.com/knalli/angular-vertxbus/commit/8e5006e73ac0bc6d1157ffc4d7d2334ac7b2df4a))
13+
* **componentjs:**
14+
* add support for componentjs and related builds ([9a763d6f](http://github.com/knalli/angular-vertxbus/commit/9a763d6f90ba2633cae8510e1f0370128b4c7b0b)) ([d748944d](http://github.com/knalli/angular-vertxbus/commit/d748944dae9e10c5332f046904f8a4ee331e6125)) ([2755038e](http://github.com/knalli/angular-vertxbus/commit/2755038ee618f939ee58d78e5cc7642072eb1297))
15+
16+
17+
#### Breaking Changes
18+
19+
* The bower dependency for SockJS has been changed from 'sockjs' to 'sockjs-client' officially supported since https://github.com/sockjs/sockjs-client/commit/3cbe21423e7f2c93f4b6853059f38ae1a7b2a2b2
20+
([86b06b6d](http://github.com/knalli/angular-vertxbus/commit/86b06b6d583353965f74bacf2a7995c9830e474d))
21+
122
<a name="v0.8.1"></a>
223
### v0.8.1 (2014-10-30)
324

dist/angular-vertxbus.js

Lines changed: 74 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angular-vertxbus - v0.8.1 - 2014-10-30
1+
/*! angular-vertxbus - v0.9.0 - 2014-11-23
22
* http://github.com/knalli/angular-vertxbus
33
* Copyright (c) 2014 ; Licensed */
44
(function () {
@@ -18,7 +18,11 @@
1818
* sockjsOptions (default {}): optional SockJS options (new SockJS(url, undefined, options))
1919
*/
2020
angular.module('knalli.angular-vertxbus').provider('vertxEventBus', function () {
21-
var DEFAULT_OPTIONS, options;
21+
var CONSTANTS, DEFAULT_OPTIONS, options;
22+
CONSTANTS = {
23+
MODULE: 'angular-vertxbus',
24+
COMPONENT: 'wrapper'
25+
};
2226
DEFAULT_OPTIONS = {
2327
enabled: true,
2428
debugEnabled: false,
@@ -173,11 +177,14 @@
173177
return eventBus.publish(address, message);
174178
},
175179
registerHandler: function (address, handler) {
180+
var deconstructor;
176181
eventBus.registerHandler(address, handler);
177182
/* and return the deregister callback*/
178-
return function () {
183+
deconstructor = function () {
179184
stub.unregisterHandler(address, handler);
180185
};
186+
deconstructor.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.registerHandler (deconstructor)';
187+
return deconstructor;
181188
},
182189
unregisterHandler: function (address, handler) {
183190
return eventBus.unregisterHandler(address, handler);
@@ -190,6 +197,15 @@
190197
return angular.extend({}, options);
191198
}
192199
};
200+
stub.reconnect.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.reconnect';
201+
stub.close.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.close';
202+
stub.login.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.login';
203+
stub.send.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.send';
204+
stub.publish.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.publish';
205+
stub.registerHandler.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.registerHandler';
206+
stub.unregisterHandler.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.unregisterHandler';
207+
stub.readyState.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.readyState';
208+
stub.getOptions.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': EventBusWrapper.getOptions';
193209
} else {
194210
if (debugEnabled) {
195211
console.debug('[VertX EventBus] Disabled');
@@ -198,6 +214,7 @@
198214
return stub;
199215
}
200216
];
217+
this.$get.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': initializer';
201218
});
202219
/*
203220
A service utilitzing an underlaying Vertx Event Bus
@@ -219,7 +236,11 @@
219236
Note the additional configuration of the module itself.
220237
*/
221238
angular.module('knalli.angular-vertxbus').provider('vertxEventBusService', function () {
222-
var DEFAULT_OPTIONS, MessageQueueHolder, SimpleMap, options;
239+
var CONSTANTS, DEFAULT_OPTIONS, MessageQueueHolder, SimpleMap, options;
240+
CONSTANTS = {
241+
MODULE: 'angular-vertxbus',
242+
COMPONENT: 'service'
243+
};
223244
DEFAULT_OPTIONS = {
224245
loginRequired: false,
225246
loginBlockForSession: false,
@@ -333,28 +354,31 @@
333354
options.loginRequired = value;
334355
return this;
335356
};
357+
this.requireLogin.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': requireLogin';
336358
this.blockForSession = function (value) {
337359
if (value == null) {
338360
value = options.loginBlockForSession;
339361
}
340362
options.loginBlockForSession = value;
341363
return this;
342364
};
365+
this.blockForSession.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': blockForSession';
343366
this.skipUnauthorizeds = function (value) {
344367
if (value == null) {
345368
value = options.skipUnauthorizeds;
346369
}
347370
options.skipUnauthorizeds = value;
348371
return this;
349372
};
373+
this.skipUnauthorizeds.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': skipUnauthorizeds';
350374
this.$get = [
351375
'$rootScope',
352376
'$q',
353377
'$interval',
354378
'$timeout',
355379
'vertxEventBus',
356380
function ($rootScope, $q, $interval, $timeout, vertxEventBus) {
357-
var connectionState, debugEnabled, enabled, ensureOpenAuthConnection, ensureOpenConnection, fnWrapperMap, loginPromise, messageBuffer, messageQueueHolder, prefix, reconnectEnabled, sockjsOptions, sockjsReconnectInterval, sockjsStateInterval, urlPath, urlServer, util, validSession, wrapped, _ref, _ref1;
381+
var connectionIntervalCheck, connectionState, debugEnabled, enabled, ensureOpenAuthConnection, ensureOpenConnection, fnWrapperMap, loginPromise, messageBuffer, messageQueueHolder, prefix, reconnectEnabled, sockjsOptions, sockjsReconnectInterval, sockjsStateInterval, urlPath, urlServer, util, validSession, wrapped, _ref, _ref1;
358382
_ref = (vertxEventBus != null ? vertxEventBus.getOptions() : void 0) || {}, enabled = _ref.enabled, debugEnabled = _ref.debugEnabled, prefix = _ref.prefix, urlServer = _ref.urlServer, urlPath = _ref.urlPath, reconnectEnabled = _ref.reconnectEnabled, sockjsStateInterval = _ref.sockjsStateInterval, sockjsReconnectInterval = _ref.sockjsReconnectInterval, sockjsOptions = _ref.sockjsOptions, messageBuffer = _ref.messageBuffer;
359383
connectionState = vertxEventBus != null ? (_ref1 = vertxEventBus.EventBus) != null ? _ref1.CLOSED : void 0 : void 0;
360384
validSession = false;
@@ -391,6 +415,7 @@
391415
wrapped.getConnectionState(true);
392416
return $rootScope.$broadcast('' + prefix + 'system.disconnected');
393417
};
418+
vertxEventBus.onclose.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': \'onclose\' handler';
394419
}
395420
ensureOpenConnection = function (fn) {
396421
if (wrapped.getConnectionState() === vertxEventBus.EventBus.OPEN) {
@@ -402,11 +427,13 @@
402427
}
403428
return false;
404429
};
430+
ensureOpenConnection.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': ensureOpenConnection';
405431
ensureOpenAuthConnection = function (fn) {
432+
var wrapFn;
406433
if (!options.loginRequired) {
407434
return ensureOpenConnection(fn);
408435
} else {
409-
return ensureOpenConnection(function () {
436+
wrapFn = function () {
410437
if (validSession) {
411438
fn();
412439
return true;
@@ -416,11 +443,15 @@
416443
}
417444
return false;
418445
}
419-
});
446+
};
447+
wrapFn.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': ensureOpenAuthConnection function wrapper';
448+
return ensureOpenConnection(wrapFn);
420449
}
421450
};
451+
ensureOpenAuthConnection.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': ensureOpenAuthConnection';
422452
util = {
423453
registerHandler: function (address, callback) {
454+
var deconstructor;
424455
if (typeof callback !== 'function') {
425456
return;
426457
}
@@ -430,10 +461,12 @@
430461
if (fnWrapperMap.containsKey(callback)) {
431462
return fnWrapperMap.get(callback);
432463
}
433-
fnWrapperMap.put(callback, function (message, replyTo) {
464+
deconstructor = function (message, replyTo) {
434465
callback(message, replyTo);
435466
return $rootScope.$digest();
436-
});
467+
};
468+
deconstructor.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.registerHandler (deconstructor)';
469+
fnWrapperMap.put(callback, deconstructor);
437470
return vertxEventBus.registerHandler(address, fnWrapperMap.get(callback));
438471
},
439472
unregisterHandler: function (address, callback) {
@@ -447,12 +480,12 @@
447480
fnWrapperMap.remove(callback);
448481
},
449482
send: function (address, message, timeout) {
450-
var deferred, dispatched;
483+
var deferred, dispatched, next;
451484
if (timeout == null) {
452485
timeout = 10000;
453486
}
454487
deferred = $q.defer();
455-
dispatched = ensureOpenAuthConnection(function () {
488+
next = function () {
456489
vertxEventBus.send(address, message, function (reply) {
457490
if (deferred) {
458491
return deferred.resolve(reply);
@@ -463,40 +496,51 @@
463496
return deferred.reject();
464497
}, timeout);
465498
}
466-
});
499+
};
500+
next.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.send (ensureOpenAuthConnection callback)';
501+
dispatched = ensureOpenAuthConnection(next);
467502
if (deferred && !dispatched) {
468503
deferred.reject();
469504
}
470505
return deferred != null ? deferred.promise : void 0;
471506
},
472507
publish: function (address, message) {
473-
var dispatched;
474-
dispatched = ensureOpenAuthConnection(function () {
508+
var dispatched, next;
509+
next = function () {
475510
return vertxEventBus.publish(address, message);
476-
});
511+
};
512+
next.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.publish (ensureOpenAuthConnection callback)';
513+
dispatched = ensureOpenAuthConnection(next);
477514
return dispatched;
478515
},
479516
login: function (username, password, timeout) {
480-
var deferred;
517+
var deferred, next;
481518
if (timeout == null) {
482519
timeout = 5000;
483520
}
484521
deferred = $q.defer();
485-
vertxEventBus.login(username, password, function (reply) {
522+
next = function (reply) {
486523
if ((reply != null ? reply.status : void 0) === 'ok') {
487524
deferred.resolve(reply);
488525
return $rootScope.$broadcast('' + prefix + 'system.login.succeeded', { status: reply != null ? reply.status : void 0 });
489526
} else {
490527
deferred.reject(reply);
491528
return $rootScope.$broadcast('' + prefix + 'system.login.failed', { status: reply != null ? reply.status : void 0 });
492529
}
493-
});
530+
};
531+
next.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.login (callback)';
532+
vertxEventBus.login(username, password, next);
494533
$timeout(function () {
495534
return deferred.reject();
496535
}, timeout);
497536
return deferred.promise;
498537
}
499538
};
539+
util.registerHandler.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.registerHandler';
540+
util.unregisterHandler.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.unregisterHandler';
541+
util.send.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.send';
542+
util.publish.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.publish';
543+
util.login.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': util.login';
500544
wrapped = {
501545
handlers: {},
502546
registerHandler: function (address, callback) {
@@ -571,9 +615,18 @@
571615
});
572616
}
573617
};
574-
$interval(function () {
618+
wrapped.registerHandler.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': wrapped.registerHandler';
619+
wrapped.unregisterHandler.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': wrapped.unregisterHandler';
620+
wrapped.send.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': wrapped.send';
621+
wrapped.publish.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': wrapped.publish';
622+
wrapped.getConnectionState.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': wrapped.getConnectionState';
623+
wrapped.isValidSession.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': wrapped.isValidSession';
624+
wrapped.login.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': wrapped.login';
625+
connectionIntervalCheck = function () {
575626
return wrapped.getConnectionState(true);
576-
}, sockjsStateInterval);
627+
};
628+
connectionIntervalCheck.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': periodic connection check';
629+
$interval(connectionIntervalCheck, sockjsStateInterval);
577630
/* building and exposing the actual service API*/
578631
return {
579632
on: wrapped.registerHandler,
@@ -597,5 +650,6 @@
597650
};
598651
}
599652
];
653+
this.$get.displayName = '' + CONSTANTS.MODULE + '/' + CONSTANTS.COMPONENT + ': initializer';
600654
});
601655
}.call(this));

0 commit comments

Comments
 (0)