Skip to content

Commit d5c64c2

Browse files
author
Dustin Larimer
authored
Merge pull request #63 from keen/fix-namespace-handling
Fix namespace handling
2 parents 833f23f + d46de9f commit d5c64c2

File tree

6 files changed

+195
-41
lines changed

6 files changed

+195
-41
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
**BREAKING:**
77
**CHANGE:**
88
-->
9+
<a name="1.1.0"></a>
10+
# 1.1.0 Global Namespace Fix
11+
12+
**FIXED:**
13+
* This library will now coalesce into a shared global `Keen` namespace, rather than colliding and overwriting other modular SDKs. Check out [[email protected]](https://github.com/keen/keen-core.js/blob/master/CHANGELOG.md#010-manage-modular-namespace) for details about this fix.
14+
915

1016
<a name="1.0.3"></a>
1117
# 1.0.3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Copy/paste this snippet of JavaScript above the `</head>` tag of your page to lo
130130
// Loads the library asynchronously from any URI
131131
!function(name,path,ctx){
132132
var latest,prev=name!=='Keen'&&window.Keen?window.Keen:false;ctx[name]=ctx[name]||{ready:function(fn){var h=document.getElementsByTagName('head')[0],s=document.createElement('script'),w=window,loaded;s.onload=s.onerror=s.onreadystatechange=function(){if((s.readyState&&!(/^c|loade/.test(s.readyState)))||loaded){return}s.onload=s.onreadystatechange=null;loaded=1;latest=w.Keen;if(prev){w.Keen=prev}else{try{delete w.Keen}catch(e){w.Keen=void 0}}ctx[name]=latest;ctx[name].ready(fn)};s.async=1;s.src=path;h.parentNode.insertBefore(s,h)}}
133-
}('Keen','https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.0.5.min.js',this);
133+
}('Keen','https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.1.0.min.js',this);
134134
135135
// Executes when the library is loaded and ready
136136
Keen.ready(function(){

dist/keen-tracking.js

Lines changed: 182 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/keen-tracking.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/browser.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@
135135
// Module Definitions
136136
// --------------------
137137

138-
// Global
139-
if (env) {
140-
env.Keen = K;
141-
}
142-
143138
// CommonJS
144139
if (typeof module !== 'undefined' && module.exports) {
145140
module.exports = K;
@@ -152,4 +147,6 @@
152147
});
153148
}
154149

150+
env.Keen = K.extendLibrary(K);
151+
155152
}).call(this, typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "keen-tracking",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "Data Collection SDK for Keen IO",
55
"main": "lib/server.js",
66
"browser": "lib/browser.js",
@@ -24,7 +24,7 @@
2424
"dependencies": {
2525
"component-emitter": "^1.2.0",
2626
"js-cookie": "2.1.0",
27-
"keen-core": "0.0.3"
27+
"keen-core": "^0.1.0"
2828
},
2929
"devDependencies": {
3030
"browserify": "^9.0.8",

0 commit comments

Comments
 (0)