The last upgrade for the final 6.0.0.640 GPL ExtJS version was quite possibly made from a non-ExtJS 6.0.0.640 workspace, so that a build in such aworkspace leads to the following diff:
diff --git a/sass/example/bootstrap.js b/sass/example/bootstrap.js
index 7380753..5fb69f7 100644
--- a/sass/example/bootstrap.js
+++ b/sass/example/bootstrap.js
@@ -11,6 +11,7 @@ var Ext = Ext || {};
Ext.Boot = Ext.Boot || (function (emptyFn) {
var doc = document,
+ _emptyArray = [],
_config = {
/*
* @cfg {Boolean} [disableCaching=true]
@@ -278,17 +279,26 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
return platforms;
},
- filterPlatform: function (platform) {
- platform = [].concat(platform);
- var len, p, tag;
+ filterPlatform: function (platform, excludes) {
+ platform = _emptyArray.concat(platform || _emptyArray);
+ excludes = _emptyArray.concat(excludes || _emptyArray);
- for (len = platform.length, p = 0; p < len; p++) {
- tag = platform[p];
- if (_tags.hasOwnProperty(tag)) {
- return !!_tags[tag];
- }
+ var plen = platform.length,
+ elen = excludes.length,
+ include = (!plen && elen), // default true if only excludes specified
+ i, tag;
+
+ for (i = 0; i < plen && !include; i++) {
+ tag = platform[i];
+ include = !!_tags[tag];
}
- return false;
+
+ for (i = 0; i < elen && include; i++) {
+ tag = excludes[i];
+ include = !_tags[tag];
+ }
+
+ return include;
},
init: function () {
@@ -345,14 +355,6 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
Boot.detectPlatformTags();
Ext.filterPlatform = Boot.filterPlatform;
-
- // temporary workaround for https://sencha.jira.com/browse/EXTJS-16101
- if (_tags.ios) {
- var meta = document.createElement('meta');
- meta.setAttribute('name', 'viewport');
- meta.setAttribute('content', 'width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no');
- document.head.appendChild(meta);
- }
},
/*
@@ -961,20 +963,22 @@ Ext.Boot = Ext.Boot || (function (emptyFn) {
cache = (cfg.cache !== undefined) ? cfg.cache : (loader && loader.cache),
buster, busterParam;
- if(cache === undefined) {
- cache = !Boot.config.disableCaching;
- }
+ if (Boot.config.disableCaching) {
+ if (cache === undefined) {
+ cache = !Boot.config.disableCaching;
+ }
- if(cache === false) {
- buster = +new Date();
- } else if(cache !== true) {
- buster = cache;
- }
+ if (cache === false) {
+ buster = +new Date();
+ } else if (cache !== true) {
+ buster = cache;
+ }
- if(buster) {
- busterParam = (loader && loader.cacheParam) || Boot.config.disableCachingParam;
- buster = busterParam + "=" + buster;
- };
+ if (buster) {
+ busterParam = (loader && loader.cacheParam) || Boot.config.disableCachingParam;
+ buster = busterParam + "=" + buster;
+ }
+ }
_apply(cfg, {
charset: charset,
@@ -1454,17 +1458,21 @@ Ext.Microloader = Ext.Microloader || (function () {
_warn = function (message) {
console.log("[WARN] " + message);
},
- _privatePrefix = '_sencha',
- _location = window.document.location,
- _documentUri = _location.protocol + '//' + _location.hostname + _location.pathname + _location.search,
- postProcessor;
-
- // Returns a unique key to a manifest file
- function getManifestStorageKey (url) {
- return _privatePrefix + '-' + _documentUri + url;
- }
+ _privatePrefix = '_ext:' + location.pathname,
+
+ /**
+ * The Following combination is used to create isolated local storage keys
+ * '_ext' is used to scope all the local storage keys that we internally by Ext
+ * 'location.pathname' is used to force each assets to cache by an absolute URL (/build/MyApp) (dev vs prod)
+ * 'url' is used to force each asset to cache relative to the page (app.json vs resources/app.css)
+ * 'profileId' is used to differentiate the builds of an application (neptune vs crisp)
+ * 'Microloader.appId' is unique to the application and will differentiate apps on the same host (dev mode running app watch against multiple apps)
+ */
+ getStorageKey = function(url, profileId) {
+ return _privatePrefix + url + '-' + (profileId ? profileId + '-' : '') + Microloader.appId;
+ },
+ postProcessor, _storage;
- var _storage;
try {
_storage = window['localStorage'];
} catch(ex) {
@@ -1474,14 +1482,20 @@ Ext.Microloader = Ext.Microloader || (function () {
var _cache = window['applicationCache'],
// Local Storage Controller
LocalStorage = {
- clearAllPrivate: function() {
+ clearAllPrivate: function(manifest) {
if(_storage) {
+
+ //Remove the entry for the manifest first
+ _storage.removeItem(manifest.key);
+
var i, key,
removeKeys = [],
+ suffix = manifest.profile + '-' + Microloader.appId,
ln = _storage.length;
for (i = 0; i < ln; i++) {
key = _storage.key(i);
- if (key.indexOf(_privatePrefix) === 0) {
+ // If key starts with the private key and the suffix is present we can clear this entry
+ if (key.indexOf(_privatePrefix) === 0 && key.indexOf(suffix) !== -1) {
removeKeys.push(key);
}
}
@@ -1529,7 +1543,7 @@ Ext.Microloader = Ext.Microloader || (function () {
}
this.type = cfg.type;
- this.key = cfg.manifestKey + '-' + this.assetConfig.path;
+ this.key = getStorageKey(this.assetConfig.path, cfg.manifest.profile);
if (cfg.loadFromCache) {
this.loadFromCache();
@@ -1540,7 +1554,7 @@ Ext.Microloader = Ext.Microloader || (function () {
shouldCache: function() {
return _storage && this.assetConfig.update && this.assetConfig.hash && !this.assetConfig.remote;
},
-
+
is: function (asset) {
return (!!asset && this.assetConfig && asset.assetConfig && (this.assetConfig.hash === asset.assetConfig.hash))
},
@@ -1577,20 +1591,38 @@ Ext.Microloader = Ext.Microloader || (function () {
this.content = cfg.content;
}
this.assetMap = {};
-
+
this.url = cfg.url;
this.fromCache = !!cfg.cached;
this.assetCache = !(cfg.assetCache === false);
- this.key = getManifestStorageKey(this.url);
+ this.key = getStorageKey(this.url);
// Pull out select properties for repetitive use
+ this.profile = this.content.profile;
this.hash = this.content.hash;
this.loadOrder = this.content.loadOrder;
this.deltas = this.content.cache ? this.content.cache.deltas : null;
this.cacheEnabled = this.content.cache ? this.content.cache.enable : false;
-
+
this.loadOrderMap = (this.loadOrder) ? Boot.createLoadOrderMap(this.loadOrder) : null;
-
+
+ var tags = this.content.tags,
+ platformTags = Ext.platformTags;
+
+ if (tags) {
+ if (tags instanceof Array) {
+ for (var i = 0; i < tags.length; i++) {
+ platformTags[tags[i]] = true;
+ }
+ } else {
+ Boot.apply(platformTags, tags);
+ }
+
+ // re-apply the query parameters, so that the params as specified
+ // in the url always has highest priority
+ Boot.apply(platformTags, Boot.loadPlatformsParam());
+ }
+
// Convert all assets into Assets
this.js = this.processAssets(this.content.js, 'js');
this.css = this.processAssets(this.content.css, 'css');
@@ -1599,7 +1631,7 @@ Ext.Microloader = Ext.Microloader || (function () {
Manifest.prototype = {
processAsset: function(assetConfig, type) {
var processedAsset = new Asset({
- manifestKey: this.key,
+ manifest: this,
assetConfig: assetConfig,
type: type,
loadFromCache: this.assetCache
@@ -1652,7 +1684,7 @@ Ext.Microloader = Ext.Microloader || (function () {
uncache: function() {
LocalStorage.setAsset(this.key, null);
},
-
+
exportContent: function() {
return Boot.apply({
loadOrderMap: this.loadOrderMap
@@ -1670,6 +1702,13 @@ Ext.Microloader = Ext.Microloader || (function () {
Microloader = {
init: function () {
Ext.microloaded = true;
+
+ // data-app is in the dev template for an application and is also
+ // injected into the app my CMD for production
+ // We use this to prefix localStorage cache to prevent collisions
+ var microloaderElement = document.getElementById('microloader');
+ Microloader.appId = microloaderElement ? microloaderElement.getAttribute('data-app') : '';
+
if (Ext.beforeLoad) {
postProcessor = Ext.beforeLoad(Ext.platformTags);
}
@@ -1696,7 +1735,7 @@ Ext.Microloader = Ext.Microloader || (function () {
url = manifest.indexOf(extension) === manifest.length - extension.length
? manifest
: manifest + ".json",
- key = getManifestStorageKey(url),
+ key = getStorageKey(url),
content = LocalStorage.retrieveAsset(key);
// Manifest found in local storage, use this for immediate boot except in PhantomJS environments for building.
@@ -1731,8 +1770,7 @@ Ext.Microloader = Ext.Microloader || (function () {
// Embedded Manifest into JS file
} else {
manifest = new Manifest({
- content: manifest,
- url: 'embedded'
+ content: manifest
});
Microloader.load(manifest);
}
@@ -1753,10 +1791,7 @@ Ext.Microloader = Ext.Microloader || (function () {
for (len = assets.length, i = 0; i < len; i++) {
asset = assets[i];
- include = true;
- if (asset.assetConfig.platform && !Boot.filterPlatform(asset.assetConfig.platform)) {
- include = false;
- }
+ include = Microloader.filterAsset(asset);
if (include) {
// Asset is using the localStorage caching system
if (manifest.shouldCache() && asset.shouldCache()) {
@@ -1798,7 +1833,7 @@ Ext.Microloader = Ext.Microloader || (function () {
Microloader.remainingCachedAssets--;
if (!result.error) {
- checksum = Microloader.checksum(asset.assetConfig.hash, result.content);
+ checksum = Microloader.checksum(result.content, asset.assetConfig.hash);
if (!checksum) {
_warn("Cached Asset '" + asset.assetConfig.path + "' has failed checksum. This asset will be uncached for future loading");
@@ -1811,11 +1846,11 @@ Ext.Microloader = Ext.Microloader || (function () {
asset.cache();
} else {
_warn("There was an error pre-loading the asset '" + asset.assetConfig.path + "'. This asset will be uncached for future loading");
-
+
// Un cache this asset so it is loaded next time
asset.uncache();
- }
-
+ }
+
if (Microloader.remainingCachedAssets === 0) {
Microloader.onCachedAssetsReady();
}
@@ -1886,7 +1921,7 @@ Ext.Microloader = Ext.Microloader || (function () {
return output.join('');
},
-
+
checkAllUpdates: function() {
if(window['removeEventListener']) {
window.removeEventListener('online', Microloader.checkAllUpdates, false);
@@ -1948,9 +1983,18 @@ Ext.Microloader = Ext.Microloader || (function () {
Microloader.notifyUpdateReady();
},
+
+ filterAsset: function(asset) {
+ var cfg = (asset && asset.assetConfig) || {};
+ if(cfg.platform || cfg.exclude) {
+ return Boot.filterPlatform(cfg.platform, cfg.exclude);
+ }
+ return true;
+ },
+
onUpdatedManifestLoaded: function (result) {
result = Microloader.parseResult(result);
-
+
if (!result.error) {
var currentAssets, newAssets, currentAsset, newAsset, prop,
assets, deltas, deltaPath, include,
@@ -1972,7 +2016,7 @@ Ext.Microloader = Ext.Microloader || (function () {
if (!manifest.shouldCache()) {
Microloader.updatedManifest = manifest;
- LocalStorage.clearAllPrivate();
+ LocalStorage.clearAllPrivate(manifest);
Microloader.onAllUpdatedAssetsReady();
return;
}
@@ -1988,7 +2032,7 @@ Ext.Microloader = Ext.Microloader || (function () {
for (prop in newAssets) {
newAsset = newAssets[prop];
currentAsset = Microloader.manifest.getAsset(newAsset.assetConfig.path);
- include = !(newAsset.assetConfig.platform && !Boot.filterPlatform(newAsset.assetConfig.platform));
+ include = Microloader.filterAsset(newAsset);
if (include && (!currentAsset || (newAsset.shouldCache() && (!currentAsset.is(newAsset))))) {
updatingAssets.push({_new: newAsset, _current: currentAsset});
@@ -2001,7 +2045,7 @@ Ext.Microloader = Ext.Microloader || (function () {
newAsset = manifest.getAsset(currentAsset.assetConfig.path);
//New version of this asset has been filtered out
- include = !(newAsset.assetConfig.platform && !Boot.filterPlatform(newAsset.assetConfig.platform));
+ include = !Microloader.filterAsset(newAsset);
if (!include || !newAsset || (currentAsset.shouldCache() && !newAsset.shouldCache())) {
Microloader.removedAssets.push(currentAsset);
@@ -2058,10 +2102,9 @@ Ext.Microloader = Ext.Microloader || (function () {
var checksum;
result = Microloader.parseResult(result);
Microloader.remainingUpdatingAssets--;
-
+
if (!result.error) {
-
- checksum = Microloader.checksum(asset.assetConfig.hash, result.content);
+ checksum = Microloader.checksum(result.content, asset.assetConfig.hash);
if (!checksum) {
// uncache this asset as there is a new version somewhere that has not been loaded.
@@ -2071,7 +2114,7 @@ Ext.Microloader = Ext.Microloader || (function () {
Microloader.updatedAssets.push(asset);
}
} else {
-
+
// uncache this asset as there is a new version somewhere that has not been loaded.
asset.uncache();
}
@@ -2153,7 +2196,7 @@ Ext.Microloader = Ext.Microloader || (function () {
}
}
},
-
+
fireAppUpdate: function() {
if (Ext.GlobalEvents) {
// We defer dispatching this event slightly in order to let the application finish loading
@@ -2163,12 +2206,16 @@ Ext.Microloader = Ext.Microloader || (function () {
}, 100);
}
},
-
+
checksum: function(content, hash) {
+ if(!content || !hash) {
+ return false;
+ }
+
var passed = true,
hashLn = hash.length,
checksumType = content.substring(0, 1);
-
+
if (checksumType == '/') {
if (content.substring(2, hashLn + 2) !== hash) {
passed = false;
@@ -2203,92 +2250,7 @@ Ext.Microloader = Ext.Microloader || (function () {
return Microloader;
}());
-//</editor-fold>
-
/**
- * the current application manifest
- *
- *
- * {
- * name: 'name',
- * version: <checksum>,
- * debug: {
- * hooks: {
- * "*": true
- * }
- * },
- * localStorage: false,
- * mode: production,
- * js: [
- * ...
- * {
- * path: '../boo/baz.js',
- * version: <checksum>,
- * update: full | delta | <falsy>,
- * platform: ['phone', 'ios', 'android']
- * },
- * {
- * path: 'http://some.domain.com/api.js',
- * remote: true
- * },
- * ...
- * ],
- * css: [
- * ...
- * {
- * path: '../boo/baz.css',
- * version: <checksum>,
- * update: full | delta | <falsy>,
- * platform: ['phone', 'ios', 'android']
- * },
- * ...
- * ],
- * localStorage: false,
- * paths: {...},
- * loadOrder: [
- * ...
- * {
- * path: '../foo/bar.js",
- * idx: 158,
- * requires; [1,2,3,...,145,157],
- * uses: [182, 193]
- * },
- * ...
- * ],
- * classes: {
- * ...
- * 'Ext.panel.Panel': {
- * requires: [...],
- * uses: [...],
- * aliases: [...],
- * alternates: [...],
- * mixins: [...]
- * },
- * 'Ext.rtl.util.Renderable': {
- * requires: [...],
- * uses: [...],
- * aliases: [...],
- * alternates: [...],
- * mixins: [...]
- * override: 'Ext.util.Renderable'
- * },
- * ...
- * },
- * packages: {
- * ...
- * "sencha-core": {
- * version: '1.2.3.4',
- * requires: []
- * },
- * "ext": {
- * version: '5.0.0.0',
- * requires: ["sencha-core"]
- * }.
- * ...
- * }
- * }
- *
- *
* @type {String/Object}
*/
Ext.manifest = Ext.manifest || "bootstrap";
I am open to suggestions.