Skip to content

Commit

Permalink
Made _.noConflict conditional, changed standard example to use node m…
Browse files Browse the repository at this point in the history
…odules instead of bower
  • Loading branch information
ifandelse committed Jun 4, 2016
1 parent 145f0c9 commit 507ef4d
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 13 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# v2.x

## v2.0.4
* Conditionally calling _.noConflict (only if previous global._ was truthy and not equal to postal's lodash version)

## v2.0.3
* Fixed lodash isEqual file name casing.

Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "postal.js",
"repo": "postaljs/postal.js",
"description": "Client-side messaging library",
"version": "2.0.3",
"version": "2.0.4",
"keywords": [
"pub/sub",
"pub",
Expand Down
7 changes: 3 additions & 4 deletions example/standard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
<head>
<title>Postal Examples (Standard Lib Format)</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="../../bower/lodash/dist/lodash.js"></script>
<script type="text/javascript" src="../../bower/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../bower/conduitjs/lib/conduit.min.js"></script>
<script type="text/javascript" src="../../node_modules/lodash/lodash.js"></script>
<script type="text/javascript" src="../../node_modules/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../../lib/postal.js"></script>
<script type="text/javascript" src="../../bower/postal.diagnostics/lib/postal.diagnostics.js"></script>
<script type="text/javascript" src="../../node_modules/postal.diagnostics/lib/postal.diagnostics.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</head>
<body>
Expand Down
7 changes: 5 additions & 2 deletions lib/postal.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* postal - Pub/Sub library providing wildcard subscriptions, complex message handling, etc. Works server and client-side.
* Author: Jim Cowart (http://ifandelse.com)
* Version: v2.0.3
* Version: v2.0.4
* Url: http://github.com/postaljs/postal.js
* License(s): MIT
*/
Expand All @@ -22,8 +22,11 @@
root.postal = factory( root._, root );
}
}( this, function( _, global, undefined ) {
_ = _.noConflict();
var prevPostal = global && global.postal;
var prevLodash = global && global._;
if ( prevLodash && prevLodash !== _ ) {
_ = _.noConflict();
}
var _defaultConfig = {
DEFAULT_CHANNEL: "/",
SYSTEM_CHANNEL: "postal",
Expand Down
2 changes: 1 addition & 1 deletion lib/postal.lodash.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* postal - Pub/Sub library providing wildcard subscriptions, complex message handling, etc. Works server and client-side.
* Author: Jim Cowart (http://ifandelse.com)
* Version: v2.0.3
* Version: v2.0.4
* Url: http://github.com/postaljs/postal.js
* License(s): MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/postal.lodash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/postal.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "postal",
"description": "Pub/Sub library providing wildcard subscriptions, complex message handling, etc. Works server and client-side.",
"version": "2.0.3",
"version": "2.0.4",
"homepage": "http://github.com/postaljs/postal.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -115,10 +115,12 @@
"gulp-uglify": "^1.2.0",
"gulp-util": "~2.2.9",
"istanbul": "^0.3.13",
"jquery": "^2.2.4",
"jshint-stylish": "^1.0.2",
"karma": "^0.12.31",
"mocha": "^2.2.4",
"open": "~0.0.4",
"postal.diagnostics": "^0.7.4",
"should": "^6.0.1",
"sinon": "~1.14.1"
},
Expand Down
5 changes: 4 additions & 1 deletion src/postal.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
root.postal = factory( root._, root );
}
}( this, function( _, global, undefined ) {
_ = _.noConflict();
var prevPostal = global && global.postal;
var prevLodash = global && global._;
if ( prevLodash && prevLodash !== _ ) {
_ = _.noConflict();
}
var _defaultConfig = {
DEFAULT_CHANNEL: "/",
SYSTEM_CHANNEL: "postal",
Expand Down

0 comments on commit 507ef4d

Please sign in to comment.