single-spa-angular
Advanced tools
Comparing version 4.3.2 to 4.4.1
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define('single-spa-angular/internals', ['exports'], factory) : | ||
(global = global || self, factory((global['single-spa-angular'] = global['single-spa-angular'] || {}, global['single-spa-angular'].internals = {}))); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['single-spa-angular'] = global['single-spa-angular'] || {}, global['single-spa-angular'].internals = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
function removeApplicationFromDOMIfIvyEnabled(opts, props) { | ||
function removeApplicationFromDOMIfIvyEnabled(options, props) { | ||
if (ivyEnabled()) { | ||
var domElementGetter = chooseDomElementGetter(opts, props); | ||
var domElement = getContainerEl(domElementGetter); | ||
var domElementGetter = chooseDomElementGetter(options, props); | ||
var domElement = getContainerElement(domElementGetter); | ||
// View Engine removes all nodes automatically when calling `NgModuleRef.destroy()`, | ||
@@ -18,3 +18,12 @@ // which calls `ComponentRef.destroy()`. | ||
} | ||
function getContainerEl(domElementGetter) { | ||
function getContainerElementAndSetTemplate(options, props) { | ||
var domElementGetter = chooseDomElementGetter(options, props); | ||
if (!domElementGetter) { | ||
throw Error("Cannot mount angular application '" + (props.name || props.appName) + "' without a domElementGetter provided either as an opt or a prop"); | ||
} | ||
var containerElement = getContainerElement(domElementGetter); | ||
containerElement.innerHTML = options.template; | ||
return containerElement; | ||
} | ||
function getContainerElement(domElementGetter) { | ||
var element = domElementGetter(); | ||
@@ -69,4 +78,7 @@ if (!element) { | ||
exports.chooseDomElementGetter = chooseDomElementGetter; | ||
exports.getContainerEl = getContainerEl; | ||
/** | ||
* Generated bundle index. Do not edit. | ||
*/ | ||
exports.getContainerElementAndSetTemplate = getContainerElementAndSetTemplate; | ||
exports.removeApplicationFromDOMIfIvyEnabled = removeApplicationFromDOMIfIvyEnabled; | ||
@@ -73,0 +85,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("single-spa-angular/internals",["exports"],n):n(((e=e||self)["single-spa-angular"]=e["single-spa-angular"]||{},e["single-spa-angular"].internals={}))}(this,(function(e){"use strict";function n(e){var n=e();if(!n)throw Error("domElementGetter did not return a valid dom element");return n}function t(e,n){var t,r;return(n=null!==(t=null==n?void 0:n.customProps)&&void 0!==t?t:n).domElement?function(){return n.domElement}:n.domElementGetter?n.domElementGetter:e.domElementGetter?e.domElementGetter:(r=n.name,function(){var e="single-spa-application:"+r,n=document.getElementById(e);return n||((n=document.createElement("div")).id=e,document.body.appendChild(n)),n})}e.chooseDomElementGetter=t,e.getContainerEl=n,e.removeApplicationFromDOMIfIvyEnabled=function(e,r){if(function(){try{return!!require("@angular/core").ɵivyEnabled}catch(e){return!1}}())for(var o=n(t(e,r));o.firstChild;)o.removeChild(o.firstChild)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("single-spa-angular/internals",["exports"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self)["single-spa-angular"]=e["single-spa-angular"]||{},e["single-spa-angular"].internals={}))}(this,(function(e){"use strict";function n(e){var n=e();if(!n)throw Error("domElementGetter did not return a valid dom element");return n}function t(e,n){var t,r;return(n=null!==(t=null==n?void 0:n.customProps)&&void 0!==t?t:n).domElement?function(){return n.domElement}:n.domElementGetter?n.domElementGetter:e.domElementGetter?e.domElementGetter:(r=n.name,function(){var e="single-spa-application:"+r,n=document.getElementById(e);return n||((n=document.createElement("div")).id=e,document.body.appendChild(n)),n})}e.getContainerElementAndSetTemplate=function(e,r){var o=t(e,r);if(!o)throw Error("Cannot mount angular application '"+(r.name||r.appName)+"' without a domElementGetter provided either as an opt or a prop");var i=n(o);return i.innerHTML=e.template,i},e.removeApplicationFromDOMIfIvyEnabled=function(e,r){if(function(){try{return!!require("@angular/core").ɵivyEnabled}catch(e){return!1}}())for(var o=n(t(e,r));o.firstChild;)o.removeChild(o.firstChild)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=single-spa-angular-internals.umd.min.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('single-spa-angular/internals'), require('@angular/core'), require('@angular/common')) : | ||
typeof define === 'function' && define.amd ? define('single-spa-angular', ['exports', 'single-spa-angular/internals', '@angular/core', '@angular/common'], factory) : | ||
(global = global || self, factory(global['single-spa-angular'] = {}, global['single-spa-angular'].internals, global.ng.core, global.ng.common)); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['single-spa-angular'] = {}, global['single-spa-angular'].internals, global.ng.core, global.ng.common)); | ||
}(this, (function (exports, internals, core, common) { 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Copyright (c) Microsoft Corporation. | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
var extendStatics = function(d, b) { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) | ||
if (Object.prototype.hasOwnProperty.call(b, p)) | ||
d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
function __extends(d, b) { | ||
@@ -35,8 +35,9 @@ extendStatics(d, b); | ||
} | ||
var __assign = function() { | ||
var __assign = function () { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
for (var p in s) | ||
if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
@@ -47,7 +48,7 @@ return t; | ||
}; | ||
function __rest(s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
for (var p in s) | ||
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
@@ -60,23 +61,34 @@ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
} | ||
function __decorate(decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") | ||
r = Reflect.decorate(decorators, target, key, desc); | ||
else | ||
for (var i = decorators.length - 1; i >= 0; i--) | ||
if (d = decorators[i]) | ||
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
} | ||
function __param(paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
return function (target, key) { decorator(target, key, paramIndex); }; | ||
} | ||
function __metadata(metadataKey, metadataValue) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") | ||
return Reflect.metadata(metadataKey, metadataValue); | ||
} | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function fulfilled(value) { try { | ||
step(generator.next(value)); | ||
} | ||
catch (e) { | ||
reject(e); | ||
} } | ||
function rejected(value) { try { | ||
step(generator["throw"](value)); | ||
} | ||
catch (e) { | ||
reject(e); | ||
} } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
@@ -86,64 +98,123 @@ step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
} | ||
function __generator(thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
var _ = { label: 0, sent: function () { if (t[0] & 1) | ||
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
if (f) | ||
throw new TypeError("Generator is already executing."); | ||
while (_) | ||
try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) | ||
return t; | ||
if (y = 0, t) | ||
op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: | ||
case 1: | ||
t = op; | ||
break; | ||
case 4: | ||
_.label++; | ||
return { value: op[1], done: false }; | ||
case 5: | ||
_.label++; | ||
y = op[1]; | ||
op = [0]; | ||
continue; | ||
case 7: | ||
op = _.ops.pop(); | ||
_.trys.pop(); | ||
continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { | ||
_ = 0; | ||
continue; | ||
} | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { | ||
_.label = op[1]; | ||
break; | ||
} | ||
if (op[0] === 6 && _.label < t[1]) { | ||
_.label = t[1]; | ||
t = op; | ||
break; | ||
} | ||
if (t && _.label < t[2]) { | ||
_.label = t[2]; | ||
_.ops.push(op); | ||
break; | ||
} | ||
if (t[2]) | ||
_.ops.pop(); | ||
_.trys.pop(); | ||
continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
catch (e) { | ||
op = [6, e]; | ||
y = 0; | ||
} | ||
finally { | ||
f = t = 0; | ||
} | ||
if (op[0] & 5) | ||
throw op[1]; | ||
return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
} | ||
function __exportStar(m, exports) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
var __createBinding = Object.create ? (function (o, m, k, k2) { | ||
if (k2 === undefined) | ||
k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); | ||
}) : (function (o, m, k, k2) { | ||
if (k2 === undefined) | ||
k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
function __exportStar(m, o) { | ||
for (var p in m) | ||
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) | ||
__createBinding(o, m, p); | ||
} | ||
function __values(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
if (m) | ||
return m.call(o); | ||
if (o && typeof o.length === "number") | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) | ||
o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
} | ||
function __read(o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
if (!m) | ||
return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) | ||
ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
catch (error) { | ||
e = { error: error }; | ||
} | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
if (r && !r.done && (m = i["return"])) | ||
m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
finally { | ||
if (e) | ||
throw e.error; | ||
} | ||
} | ||
return ar; | ||
} | ||
function __spread() { | ||
@@ -154,5 +225,5 @@ for (var ar = [], i = 0; i < arguments.length; i++) | ||
} | ||
function __spreadArrays() { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) | ||
s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
@@ -162,20 +233,26 @@ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
return r; | ||
}; | ||
} | ||
; | ||
function __await(v) { | ||
return this instanceof __await ? (this.v = v, this) : new __await(v); | ||
} | ||
function __asyncGenerator(thisArg, _arguments, generator) { | ||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); | ||
if (!Symbol.asyncIterator) | ||
throw new TypeError("Symbol.asyncIterator is not defined."); | ||
var g = generator.apply(thisArg, _arguments || []), i, q = []; | ||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; | ||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } | ||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } | ||
function verb(n) { if (g[n]) | ||
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } | ||
function resume(n, v) { try { | ||
step(g[n](v)); | ||
} | ||
catch (e) { | ||
settle(q[0][3], e); | ||
} } | ||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } | ||
function fulfill(value) { resume("next", value); } | ||
function reject(value) { resume("throw", value); } | ||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } | ||
function settle(f, v) { if (f(v), q.shift(), q.length) | ||
resume(q[0][0], q[0][1]); } | ||
} | ||
function __asyncDelegator(o) { | ||
@@ -186,28 +263,39 @@ var i, p; | ||
} | ||
function __asyncValues(o) { | ||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); | ||
if (!Symbol.asyncIterator) | ||
throw new TypeError("Symbol.asyncIterator is not defined."); | ||
var m = o[Symbol.asyncIterator], i; | ||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); | ||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } | ||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } | ||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } | ||
} | ||
function __makeTemplateObject(cooked, raw) { | ||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } | ||
if (Object.defineProperty) { | ||
Object.defineProperty(cooked, "raw", { value: raw }); | ||
} | ||
else { | ||
cooked.raw = raw; | ||
} | ||
return cooked; | ||
} | ||
; | ||
var __setModuleDefault = Object.create ? (function (o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function (o, v) { | ||
o["default"] = v; | ||
}; | ||
function __importStar(mod) { | ||
if (mod && mod.__esModule) return mod; | ||
if (mod && mod.__esModule) | ||
return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result.default = mod; | ||
if (mod != null) | ||
for (var k in mod) | ||
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) | ||
__createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
} | ||
function __importDefault(mod) { | ||
return (mod && mod.__esModule) ? mod : { default: mod }; | ||
} | ||
function __classPrivateFieldGet(receiver, privateMap) { | ||
@@ -219,3 +307,2 @@ if (!privateMap.has(receiver)) { | ||
} | ||
function __classPrivateFieldSet(receiver, privateMap, value) { | ||
@@ -232,10 +319,27 @@ if (!privateMap.has(receiver)) { | ||
function SingleSpaPlatformLocation() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super.apply(this, __spread(arguments)) || this; | ||
// This is a simple marker that helps us to ignore PopStateEvents | ||
// that was not dispatched by the browser. | ||
_this.skipNextPopState = false; | ||
_this.onPopStateListeners = []; | ||
// The key here is an actual forked `Zone` of some specific application. | ||
// We will be able to find the specific zone when application gets destroyed | ||
// by application `name`. | ||
// The reason of that the `onPopState` method is invoked during `bootstrapModule` | ||
// and we can't know what application has invoked it. Why should we know the application | ||
// that has invoked `onPopState`? When application gets destroyed in a `sharing dependencies mode` | ||
// (when there is a single platform per all applications) we want to remove application | ||
// specific `popstate` listeners. E.g. if there are 2 applications: | ||
// * shop application adds `popstate` listener | ||
// * navbar application adds `popstate` listener | ||
// When shop application gets destroyed we want to remove only its `popstate` listener. | ||
_this.zoneToOnPopStateListenersMap = new Map(); | ||
// This is used only to make `Zone.wrap` happy, since it requires 2 arguments | ||
// and the second argument is a unique string which `zone.js` uses for debugging purposes. | ||
// We might want to use the application name, but we're not able to get it when `onPopState` | ||
// method is called during module bootstrapping. | ||
_this.source = 0; | ||
return _this; | ||
} | ||
SingleSpaPlatformLocation.prototype.destroy = function () { | ||
SingleSpaPlatformLocation.prototype.destroyApplication = function (zoneIdentifier) { | ||
var e_1, _a; | ||
// TLDR: Angular adds `popstate` event listener and then doesn't remove it when application gets destroyed. | ||
@@ -245,21 +349,25 @@ // Basically, Angular has a potentional memory leak. The `ɵBrowserPlatformLocation` | ||
// https://github.com/angular/angular/blob/14be55c9facf3e47b8c97df4502dc3f0f897da03/packages/common/src/location/platform_location.ts#L126 | ||
var e_1, _a; | ||
try { | ||
for (var _b = __values(this.onPopStateListeners), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var onPopStateListener = _c.value; | ||
window.removeEventListener('popstate', onPopStateListener); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
var zone = __spread(this.zoneToOnPopStateListenersMap.keys()).find( | ||
// `getZoneWith` will return a zone which defines a `key` and in our case | ||
// we define a custom key in `single-spa-angular.ts` | ||
// via this line of code: | ||
// `_properties[zoneIdentifier] = true;` | ||
function (zone) { return zone.getZoneWith(zoneIdentifier) !== null; }); | ||
var onPopStateListeners = this.zoneToOnPopStateListenersMap.get(zone); | ||
if (Array.isArray(onPopStateListeners)) { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
for (var onPopStateListeners_1 = __values(onPopStateListeners), onPopStateListeners_1_1 = onPopStateListeners_1.next(); !onPopStateListeners_1_1.done; onPopStateListeners_1_1 = onPopStateListeners_1.next()) { | ||
var onPopStateListener = onPopStateListeners_1_1.value; | ||
window.removeEventListener('popstate', onPopStateListener); | ||
} | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (onPopStateListeners_1_1 && !onPopStateListeners_1_1.done && (_a = onPopStateListeners_1.return)) _a.call(onPopStateListeners_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
} | ||
// We do this because the `SingleSpaPlatformLocation` is a part of PLATFORM_INJECTOR, | ||
// which means it's created only once and will not be garbage collected, since the PLATFORM_INJECTOR | ||
// will keep reference to its instance. | ||
// TODO: https://github.com/single-spa/single-spa-angular/issues/170 | ||
this.onPopStateListeners = []; | ||
this.zoneToOnPopStateListenersMap.delete(zone); | ||
}; | ||
@@ -276,2 +384,12 @@ SingleSpaPlatformLocation.prototype.pushState = function (state, title, url) { | ||
var _this = this; | ||
// `Zone.current` will reference the zone that serves as an execution context | ||
// to some specific application, especially when `onPopState` is called. | ||
var zone = Zone.current; | ||
// Wrap any event listener into zone that is specific to some application. | ||
// The main issue is `back/forward` buttons of browsers, because they invoke | ||
// `history.back|forward` which dispatch `popstate` event. Since `single-spa` | ||
// overrides `history.replaceState` Angular's zone cannot intercept this event. | ||
// Only the root zone is able to intercept all events. | ||
// See https://github.com/single-spa/single-spa-angular/issues/94 for more details | ||
fn = zone.wrap(fn, "" + this.source++); | ||
var onPopStateListener = function (event) { | ||
@@ -287,24 +405,22 @@ // The `LocationChangeEvent` doesn't have the `singleSpa` property, since it's added | ||
else { | ||
// Wrap any event listener into zone that is specific to some application. | ||
// The main issue is `back/forward` buttons of browsers, because they invoke | ||
// `history.back|forward` which dispatch `popstate` event. Since `single-spa` | ||
// overrides `history.replaceState` Angular's zone cannot intercept this event. | ||
// Only the root zone is able to intercept all events. | ||
// See https://github.com/single-spa/single-spa-angular/issues/94 for more details | ||
_this.ngZone.run(function () { return fn(event); }); | ||
fn(event); | ||
} | ||
}; | ||
this.storeOnPopStateListener(zone, onPopStateListener); | ||
_super.prototype.onPopState.call(this, onPopStateListener); | ||
}; | ||
SingleSpaPlatformLocation.prototype.storeOnPopStateListener = function (zone, onPopStateListener) { | ||
// All listeners should be stored inside an array because the `onPopState` can be called | ||
// multiple times thus we wanna reference all listeners to remove them further. | ||
this.onPopStateListeners.push(onPopStateListener); | ||
_super.prototype.onPopState.call(this, onPopStateListener); | ||
var onPopStateListeners = this.zoneToOnPopStateListenersMap.get(zone) || []; | ||
onPopStateListeners.push(onPopStateListener); | ||
if (!this.zoneToOnPopStateListenersMap.has(zone)) { | ||
this.zoneToOnPopStateListenersMap.set(zone, onPopStateListeners); | ||
} | ||
}; | ||
SingleSpaPlatformLocation.prototype.setNgZone = function (ngZone) { | ||
this.ngZone = ngZone; | ||
}; | ||
SingleSpaPlatformLocation = __decorate([ | ||
core.Injectable() | ||
], SingleSpaPlatformLocation); | ||
return SingleSpaPlatformLocation; | ||
}(common["ɵBrowserPlatformLocation"])); | ||
}(common.ɵBrowserPlatformLocation)); | ||
SingleSpaPlatformLocation.decorators = [ | ||
{ type: core.Injectable } | ||
]; | ||
/** | ||
@@ -329,8 +445,8 @@ * The `PlatformLocation` class is an "injectee" of the `PathLocationStrategy`, | ||
var defaultOpts = { | ||
// Required opts that will be set by the library consumer. | ||
var defaultOptions = { | ||
// Required options that will be set by the library consumer. | ||
NgZone: null, | ||
bootstrapFunction: null, | ||
template: null, | ||
// optional opts | ||
// Optional options | ||
Router: undefined, | ||
@@ -341,24 +457,24 @@ domElementGetter: undefined, | ||
}; | ||
function singleSpaAngular(userOpts) { | ||
if (typeof userOpts !== 'object') { | ||
function singleSpaAngular(userOptions) { | ||
if (typeof userOptions !== 'object') { | ||
throw Error('single-spa-angular requires a configuration object'); | ||
} | ||
var opts = __assign(__assign({}, defaultOpts), userOpts); | ||
if (typeof opts.bootstrapFunction !== 'function') { | ||
throw Error('single-spa-angular must be passed an opts.bootstrapFunction'); | ||
var options = Object.assign(Object.assign({}, defaultOptions), userOptions); | ||
if (typeof options.bootstrapFunction !== 'function') { | ||
throw Error('single-spa-angular must be passed an options.bootstrapFunction'); | ||
} | ||
if (typeof opts.template !== 'string') { | ||
throw Error('single-spa-angular must be passed opts.template string'); | ||
if (typeof options.template !== 'string') { | ||
throw Error('single-spa-angular must be passed options.template string'); | ||
} | ||
if (!opts.NgZone) { | ||
throw Error("single-spa-angular must be passed the NgZone opt"); | ||
if (!options.NgZone) { | ||
throw Error("single-spa-angular must be passed the NgZone option"); | ||
} | ||
return { | ||
bootstrap: bootstrap.bind(null, opts), | ||
mount: mount.bind(null, opts), | ||
unmount: unmount.bind(null, opts), | ||
update: opts.updateFunction, | ||
bootstrap: bootstrap.bind(null, options), | ||
mount: mount.bind(null, options), | ||
unmount: unmount.bind(null, options), | ||
update: options.updateFunction, | ||
}; | ||
} | ||
function bootstrap(opts, props) { | ||
function bootstrap(options, props) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -369,7 +485,7 @@ return __generator(this, function (_a) { | ||
// See https://angular.io/guide/zone#noopzone | ||
if (opts.NgZone === 'noop') { | ||
if (options.NgZone === 'noop') { | ||
return [2 /*return*/]; | ||
} | ||
// In order for multiple Angular apps to work concurrently on a page, they each need a unique identifier. | ||
opts.zoneIdentifier = "single-spa-angular:" + (props.name || props.appName); | ||
options.zoneIdentifier = "single-spa-angular:" + (props.name || props.appName); | ||
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone. | ||
@@ -380,8 +496,8 @@ // See https://github.com/PlaceMe-SAS/single-spa-angular-cli/issues/33, | ||
// and https://github.com/angular/angular/blob/a14dc2d7a4821a19f20a9547053a5734798f541e/packages/core/src/zone/ng_zone.ts#L257 | ||
opts.NgZone.isInAngularZone = function () { | ||
options.NgZone.isInAngularZone = function () { | ||
// @ts-ignore | ||
return window.Zone.current._properties[opts.zoneIdentifier] === true; | ||
return window.Zone.current._properties[options.zoneIdentifier] === true; | ||
}; | ||
opts.routingEventListener = function () { | ||
opts.bootstrappedNgZone.run(function () { | ||
options.routingEventListener = function () { | ||
options.bootstrappedNgZone.run(function () { | ||
// See https://github.com/single-spa/single-spa-angular/issues/86 | ||
@@ -396,17 +512,12 @@ // Zone is unaware of the single-spa navigation change and so Angular change detection doesn't work | ||
} | ||
function mount(opts, props) { | ||
function mount(options, props) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var domElementGetter, containerEl, bootstrapPromise, module, singleSpaPlatformLocation, ngZoneEnabled, bootstrappedOpts, ngZone; | ||
var bootstrapPromise, module, singleSpaPlatformLocation, ngZoneEnabled, bootstrappedOptions, ngZone, zoneIdentifier_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
domElementGetter = internals.chooseDomElementGetter(opts, props); | ||
if (!domElementGetter) { | ||
throw Error("cannot mount angular application '" + (props.name || props.appName) + "' without a domElementGetter provided either as an opt or a prop"); | ||
} | ||
containerEl = internals.getContainerEl(domElementGetter); | ||
containerEl.innerHTML = opts.template; | ||
bootstrapPromise = opts.bootstrapFunction(props); | ||
internals.getContainerElementAndSetTemplate(options, props); | ||
bootstrapPromise = options.bootstrapFunction(props); | ||
if (!(bootstrapPromise instanceof Promise)) { | ||
throw Error("single-spa-angular: the opts.bootstrapFunction must return a promise, but instead returned a '" + typeof bootstrapPromise + "' that is not a Promise"); | ||
throw Error("single-spa-angular: the options.bootstrapFunction must return a promise, but instead returned a '" + typeof bootstrapPromise + "' that is not a Promise"); | ||
} | ||
@@ -417,6 +528,6 @@ return [4 /*yield*/, bootstrapPromise]; | ||
if (!module || typeof module.destroy !== 'function') { | ||
throw Error("single-spa-angular: the opts.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?"); | ||
throw Error("single-spa-angular: the options.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?"); | ||
} | ||
singleSpaPlatformLocation = module.injector.get(SingleSpaPlatformLocation, null); | ||
ngZoneEnabled = opts.NgZone !== 'noop'; | ||
ngZoneEnabled = options.NgZone !== 'noop'; | ||
// The user has to provide `BrowserPlatformLocation` only if his application uses routing. | ||
@@ -426,21 +537,21 @@ // So if he provided `Router` but didn't provide `BrowserPlatformLocation` then we have to inform him. | ||
// `zone-less` change detection, if `NgZone` is `noop` then we can skip it. | ||
if (ngZoneEnabled && opts.Router && singleSpaPlatformLocation === null) { | ||
if (ngZoneEnabled && options.Router && singleSpaPlatformLocation === null) { | ||
throw new Error("\t\n single-spa-angular: could not retrieve extra providers from the platform injector. Did you call platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule()?\n "); | ||
} | ||
bootstrappedOpts = opts; | ||
bootstrappedOptions = options; | ||
if (ngZoneEnabled) { | ||
ngZone = module.injector.get(opts.NgZone); | ||
ngZone = module.injector.get(options.NgZone); | ||
zoneIdentifier_1 = bootstrappedOptions.zoneIdentifier; | ||
// `NgZone` can be enabled but routing may not be used thus `getSingleSpaExtraProviders()` | ||
// function was not called. | ||
if (singleSpaPlatformLocation !== null) { | ||
singleSpaPlatformLocation.setNgZone(ngZone); | ||
// Cleanup resources, especially remove event listeners thus they will not be added | ||
// twice when application gets bootstrapped the second time. | ||
module.onDestroy(function () { return singleSpaPlatformLocation.destroy(); }); | ||
module.onDestroy(function () { return singleSpaPlatformLocation.destroyApplication(zoneIdentifier_1); }); | ||
} | ||
bootstrappedOpts.bootstrappedNgZone = ngZone; | ||
bootstrappedOpts.bootstrappedNgZone['_inner']._properties[bootstrappedOpts.zoneIdentifier] = true; | ||
window.addEventListener('single-spa:routing-event', bootstrappedOpts.routingEventListener); | ||
bootstrappedOptions.bootstrappedNgZone = ngZone; | ||
bootstrappedOptions.bootstrappedNgZone['_inner']._properties[zoneIdentifier_1] = true; | ||
window.addEventListener('single-spa:routing-event', bootstrappedOptions.routingEventListener); | ||
} | ||
bootstrappedOpts.bootstrappedModule = module; | ||
bootstrappedOptions.bootstrappedModule = module; | ||
return [2 /*return*/, module]; | ||
@@ -452,22 +563,22 @@ } | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function unmount(opts, props) { | ||
function unmount(options, props) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var router, animationEngine; | ||
return __generator(this, function (_a) { | ||
if (opts.Router) { | ||
router = opts.bootstrappedModule.injector.get(opts.Router); | ||
if (options.Router) { | ||
router = options.bootstrappedModule.injector.get(options.Router); | ||
router.dispose(); | ||
} | ||
if (opts.routingEventListener) { | ||
window.removeEventListener('single-spa:routing-event', opts.routingEventListener); | ||
if (options.routingEventListener) { | ||
window.removeEventListener('single-spa:routing-event', options.routingEventListener); | ||
} | ||
if (opts.AnimationEngine) { | ||
animationEngine = opts.bootstrappedModule.injector.get(opts.AnimationEngine); | ||
if (options.AnimationEngine) { | ||
animationEngine = options.bootstrappedModule.injector.get(options.AnimationEngine); | ||
animationEngine._transitionEngine.flush(); | ||
} | ||
opts.bootstrappedModule.destroy(); | ||
delete opts.bootstrappedModule; | ||
options.bootstrappedModule.destroy(); | ||
delete options.bootstrappedModule; | ||
// This is an issue. Issue has been created and Angular team is working on the fix: | ||
// https://github.com/angular/angular/issues/36449 | ||
internals.removeApplicationFromDOMIfIvyEnabled(opts, props); | ||
internals.removeApplicationFromDOMIfIvyEnabled(options, props); | ||
return [2 /*return*/]; | ||
@@ -512,3 +623,3 @@ }); | ||
} | ||
_this.parcel = mountParcel(_this.config, __assign({ domElement: domElement }, _this.customProps)); | ||
_this.parcel = mountParcel(_this.config, Object.assign({ domElement: domElement }, _this.customProps)); | ||
if (_this.onParcelMount) { | ||
@@ -577,34 +688,22 @@ _this.parcel.mountPromise.then(_this.onParcelMount); | ||
}; | ||
ParcelComponent.ctorParameters = function () { return [ | ||
{ type: core.ElementRef } | ||
]; }; | ||
__decorate([ | ||
core.Input() | ||
], ParcelComponent.prototype, "config", void 0); | ||
__decorate([ | ||
core.Input() | ||
], ParcelComponent.prototype, "mountParcel", void 0); | ||
__decorate([ | ||
core.Input() | ||
], ParcelComponent.prototype, "onParcelMount", void 0); | ||
__decorate([ | ||
core.Input() | ||
], ParcelComponent.prototype, "wrapWith", void 0); | ||
__decorate([ | ||
core.Input() | ||
], ParcelComponent.prototype, "customProps", void 0); | ||
__decorate([ | ||
core.Input() | ||
], ParcelComponent.prototype, "appendTo", void 0); | ||
__decorate([ | ||
core.Input() | ||
], ParcelComponent.prototype, "handleError", void 0); | ||
ParcelComponent = __decorate([ | ||
core.Component({ | ||
selector: 'parcel', | ||
template: '<div></div>' | ||
}) | ||
], ParcelComponent); | ||
return ParcelComponent; | ||
}()); | ||
ParcelComponent.decorators = [ | ||
{ type: core.Component, args: [{ | ||
selector: 'parcel', | ||
template: '<div></div>' | ||
},] } | ||
]; | ||
ParcelComponent.ctorParameters = function () { return [ | ||
{ type: core.ElementRef } | ||
]; }; | ||
ParcelComponent.propDecorators = { | ||
config: [{ type: core.Input }], | ||
mountParcel: [{ type: core.Input }], | ||
onParcelMount: [{ type: core.Input }], | ||
wrapWith: [{ type: core.Input }], | ||
customProps: [{ type: core.Input }], | ||
appendTo: [{ type: core.Input }], | ||
handleError: [{ type: core.Input }] | ||
}; | ||
@@ -614,12 +713,20 @@ var ParcelModule = /** @class */ (function () { | ||
} | ||
ParcelModule = __decorate([ | ||
core.NgModule({ | ||
declarations: [ParcelComponent], | ||
exports: [ParcelComponent], | ||
entryComponents: [ParcelComponent], | ||
}) | ||
], ParcelModule); | ||
return ParcelModule; | ||
}()); | ||
ParcelModule.decorators = [ | ||
{ type: core.NgModule, args: [{ | ||
declarations: [ParcelComponent], | ||
exports: [ParcelComponent], | ||
entryComponents: [ParcelComponent], | ||
},] } | ||
]; | ||
/** | ||
* The public api for consumers of single-spa-angular | ||
*/ | ||
/** | ||
* Generated bundle index. Do not edit. | ||
*/ | ||
exports.ParcelComponent = ParcelComponent; | ||
@@ -626,0 +733,0 @@ exports.ParcelModule = ParcelModule; |
@@ -1,16 +0,16 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("single-spa-angular/internals"),require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("single-spa-angular",["exports","single-spa-angular/internals","@angular/core","@angular/common"],e):e((t=t||self)["single-spa-angular"]={},t["single-spa-angular"].internals,t.ng.core,t.ng.common)}(this,(function(t,e,n,o){"use strict"; | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("single-spa-angular/internals"),require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("single-spa-angular",["exports","single-spa-angular/internals","@angular/core","@angular/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["single-spa-angular"]={},t["single-spa-angular"].internals,t.ng.core,t.ng.common)}(this,(function(t,e,n,o){"use strict"; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Copyright (c) Microsoft Corporation. | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var i=function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function u(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{s(o.next(t))}catch(t){i(t)}}function u(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((o=o.apply(t,e||[])).next())}))}function s(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function c(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.skipNextPopState=!1,e.onPopStateListeners=[],e}return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.destroy=function(){var t,e;try{for(var n=p(this.onPopStateListeners),o=n.next();!o.done;o=n.next()){var r=o.value;window.removeEventListener("popstate",r)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.onPopStateListeners=[]},e.prototype.pushState=function(e,n,o){this.skipNextPopState=!0,t.prototype.pushState.call(this,e,n,o)},e.prototype.replaceState=function(e,n,o){this.skipNextPopState=!0,t.prototype.replaceState.call(this,e,n,o)},e.prototype.onPopState=function(e){var n=this,o=function(t){var o=!!t.singleSpa;n.skipNextPopState&&o?n.skipNextPopState=!1:n.ngZone.run((function(){return e(t)}))};this.onPopStateListeners.push(o),t.prototype.onPopState.call(this,o)},e.prototype.setNgZone=function(t){this.ngZone=t},e=a([n.Injectable()],e)}(o["ɵBrowserPlatformLocation"]);var d={NgZone:null,bootstrapFunction:null,template:null,Router:void 0,domElementGetter:void 0,AnimationEngine:void 0,updateFunction:function(){return Promise.resolve()}};function h(t,e){return u(this,void 0,void 0,(function(){return s(this,(function(n){return"noop"===t.NgZone||(t.zoneIdentifier="single-spa-angular:"+(e.name||e.appName),t.NgZone.isInAngularZone=function(){return!0===window.Zone.current._properties[t.zoneIdentifier]},t.routingEventListener=function(){t.bootstrappedNgZone.run((function(){}))}),[2]}))}))}function g(t,n){return u(this,void 0,void 0,(function(){var o,r,i,a,u,p,l;return s(this,(function(s){switch(s.label){case 0:if(!(o=e.chooseDomElementGetter(t,n)))throw Error("cannot mount angular application '"+(n.name||n.appName)+"' without a domElementGetter provided either as an opt or a prop");if(e.getContainerEl(o).innerHTML=t.template,!((r=t.bootstrapFunction(n))instanceof Promise))throw Error("single-spa-angular: the opts.bootstrapFunction must return a promise, but instead returned a '"+typeof r+"' that is not a Promise");return[4,r];case 1:if(!(i=s.sent())||"function"!=typeof i.destroy)throw Error("single-spa-angular: the opts.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?");if(a=i.injector.get(f,null),(u="noop"!==t.NgZone)&&t.Router&&null===a)throw new Error("\t\n single-spa-angular: could not retrieve extra providers from the platform injector. Did you call platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule()?\n ");return p=t,u&&(l=i.injector.get(t.NgZone),null!==a&&(a.setNgZone(l),i.onDestroy((function(){return a.destroy()}))),p.bootstrappedNgZone=l,p.bootstrappedNgZone._inner._properties[p.zoneIdentifier]=!0,window.addEventListener("single-spa:routing-event",p.routingEventListener)),p.bootstrappedModule=i,[2,i]}}))}))}function m(t,n){return u(this,void 0,void 0,(function(){return s(this,(function(o){return t.Router&&t.bootstrappedModule.injector.get(t.Router).dispose(),t.routingEventListener&&window.removeEventListener("single-spa:routing-event",t.routingEventListener),t.AnimationEngine&&t.bootstrappedModule.injector.get(t.AnimationEngine)._transitionEngine.flush(),t.bootstrappedModule.destroy(),delete t.bootstrappedModule,e.removeApplicationFromDOMIfIvyEnabled(t,n),[2]}))}))}var y=function(){function t(t){this.host=t,this.onParcelMount=null,this.wrapWith="div",this.customProps={},this.appendTo=null,this.handleError=function(t){return console.error(t)},this.createdDomElement=null,this.hasError=!1,this.unmounted=!0}return t.prototype.ngOnInit=function(){var t=this;if(!this.config)throw new Error("single-spa-angular's Parcel component requires the [config] binding to either be a parcel config or a loading function that returns a promise. See https://github.com/CanopyTax/single-spa-angular");this.addThingToDo("mount",(function(){var e,n=t.mountParcel;if(!n)throw new Error("\n\t\t\t\t <parcel> was not passed a [mountParcel] binding.\n\t\t\t\t If you are using <parcel> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <parcel> as a [mountParcel] binding\n\t\t\t\t");t.appendTo?(t.createdDomElement=e=document.createElement(t.wrapWith),t.appendTo.appendChild(e)):(t.createdDomElement=e=document.createElement(t.wrapWith),t.host.nativeElement.children[0].appendChild(e));return t.parcel=n(t.config,i({domElement:e},t.customProps)),t.onParcelMount&&t.parcel.mountPromise.then(t.onParcelMount),t.unmounted=!1,t.parcel.mountPromise}))},t.prototype.ngOnChanges=function(){var t=this;this.addThingToDo("update",(function(){if(t.parcel&&t.parcel.update)return t.parcel.update(t.customProps)}))},t.prototype.ngOnDestroy=function(){var t=this;this.addThingToDo("unmount",(function(){if(t.parcel&&"MOUNTED"===t.parcel.getStatus())return t.parcel.unmount()})),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0},t.prototype.addThingToDo=function(t,e){var n=this;this.hasError&&"unmount"!==t||(this.nextThingToDo=(this.nextThingToDo||Promise.resolve()).then((function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];if(!n.unmounted||"unmount"===t)return e.apply(void 0,c(o))})).catch((function(e){throw n.nextThingToDo=Promise.resolve(),n.hasError=!0,e&&e.message&&(e.message="During '"+t+"', parcel threw an error: "+e.message),"function"==typeof n.handleError?n.handleError(e):setTimeout((function(){throw e})),e})))},t.ctorParameters=function(){return[{type:n.ElementRef}]},a([n.Input()],t.prototype,"config",void 0),a([n.Input()],t.prototype,"mountParcel",void 0),a([n.Input()],t.prototype,"onParcelMount",void 0),a([n.Input()],t.prototype,"wrapWith",void 0),a([n.Input()],t.prototype,"customProps",void 0),a([n.Input()],t.prototype,"appendTo",void 0),a([n.Input()],t.prototype,"handleError",void 0),t=a([n.Component({selector:"parcel",template:"<div></div>"})],t)}(),v=function(){function t(){}return t=a([n.NgModule({declarations:[y],exports:[y],entryComponents:[y]})],t)}();t.ParcelComponent=y,t.ParcelModule=v,t.getSingleSpaExtraProviders=function(){return[{provide:f,useClass:f,deps:[[new n.Inject(o.DOCUMENT)]]},{provide:o.PlatformLocation,useExisting:f}]},t.singleSpaAngular=function(t){if("object"!=typeof t)throw Error("single-spa-angular requires a configuration object");var e=i(i({},d),t);if("function"!=typeof e.bootstrapFunction)throw Error("single-spa-angular must be passed an opts.bootstrapFunction");if("string"!=typeof e.template)throw Error("single-spa-angular must be passed opts.template string");if(!e.NgZone)throw Error("single-spa-angular must be passed the NgZone opt");return{bootstrap:h.bind(null,e),mount:g.bind(null,e),unmount:m.bind(null,e),update:e.updateFunction}},t.ɵa=f,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function s(t){try{u(o.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((o=o.apply(t,e||[])).next())}))}function a(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}Object.create;var l=function(t){function e(){var e=t.apply(this,p(arguments))||this;return e.skipNextPopState=!1,e.zoneToOnPopStateListenersMap=new Map,e.source=0,e}return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.destroyApplication=function(t){var e,n,o=p(this.zoneToOnPopStateListenersMap.keys()).find((function(e){return null!==e.getZoneWith(t)})),r=this.zoneToOnPopStateListenersMap.get(o);if(Array.isArray(r))try{for(var i=s(r),a=i.next();!a.done;a=i.next()){var u=a.value;window.removeEventListener("popstate",u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}this.zoneToOnPopStateListenersMap.delete(o)},e.prototype.pushState=function(e,n,o){this.skipNextPopState=!0,t.prototype.pushState.call(this,e,n,o)},e.prototype.replaceState=function(e,n,o){this.skipNextPopState=!0,t.prototype.replaceState.call(this,e,n,o)},e.prototype.onPopState=function(e){var n=this,o=Zone.current;e=o.wrap(e,""+this.source++);var r=function(t){var o=!!t.singleSpa;n.skipNextPopState&&o?n.skipNextPopState=!1:e(t)};this.storeOnPopStateListener(o,r),t.prototype.onPopState.call(this,r)},e.prototype.storeOnPopStateListener=function(t,e){var n=this.zoneToOnPopStateListenersMap.get(t)||[];n.push(e),this.zoneToOnPopStateListenersMap.has(t)||this.zoneToOnPopStateListenersMap.set(t,n)},e}(o.ɵBrowserPlatformLocation);l.decorators=[{type:n.Injectable}];var c={NgZone:null,bootstrapFunction:null,template:null,Router:void 0,domElementGetter:void 0,AnimationEngine:void 0,updateFunction:function(){return Promise.resolve()}};function f(t,e){return i(this,void 0,void 0,(function(){return a(this,(function(n){return"noop"===t.NgZone||(t.zoneIdentifier="single-spa-angular:"+(e.name||e.appName),t.NgZone.isInAngularZone=function(){return!0===window.Zone.current._properties[t.zoneIdentifier]},t.routingEventListener=function(){t.bootstrappedNgZone.run((function(){}))}),[2]}))}))}function d(t,n){return i(this,void 0,void 0,(function(){var o,r,i,s,u,p,c;return a(this,(function(a){switch(a.label){case 0:if(e.getContainerElementAndSetTemplate(t,n),!((o=t.bootstrapFunction(n))instanceof Promise))throw Error("single-spa-angular: the options.bootstrapFunction must return a promise, but instead returned a '"+typeof o+"' that is not a Promise");return[4,o];case 1:if(!(r=a.sent())||"function"!=typeof r.destroy)throw Error("single-spa-angular: the options.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?");if(i=r.injector.get(l,null),(s="noop"!==t.NgZone)&&t.Router&&null===i)throw new Error("\t\n single-spa-angular: could not retrieve extra providers from the platform injector. Did you call platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule()?\n ");return u=t,s&&(p=r.injector.get(t.NgZone),c=u.zoneIdentifier,null!==i&&r.onDestroy((function(){return i.destroyApplication(c)})),u.bootstrappedNgZone=p,u.bootstrappedNgZone._inner._properties[c]=!0,window.addEventListener("single-spa:routing-event",u.routingEventListener)),u.bootstrappedModule=r,[2,r]}}))}))}function h(t,n){return i(this,void 0,void 0,(function(){return a(this,(function(o){return t.Router&&t.bootstrappedModule.injector.get(t.Router).dispose(),t.routingEventListener&&window.removeEventListener("single-spa:routing-event",t.routingEventListener),t.AnimationEngine&&t.bootstrappedModule.injector.get(t.AnimationEngine)._transitionEngine.flush(),t.bootstrappedModule.destroy(),delete t.bootstrappedModule,e.removeApplicationFromDOMIfIvyEnabled(t,n),[2]}))}))}var g=function(){function t(t){this.host=t,this.onParcelMount=null,this.wrapWith="div",this.customProps={},this.appendTo=null,this.handleError=function(t){return console.error(t)},this.createdDomElement=null,this.hasError=!1,this.unmounted=!0}return t.prototype.ngOnInit=function(){var t=this;if(!this.config)throw new Error("single-spa-angular's Parcel component requires the [config] binding to either be a parcel config or a loading function that returns a promise. See https://github.com/CanopyTax/single-spa-angular");this.addThingToDo("mount",(function(){var e,n=t.mountParcel;if(!n)throw new Error("\n\t\t\t\t <parcel> was not passed a [mountParcel] binding.\n\t\t\t\t If you are using <parcel> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <parcel> as a [mountParcel] binding\n\t\t\t\t");t.appendTo?(t.createdDomElement=e=document.createElement(t.wrapWith),t.appendTo.appendChild(e)):(t.createdDomElement=e=document.createElement(t.wrapWith),t.host.nativeElement.children[0].appendChild(e));return t.parcel=n(t.config,Object.assign({domElement:e},t.customProps)),t.onParcelMount&&t.parcel.mountPromise.then(t.onParcelMount),t.unmounted=!1,t.parcel.mountPromise}))},t.prototype.ngOnChanges=function(){var t=this;this.addThingToDo("update",(function(){if(t.parcel&&t.parcel.update)return t.parcel.update(t.customProps)}))},t.prototype.ngOnDestroy=function(){var t=this;this.addThingToDo("unmount",(function(){if(t.parcel&&"MOUNTED"===t.parcel.getStatus())return t.parcel.unmount()})),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0},t.prototype.addThingToDo=function(t,e){var n=this;this.hasError&&"unmount"!==t||(this.nextThingToDo=(this.nextThingToDo||Promise.resolve()).then((function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];if(!n.unmounted||"unmount"===t)return e.apply(void 0,p(o))})).catch((function(e){throw n.nextThingToDo=Promise.resolve(),n.hasError=!0,e&&e.message&&(e.message="During '"+t+"', parcel threw an error: "+e.message),"function"==typeof n.handleError?n.handleError(e):setTimeout((function(){throw e})),e})))},t}();g.decorators=[{type:n.Component,args:[{selector:"parcel",template:"<div></div>"}]}],g.ctorParameters=function(){return[{type:n.ElementRef}]},g.propDecorators={config:[{type:n.Input}],mountParcel:[{type:n.Input}],onParcelMount:[{type:n.Input}],wrapWith:[{type:n.Input}],customProps:[{type:n.Input}],appendTo:[{type:n.Input}],handleError:[{type:n.Input}]};var m=function(){};m.decorators=[{type:n.NgModule,args:[{declarations:[g],exports:[g],entryComponents:[g]}]}],t.ParcelComponent=g,t.ParcelModule=m,t.getSingleSpaExtraProviders=function(){return[{provide:l,useClass:l,deps:[[new n.Inject(o.DOCUMENT)]]},{provide:o.PlatformLocation,useExisting:l}]},t.singleSpaAngular=function(t){if("object"!=typeof t)throw Error("single-spa-angular requires a configuration object");var e=Object.assign(Object.assign({},c),t);if("function"!=typeof e.bootstrapFunction)throw Error("single-spa-angular must be passed an options.bootstrapFunction");if("string"!=typeof e.template)throw Error("single-spa-angular must be passed options.template string");if(!e.NgZone)throw Error("single-spa-angular must be passed the NgZone option");return{bootstrap:f.bind(null,e),mount:d.bind(null,e),unmount:h.bind(null,e),update:e.updateFunction}},t.ɵa=l,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=single-spa-angular.umd.min.js.map |
@@ -5,2 +5,2 @@ /** | ||
export * from './src/public_api'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9zaW5nbGUtc3BhLWFuZ3VsYXIvIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILGNBQWMsa0JBQWtCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRoZSBwdWJsaWMgYXBpIGZvciBjb25zdW1lcnMgb2Ygc2luZ2xlLXNwYS1hbmd1bGFyXG4gKi9cbmV4cG9ydCAqIGZyb20gJy4vc3JjL3B1YmxpY19hcGknO1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFDSCxjQUFjLGtCQUFrQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBUaGUgcHVibGljIGFwaSBmb3IgY29uc3VtZXJzIG9mIHNpbmdsZS1zcGEtYW5ndWxhclxuICovXG5leHBvcnQgKiBmcm9tICcuL3NyYy9wdWJsaWNfYXBpJztcbiJdfQ== |
@@ -1,5 +0,5 @@ | ||
export function removeApplicationFromDOMIfIvyEnabled(opts, props) { | ||
export function removeApplicationFromDOMIfIvyEnabled(options, props) { | ||
if (ivyEnabled()) { | ||
const domElementGetter = chooseDomElementGetter(opts, props); | ||
const domElement = getContainerEl(domElementGetter); | ||
const domElementGetter = chooseDomElementGetter(options, props); | ||
const domElement = getContainerElement(domElementGetter); | ||
// View Engine removes all nodes automatically when calling `NgModuleRef.destroy()`, | ||
@@ -12,3 +12,12 @@ // which calls `ComponentRef.destroy()`. | ||
} | ||
export function getContainerEl(domElementGetter) { | ||
export function getContainerElementAndSetTemplate(options, props) { | ||
const domElementGetter = chooseDomElementGetter(options, props); | ||
if (!domElementGetter) { | ||
throw Error(`Cannot mount angular application '${props.name || props.appName}' without a domElementGetter provided either as an opt or a prop`); | ||
} | ||
const containerElement = getContainerElement(domElementGetter); | ||
containerElement.innerHTML = options.template; | ||
return containerElement; | ||
} | ||
function getContainerElement(domElementGetter) { | ||
const element = domElementGetter(); | ||
@@ -20,3 +29,3 @@ if (!element) { | ||
} | ||
export function chooseDomElementGetter(opts, props) { | ||
function chooseDomElementGetter(opts, props) { | ||
var _a; | ||
@@ -63,2 +72,2 @@ props = (_a = props === null || props === void 0 ? void 0 : props.customProps) !== null && _a !== void 0 ? _a : props; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9tLmpzIiwic291cmNlUm9vdCI6Im5nOi8vc2luZ2xlLXNwYS1hbmd1bGFyL2ludGVybmFscy8iLCJzb3VyY2VzIjpbImRvbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxNQUFNLFV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RpdicpO1xuICAgICAgZG9tRWxlbWVudC5pZCA9IGlkO1xuICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChkb21FbGVtZW50KTtcbiAgICB9XG5cbiAgICByZXR1cm4gZG9tRWxlbWVudDtcbiAgfTtcbn1cblxuZnVuY3Rpb24gaXZ5RW5hYmxlZCgpOiBib29sZWFuIHtcbiAgdHJ5IHtcbiAgICAvLyBgybVpdnlFbmFibGVkYCB2YXJpYWJsZSBpcyBleHBvc2VkIHN0YXJ0aW5nIGZyb20gdmVyc2lvbiA4LlxuICAgIC8vIFdlIHVzZSBgcmVxdWlyZWAgaGVyZSBleGNlcHQgb2YgYSBzaW5nbGUgYGltcG9ydCB7IMm1aXZ5RW5hYmxlZCB9YCBiZWNhdXNlIHRoZVxuICAgIC8vIGRldmVsb3BlciBjYW4gdXNlIEFuZ3VsYXIgdmVyc2lvbiB0aGF0IGRvZXNuJ3QgZXhwb3NlIGl0IChhbGwgdmVyc2lvbnMgPDgpLlxuICAgIC8vIFRoZSBgY2F0Y2hgIHN0YXRlbWVudCB3aWxsIGhhbmRsZSB0aG9zZSBjYXNlcy5cbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmVcbiAgICBjb25zdCB7IMm1aXZ5RW5hYmxlZCB9ID0gcmVxdWlyZSgnQGFuZ3VsYXIvY29yZScpO1xuICAgIHJldHVybiAhIcm1aXZ5RW5hYmxlZDtcbiAgfSBjYXRjaCB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG4iXX0= |
@@ -1,2 +0,3 @@ | ||
export { getContainerEl, chooseDomElementGetter, removeApplicationFromDOMIfIvyEnabled, } from './dom'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9zaW5nbGUtc3BhLWFuZ3VsYXIvaW50ZXJuYWxzLyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUNMLGNBQWMsRUFDZCxzQkFBc0IsRUFDdEIsb0NBQW9DLEdBQ3JDLE1BQU0sT0FBTyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgU2luZ2xlU3BhQW5ndWxhck9wdHMsIEJvb3RzdHJhcHBlZFNpbmdsZVNwYUFuZ3VsYXJPcHRzIH0gZnJvbSAnLi90eXBlcyc7XG5leHBvcnQge1xuICBnZXRDb250YWluZXJFbCxcbiAgY2hvb3NlRG9tRWxlbWVudEdldHRlcixcbiAgcmVtb3ZlQXBwbGljYXRpb25Gcm9tRE9NSWZJdnlFbmFibGVkLFxufSBmcm9tICcuL2RvbSc7XG4iXX0= | ||
export * from './types'; | ||
export { getContainerElementAndSetTemplate, removeApplicationFromDOMIfIvyEnabled } from './dom'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvaW50ZXJuYWxzL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLFNBQVMsQ0FBQztBQUN4QixPQUFPLEVBQUUsaUNBQWlDLEVBQUUsb0NBQW9DLEVBQUUsTUFBTSxPQUFPLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3R5cGVzJztcbmV4cG9ydCB7IGdldENvbnRhaW5lckVsZW1lbnRBbmRTZXRUZW1wbGF0ZSwgcmVtb3ZlQXBwbGljYXRpb25Gcm9tRE9NSWZJdnlFbmFibGVkIH0gZnJvbSAnLi9kb20nO1xuIl19 |
@@ -5,2 +5,2 @@ /** | ||
export * from './index'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2luZ2xlLXNwYS1hbmd1bGFyLWludGVybmFscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL3NpbmdsZS1zcGEtYW5ndWxhci9pbnRlcm5hbHMvIiwic291cmNlcyI6WyJzaW5nbGUtc3BhLWFuZ3VsYXItaW50ZXJuYWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2luZ2xlLXNwYS1hbmd1bGFyLWludGVybmFscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9pbnRlcm5hbHMvc3JjL3NpbmdsZS1zcGEtYW5ndWxhci1pbnRlcm5hbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0= |
@@ -1,1 +0,1 @@ | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9zaW5nbGUtc3BhLWFuZ3VsYXIvaW50ZXJuYWxzLyIsInNvdXJjZXMiOlsidHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlUmVmLCBUeXBlIH0gZnJvbSAnQGFuZ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Y2xhc3MuXG4gIGJvb3RzdHJhcHBlZE5nWm9uZT86IGltcG9ydCgnQGFuZ3VsYXIvY29yZScpLk5nWm9uZTtcbiAgcm91dGluZ0V2ZW50TGlzdGVuZXI/OiAoKSA9PiB2b2lkO1xuICB6b25lSWRlbnRpZmllcj86IHN0cmluZztcbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvaW50ZXJuYWxzL3NyYy90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQXBwUHJvcHMgfSBmcm9tICdzaW5nbGUtc3BhJztcbmltcG9ydCB7IE5nTW9kdWxlUmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmV4cG9ydCB0eXBlIERvbUVsZW1lbnRHZXR0ZXIgPSAoKSA9PiBIVE1MRWxlbWVudDtcblxuZXhwb3J0IGludGVyZmFjZSBCYXNlU2luZ2xlU3BhQW5ndWxhck9wdGlvbnMge1xuICB0ZW1wbGF0ZTogc3RyaW5nO1xuICBkb21FbGVtZW50R2V0dGVyPygpOiBIVE1MRWxlbWVudDtcbiAgYm9vdHN0cmFwRnVuY3Rpb24ocHJvcHM6IEFwcFByb3BzKTogUHJvbWlzZTxOZ01vZHVsZVJlZjxhbnk+Pjtcbn1cbiJdfQ== |
@@ -6,2 +6,2 @@ /** | ||
export { SingleSpaPlatformLocation as ɵa } from './src/extra-providers'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2luZ2xlLXNwYS1hbmd1bGFyLmpzIiwic291cmNlUm9vdCI6Im5nOi8vc2luZ2xlLXNwYS1hbmd1bGFyLyIsInNvdXJjZXMiOlsic2luZ2xlLXNwYS1hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUM7QUFFeEIsT0FBTyxFQUFDLHlCQUF5QixJQUFJLEVBQUUsRUFBQyxNQUFNLHVCQUF1QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcblxuZXhwb3J0IHtTaW5nbGVTcGFQbGF0Zm9ybUxvY2F0aW9uIGFzIMm1YX0gZnJvbSAnLi9zcmMvZXh0cmEtcHJvdmlkZXJzJzsiXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2luZ2xlLXNwYS1hbmd1bGFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NpbmdsZS1zcGEtYW5ndWxhci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDO0FBRXhCLE9BQU8sRUFBQyx5QkFBeUIsSUFBSSxFQUFFLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG5cbmV4cG9ydCB7U2luZ2xlU3BhUGxhdGZvcm1Mb2NhdGlvbiBhcyDJtWF9IGZyb20gJy4vc3JjL2V4dHJhLXByb3ZpZGVycyc7Il19 |
@@ -1,5 +0,4 @@ | ||
import { __decorate } from "tslib"; | ||
import { Injectable, Inject } from '@angular/core'; | ||
import { ɵBrowserPlatformLocation, PlatformLocation, DOCUMENT, } from '@angular/common'; | ||
let SingleSpaPlatformLocation = class SingleSpaPlatformLocation extends ɵBrowserPlatformLocation { | ||
export class SingleSpaPlatformLocation extends ɵBrowserPlatformLocation { | ||
constructor() { | ||
@@ -10,5 +9,21 @@ super(...arguments); | ||
this.skipNextPopState = false; | ||
this.onPopStateListeners = []; | ||
// The key here is an actual forked `Zone` of some specific application. | ||
// We will be able to find the specific zone when application gets destroyed | ||
// by application `name`. | ||
// The reason of that the `onPopState` method is invoked during `bootstrapModule` | ||
// and we can't know what application has invoked it. Why should we know the application | ||
// that has invoked `onPopState`? When application gets destroyed in a `sharing dependencies mode` | ||
// (when there is a single platform per all applications) we want to remove application | ||
// specific `popstate` listeners. E.g. if there are 2 applications: | ||
// * shop application adds `popstate` listener | ||
// * navbar application adds `popstate` listener | ||
// When shop application gets destroyed we want to remove only its `popstate` listener. | ||
this.zoneToOnPopStateListenersMap = new Map(); | ||
// This is used only to make `Zone.wrap` happy, since it requires 2 arguments | ||
// and the second argument is a unique string which `zone.js` uses for debugging purposes. | ||
// We might want to use the application name, but we're not able to get it when `onPopState` | ||
// method is called during module bootstrapping. | ||
this.source = 0; | ||
} | ||
destroy() { | ||
destroyApplication(zoneIdentifier) { | ||
// TLDR: Angular adds `popstate` event listener and then doesn't remove it when application gets destroyed. | ||
@@ -18,10 +33,15 @@ // Basically, Angular has a potentional memory leak. The `ɵBrowserPlatformLocation` | ||
// https://github.com/angular/angular/blob/14be55c9facf3e47b8c97df4502dc3f0f897da03/packages/common/src/location/platform_location.ts#L126 | ||
for (const onPopStateListener of this.onPopStateListeners) { | ||
window.removeEventListener('popstate', onPopStateListener); | ||
const zone = [...this.zoneToOnPopStateListenersMap.keys()].find( | ||
// `getZoneWith` will return a zone which defines a `key` and in our case | ||
// we define a custom key in `single-spa-angular.ts` | ||
// via this line of code: | ||
// `_properties[zoneIdentifier] = true;` | ||
zone => zone.getZoneWith(zoneIdentifier) !== null); | ||
const onPopStateListeners = this.zoneToOnPopStateListenersMap.get(zone); | ||
if (Array.isArray(onPopStateListeners)) { | ||
for (const onPopStateListener of onPopStateListeners) { | ||
window.removeEventListener('popstate', onPopStateListener); | ||
} | ||
} | ||
// We do this because the `SingleSpaPlatformLocation` is a part of PLATFORM_INJECTOR, | ||
// which means it's created only once and will not be garbage collected, since the PLATFORM_INJECTOR | ||
// will keep reference to its instance. | ||
// TODO: https://github.com/single-spa/single-spa-angular/issues/170 | ||
this.onPopStateListeners = []; | ||
this.zoneToOnPopStateListenersMap.delete(zone); | ||
} | ||
@@ -37,2 +57,12 @@ pushState(state, title, url) { | ||
onPopState(fn) { | ||
// `Zone.current` will reference the zone that serves as an execution context | ||
// to some specific application, especially when `onPopState` is called. | ||
const zone = Zone.current; | ||
// Wrap any event listener into zone that is specific to some application. | ||
// The main issue is `back/forward` buttons of browsers, because they invoke | ||
// `history.back|forward` which dispatch `popstate` event. Since `single-spa` | ||
// overrides `history.replaceState` Angular's zone cannot intercept this event. | ||
// Only the root zone is able to intercept all events. | ||
// See https://github.com/single-spa/single-spa-angular/issues/94 for more details | ||
fn = zone.wrap(fn, `${this.source++}`); | ||
const onPopStateListener = (event) => { | ||
@@ -48,24 +78,21 @@ // The `LocationChangeEvent` doesn't have the `singleSpa` property, since it's added | ||
else { | ||
// Wrap any event listener into zone that is specific to some application. | ||
// The main issue is `back/forward` buttons of browsers, because they invoke | ||
// `history.back|forward` which dispatch `popstate` event. Since `single-spa` | ||
// overrides `history.replaceState` Angular's zone cannot intercept this event. | ||
// Only the root zone is able to intercept all events. | ||
// See https://github.com/single-spa/single-spa-angular/issues/94 for more details | ||
this.ngZone.run(() => fn(event)); | ||
fn(event); | ||
} | ||
}; | ||
this.storeOnPopStateListener(zone, onPopStateListener); | ||
super.onPopState(onPopStateListener); | ||
} | ||
storeOnPopStateListener(zone, onPopStateListener) { | ||
// All listeners should be stored inside an array because the `onPopState` can be called | ||
// multiple times thus we wanna reference all listeners to remove them further. | ||
this.onPopStateListeners.push(onPopStateListener); | ||
super.onPopState(onPopStateListener); | ||
const onPopStateListeners = this.zoneToOnPopStateListenersMap.get(zone) || []; | ||
onPopStateListeners.push(onPopStateListener); | ||
if (!this.zoneToOnPopStateListenersMap.has(zone)) { | ||
this.zoneToOnPopStateListenersMap.set(zone, onPopStateListeners); | ||
} | ||
} | ||
setNgZone(ngZone) { | ||
this.ngZone = ngZone; | ||
} | ||
}; | ||
SingleSpaPlatformLocation = __decorate([ | ||
Injectable() | ||
], SingleSpaPlatformLocation); | ||
export { SingleSpaPlatformLocation }; | ||
} | ||
SingleSpaPlatformLocation.decorators = [ | ||
{ type: Injectable } | ||
]; | ||
/** | ||
@@ -89,2 +116,2 @@ * The `PlatformLocation` class is an "injectee" of the `PathLocationStrategy`, | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0cmEtcHJvdmlkZXJzLmpzIiwic291cmNlUm9vdCI6Im5nOi8vc2luZ2xlLXNwYS1hbmd1bGFyLyIsInNvdXJjZXMiOlsic3JjL2V4dHJhLXByb3ZpZGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBMEIsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNFLE9BQU8sRUFDTCx3QkFBd0IsRUFDeEIsZ0JBQWdCLEVBRWhCLFFBQVEsR0FDVCxNQUFNLGlCQUFpQixDQUFDO0FBR3pCLElBQWEseUJBQXlCLEdBQXRDLE1BQWEseUJBQTBCLFNBQVEsd0JBQXdCO0lBQXZFOztRQUdFLGlFQUFpRTtRQUNqRSwwQ0FBMEM7UUFDbEMscUJBQWdCLEdBQUcsS0FBSyxDQUFDO1FBRXpCLHdCQUFtQixHQUE2QyxFQUFFLENBQUM7SUEyRDdFLENBQUM7SUF6REMsT0FBTztRQUNMLDJHQUEyRztRQUMzRyxtRkFBbUY7UUFDbkYsc0ZBQXNGO1FBQ3RGLDBJQUEwSTtRQUUxSSxLQUFLLE1BQU0sa0JBQWtCLElBQUksSUFBSSx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y56b25lVG9PblBvcFN0YXRlTGlzdGVuZXJzTWFwLmhhcyh6b25lKSkge1xuICAgICAgdGhpcy56b25lVG9PblBvcFN0YXRlTGlzdGVuZXJzTWFwLnNldCh6b25lLCBvblBvcFN0YXRlTGlzdGVuZXJzKTtcbiAgICB9XG4gIH1cbn1cblxuLyoqXG4gKiBUaGUgYFBsYXRmb3JtTG9jYXRpb25gIGNsYXNzIGlzIGFuIFwiaW5qZWN0ZWVcIiBvZiB0aGUgYFBhdGhMb2NhdGlvblN0cmF0ZWd5YCxcbiAqIHdoaWNoIGNyZWF0ZXMgYFN1YmplY3RgIGludGVybmFsbHkgZm9yIGxpc3RlbmluZyBvbiBgcG9wc3RhdGVgIGV2ZW50cy4gV2Ugd2FudFxuICogdG8gcHJvdmlkZSB0aGlzIGNsYXNzIGluIHRoZSBtb3N0IHRvcCBpbmplY3RvciB0aGF0J3MgdXNlZCBkdXJpbmcgYm9vdHN0cmFwcGluZy5cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGdldFNpbmdsZVNwYUV4dHJhUHJvdmlkZXJzKCk6IFN0YXRpY1Byb3ZpZGVyW10ge1xuICByZXR1cm4gW1xuICAgIHtcbiAgICAgIHByb3ZpZGU6IFNpbmdsZVNwYVBsYXRmb3JtTG9jYXRpb24sXG4gICAgICB1c2VDbGFzczogU2luZ2xlU3BhUGxhdGZvcm1Mb2NhdGlvbixcbiAgICAgIGRlcHM6IFtbbmV3IEluamVjdChET0NVTUVOVCldXSxcbiAgICB9LFxuICAgIHtcbiAgICAgIHByb3ZpZGU6IFBsYXRmb3JtTG9jYXRpb24sXG4gICAgICB1c2VFeGlzdGluZzogU2luZ2xlU3BhUGxhdGZvcm1Mb2NhdGlvbixcbiAgICB9LFxuICBdO1xufVxuIl19 |
@@ -1,14 +0,12 @@ | ||
import { __decorate } from "tslib"; | ||
import { NgModule } from '@angular/core'; | ||
import { ParcelComponent } from './parcel.component'; | ||
let ParcelModule = class ParcelModule { | ||
}; | ||
ParcelModule = __decorate([ | ||
NgModule({ | ||
declarations: [ParcelComponent], | ||
exports: [ParcelComponent], | ||
entryComponents: [ParcelComponent], | ||
}) | ||
], ParcelModule); | ||
export { ParcelModule }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9zaW5nbGUtc3BhLWFuZ3VsYXIvIiwic291cmNlcyI6WyJzcmMvcGFyY2VsLWxpYi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFPckQsSUFBYSxZQUFZLEdBQXpCLE1BQWEsWUFBWTtDQUFHLENBQUE7QUFBZixZQUFZO0lBTHhCLFFBQVEsQ0FBQztRQUNSLFlBQVksRUFBRSxDQUFDLGVBQWUsQ0FBQztRQUMvQixPQUFPLEVBQUUsQ0FBQyxlQUFlLENBQUM7UUFDMUIsZUFBZSxFQUFFLENBQUMsZUFBZSxDQUFDO0tBQ25DLENBQUM7R0FDVyxZQUFZLENBQUc7U0FBZixZQUFZIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IFBhcmNlbENvbXBvbmVudCB9IGZyb20gJy4vcGFyY2VsLmNvbXBvbmVudCc7XG5cbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogW1BhcmNlbENvbXBvbmVudF0sXG4gIGV4cG9ydHM6IFtQYXJjZWxDb21wb25lbnRdLFxuICBlbnRyeUNvbXBvbmVudHM6IFtQYXJjZWxDb21wb25lbnRdLFxufSlcbmV4cG9ydCBjbGFzcyBQYXJjZWxNb2R1bGUge31cbiJdfQ== | ||
export class ParcelModule { | ||
} | ||
ParcelModule.decorators = [ | ||
{ type: NgModule, args: [{ | ||
declarations: [ParcelComponent], | ||
exports: [ParcelComponent], | ||
entryComponents: [ParcelComponent], | ||
},] } | ||
]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvc3JjL3BhcmNlbC1saWIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFPckQsTUFBTSxPQUFPLFlBQVk7OztZQUx4QixRQUFRLFNBQUM7Z0JBQ1IsWUFBWSxFQUFFLENBQUMsZUFBZSxDQUFDO2dCQUMvQixPQUFPLEVBQUUsQ0FBQyxlQUFlLENBQUM7Z0JBQzFCLGVBQWUsRUFBRSxDQUFDLGVBQWUsQ0FBQzthQUNuQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBQYXJjZWxDb21wb25lbnQgfSBmcm9tICcuL3BhcmNlbC5jb21wb25lbnQnO1xuXG5ATmdNb2R1bGUoe1xuICBkZWNsYXJhdGlvbnM6IFtQYXJjZWxDb21wb25lbnRdLFxuICBleHBvcnRzOiBbUGFyY2VsQ29tcG9uZW50XSxcbiAgZW50cnlDb21wb25lbnRzOiBbUGFyY2VsQ29tcG9uZW50XSxcbn0pXG5leHBvcnQgY2xhc3MgUGFyY2VsTW9kdWxlIHt9XG4iXX0= |
@@ -1,4 +0,3 @@ | ||
import { __decorate } from "tslib"; | ||
import { Component, OnInit, OnDestroy, Input, OnChanges, ElementRef } from '@angular/core'; | ||
let ParcelComponent = class ParcelComponent { | ||
import { Component, Input, ElementRef } from '@angular/core'; | ||
export class ParcelComponent { | ||
// eslint-disable-next-line @typescript-eslint/no-parameter-properties | ||
@@ -96,34 +95,21 @@ constructor(host) { | ||
} | ||
}; | ||
} | ||
ParcelComponent.decorators = [ | ||
{ type: Component, args: [{ | ||
selector: 'parcel', | ||
template: '<div></div>' | ||
},] } | ||
]; | ||
ParcelComponent.ctorParameters = () => [ | ||
{ type: ElementRef } | ||
]; | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "config", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "mountParcel", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "onParcelMount", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "wrapWith", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "customProps", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "appendTo", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "handleError", void 0); | ||
ParcelComponent = __decorate([ | ||
Component({ | ||
selector: 'parcel', | ||
template: '<div></div>' | ||
}) | ||
], ParcelComponent); | ||
export { ParcelComponent }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyY2VsLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL3NpbmdsZS1zcGEtYW5ndWxhci8iLCJzb3VyY2VzIjpbInNyYy9wYXJjZWwtbGliL3BhcmNlbC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQU8zRixJQUFhLGVBQWUsR0FBNUIsTUFBYSxlQUFlO0lBZTFCLHNFQUFzR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47XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpbmcoLi4uYXJncyk7XG4gICAgICB9KVxuICAgICAgLmNhdGNoKGVycm9yID0+IHtcbiAgICAgICAgdGhpcy5uZXh0VGhpbmdUb0RvID0gUHJvbWlzZS5yZXNvbHZlKCk7IC8vIHJlc2V0IHNvIHdlIGRvbid0IC50aGVuKCkgdGhlIGJhZCBwcm9taXNlIGFnYWluXG4gICAgICAgIHRoaXMuaGFzRXJyb3IgPSB0cnVlO1xuXG4gICAgICAgIGlmIChlcnJvciAmJiBlcnJvci5tZXNzYWdlKSB7XG4gICAgICAgICAgZXJyb3IubWVzc2FnZSA9IGBEdXJpbmcgJyR7YWN0aW9ufScsIHBhcmNlbCB0aHJldyBhbiBlcnJvcjogJHtlcnJvci5tZXNzYWdlfWA7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMuaGFuZGxlRXJyb3IgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICB0aGlzLmhhbmRsZUVycm9yKGVycm9yKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgIHRocm93IGVycm9yO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gTm8gbW9yZSB0aGluZ3MgdG8gZG8gc2hvdWxkIGJlIGRvbmUgLS0gdGhlIHBhcmNlbCBpcyBpbiBhbiBlcnJvciBzdGF0ZVxuICAgICAgICB0aHJvdyBlcnJvcjtcbiAgICAgIH0pO1xuICB9XG59XG4iXX0= | ||
ParcelComponent.propDecorators = { | ||
config: [{ type: Input }], | ||
mountParcel: [{ type: Input }], | ||
onParcelMount: [{ type: Input }], | ||
wrapWith: [{ type: Input }], | ||
customProps: [{ type: Input }], | ||
appendTo: [{ type: Input }], | ||
handleError: [{ type: Input }] | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJm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SB7XG4gICAgICAgICAgLy8gTmV2ZXIgZG8gYW55dGhpbmcgb25jZSB0aGUgYW5ndWxhciBjb21wb25lbnQgdW5tb3VudHNcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpbmcoLi4uYXJncyk7XG4gICAgICB9KVxuICAgICAgLmNhdGNoKGVycm9yID0+IHtcbiAgICAgICAgdGhpcy5uZXh0VGhpbmdUb0RvID0gUHJvbWlzZS5yZXNvbHZlKCk7IC8vIHJlc2V0IHNvIHdlIGRvbid0IC50aGVuKCkgdGhlIGJhZCBwcm9taXNlIGFnYWluXG4gICAgICAgIHRoaXMuaGFzRXJyb3IgPSB0cnVlO1xuXG4gICAgICAgIGlmIChlcnJvciAmJiBlcnJvci5tZXNzYWdlKSB7XG4gICAgICAgICAgZXJyb3IubWVzc2FnZSA9IGBEdXJpbmcgJyR7YWN0aW9ufScsIHBhcmNlbCB0aHJldyBhbiBlcnJvcjogJHtlcnJvci5tZXNzYWdlfWA7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMuaGFuZGxlRXJyb3IgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICB0aGlzLmhhbmRsZUVycm9yKGVycm9yKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgIHRocm93IGVycm9yO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gTm8gbW9yZSB0aGluZ3MgdG8gZG8gc2hvdWxkIGJlIGRvbmUgLS0gdGhlIHBhcmNlbCBpcyBpbiBhbiBlcnJvciBzdGF0ZVxuICAgICAgICB0aHJvdyBlcnJvcjtcbiAgICAgIH0pO1xuICB9XG59XG4iXX0= |
@@ -5,2 +5,2 @@ export { singleSpaAngular } from './single-spa-angular'; | ||
export { ParcelComponent } from './parcel-lib/parcel.component'; | ||
//# sourceMappingURL=data:application/json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QkFBbUIsQ0FBQztBQUMvRCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDbEQsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLCtCQUErQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgc2luZ2xlU3BhQW5ndWxhciB9IGZyb20gJy4vc2luZ2xlLXNwYS1hbmd1bGFyJztcbmV4cG9ydCB7IGdldFNpbmdsZVNwYUV4dHJhUHJvdmlkZXJzIH0gZnJvbSAnLi9leHRyYS1wcm92aWRlcnMnO1xuZXhwb3J0IHsgUGFyY2VsTW9kdWxlIH0gZnJvbSAnLi9wYXJjZWwtbGliL2luZGV4JztcbmV4cG9ydCB7IFBhcmNlbENvbXBvbmVudCB9IGZyb20gJy4vcGFyY2VsLWxpYi9wYXJjZWwuY29tcG9uZW50JztcbiJdfQ== |
import { __awaiter } from "tslib"; | ||
import { getContainerEl, chooseDomElementGetter, removeApplicationFromDOMIfIvyEnabled, } from 'single-spa-angular/internals'; | ||
import { getContainerElementAndSetTemplate, removeApplicationFromDOMIfIvyEnabled, } from 'single-spa-angular/internals'; | ||
import { SingleSpaPlatformLocation } from './extra-providers'; | ||
const defaultOpts = { | ||
// Required opts that will be set by the library consumer. | ||
const defaultOptions = { | ||
// Required options that will be set by the library consumer. | ||
NgZone: null, | ||
bootstrapFunction: null, | ||
template: null, | ||
// optional opts | ||
// Optional options | ||
Router: undefined, | ||
@@ -15,24 +15,24 @@ domElementGetter: undefined, | ||
}; | ||
export function singleSpaAngular(userOpts) { | ||
if (typeof userOpts !== 'object') { | ||
export function singleSpaAngular(userOptions) { | ||
if (typeof userOptions !== 'object') { | ||
throw Error('single-spa-angular requires a configuration object'); | ||
} | ||
const opts = Object.assign(Object.assign({}, defaultOpts), userOpts); | ||
if (typeof opts.bootstrapFunction !== 'function') { | ||
throw Error('single-spa-angular must be passed an opts.bootstrapFunction'); | ||
const options = Object.assign(Object.assign({}, defaultOptions), userOptions); | ||
if (typeof options.bootstrapFunction !== 'function') { | ||
throw Error('single-spa-angular must be passed an options.bootstrapFunction'); | ||
} | ||
if (typeof opts.template !== 'string') { | ||
throw Error('single-spa-angular must be passed opts.template string'); | ||
if (typeof options.template !== 'string') { | ||
throw Error('single-spa-angular must be passed options.template string'); | ||
} | ||
if (!opts.NgZone) { | ||
throw Error(`single-spa-angular must be passed the NgZone opt`); | ||
if (!options.NgZone) { | ||
throw Error(`single-spa-angular must be passed the NgZone option`); | ||
} | ||
return { | ||
bootstrap: bootstrap.bind(null, opts), | ||
mount: mount.bind(null, opts), | ||
unmount: unmount.bind(null, opts), | ||
update: opts.updateFunction, | ||
bootstrap: bootstrap.bind(null, options), | ||
mount: mount.bind(null, options), | ||
unmount: unmount.bind(null, options), | ||
update: options.updateFunction, | ||
}; | ||
} | ||
function bootstrap(opts, props) { | ||
function bootstrap(options, props) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -42,7 +42,7 @@ // Angular provides an opportunity to develop `zone-less` application, where developers | ||
// See https://angular.io/guide/zone#noopzone | ||
if (opts.NgZone === 'noop') { | ||
if (options.NgZone === 'noop') { | ||
return; | ||
} | ||
// In order for multiple Angular apps to work concurrently on a page, they each need a unique identifier. | ||
opts.zoneIdentifier = `single-spa-angular:${props.name || props.appName}`; | ||
options.zoneIdentifier = `single-spa-angular:${props.name || props.appName}`; | ||
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone. | ||
@@ -53,8 +53,8 @@ // See https://github.com/PlaceMe-SAS/single-spa-angular-cli/issues/33, | ||
// and https://github.com/angular/angular/blob/a14dc2d7a4821a19f20a9547053a5734798f541e/packages/core/src/zone/ng_zone.ts#L257 | ||
opts.NgZone.isInAngularZone = function () { | ||
options.NgZone.isInAngularZone = () => { | ||
// @ts-ignore | ||
return window.Zone.current._properties[opts.zoneIdentifier] === true; | ||
return window.Zone.current._properties[options.zoneIdentifier] === true; | ||
}; | ||
opts.routingEventListener = () => { | ||
opts.bootstrappedNgZone.run(() => { | ||
options.routingEventListener = () => { | ||
options.bootstrappedNgZone.run(() => { | ||
// See https://github.com/single-spa/single-spa-angular/issues/86 | ||
@@ -67,20 +67,15 @@ // Zone is unaware of the single-spa navigation change and so Angular change detection doesn't work | ||
} | ||
function mount(opts, props) { | ||
function mount(options, props) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const domElementGetter = chooseDomElementGetter(opts, props); | ||
if (!domElementGetter) { | ||
throw Error(`cannot mount angular application '${props.name || props.appName}' without a domElementGetter provided either as an opt or a prop`); | ||
} | ||
const containerEl = getContainerEl(domElementGetter); | ||
containerEl.innerHTML = opts.template; | ||
const bootstrapPromise = opts.bootstrapFunction(props); | ||
getContainerElementAndSetTemplate(options, props); | ||
const bootstrapPromise = options.bootstrapFunction(props); | ||
if (!(bootstrapPromise instanceof Promise)) { | ||
throw Error(`single-spa-angular: the opts.bootstrapFunction must return a promise, but instead returned a '${typeof bootstrapPromise}' that is not a Promise`); | ||
throw Error(`single-spa-angular: the options.bootstrapFunction must return a promise, but instead returned a '${typeof bootstrapPromise}' that is not a Promise`); | ||
} | ||
const module = yield bootstrapPromise; | ||
if (!module || typeof module.destroy !== 'function') { | ||
throw Error(`single-spa-angular: the opts.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?`); | ||
throw Error(`single-spa-angular: the options.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?`); | ||
} | ||
const singleSpaPlatformLocation = module.injector.get(SingleSpaPlatformLocation, null); | ||
const ngZoneEnabled = opts.NgZone !== 'noop'; | ||
const ngZoneEnabled = options.NgZone !== 'noop'; | ||
// The user has to provide `BrowserPlatformLocation` only if his application uses routing. | ||
@@ -90,3 +85,3 @@ // So if he provided `Router` but didn't provide `BrowserPlatformLocation` then we have to inform him. | ||
// `zone-less` change detection, if `NgZone` is `noop` then we can skip it. | ||
if (ngZoneEnabled && opts.Router && singleSpaPlatformLocation === null) { | ||
if (ngZoneEnabled && options.Router && singleSpaPlatformLocation === null) { | ||
throw new Error(` | ||
@@ -96,18 +91,18 @@ single-spa-angular: could not retrieve extra providers from the platform injector. Did you call platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule()? | ||
} | ||
const bootstrappedOpts = opts; | ||
const bootstrappedOptions = options; | ||
if (ngZoneEnabled) { | ||
const ngZone = module.injector.get(opts.NgZone); | ||
const ngZone = module.injector.get(options.NgZone); | ||
const zoneIdentifier = bootstrappedOptions.zoneIdentifier; | ||
// `NgZone` can be enabled but routing may not be used thus `getSingleSpaExtraProviders()` | ||
// function was not called. | ||
if (singleSpaPlatformLocation !== null) { | ||
singleSpaPlatformLocation.setNgZone(ngZone); | ||
// Cleanup resources, especially remove event listeners thus they will not be added | ||
// twice when application gets bootstrapped the second time. | ||
module.onDestroy(() => singleSpaPlatformLocation.destroy()); | ||
module.onDestroy(() => singleSpaPlatformLocation.destroyApplication(zoneIdentifier)); | ||
} | ||
bootstrappedOpts.bootstrappedNgZone = ngZone; | ||
bootstrappedOpts.bootstrappedNgZone['_inner']._properties[bootstrappedOpts.zoneIdentifier] = true; | ||
window.addEventListener('single-spa:routing-event', bootstrappedOpts.routingEventListener); | ||
bootstrappedOptions.bootstrappedNgZone = ngZone; | ||
bootstrappedOptions.bootstrappedNgZone['_inner']._properties[zoneIdentifier] = true; | ||
window.addEventListener('single-spa:routing-event', bootstrappedOptions.routingEventListener); | ||
} | ||
bootstrappedOpts.bootstrappedModule = module; | ||
bootstrappedOptions.bootstrappedModule = module; | ||
return module; | ||
@@ -117,13 +112,13 @@ }); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function unmount(opts, props) { | ||
function unmount(options, props) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (opts.Router) { | ||
if (options.Router) { | ||
// Workaround for https://github.com/angular/angular/issues/19079 | ||
const router = opts.bootstrappedModule.injector.get(opts.Router); | ||
const router = options.bootstrappedModule.injector.get(options.Router); | ||
router.dispose(); | ||
} | ||
if (opts.routingEventListener) { | ||
window.removeEventListener('single-spa:routing-event', opts.routingEventListener); | ||
if (options.routingEventListener) { | ||
window.removeEventListener('single-spa:routing-event', options.routingEventListener); | ||
} | ||
if (opts.AnimationEngine) { | ||
if (options.AnimationEngine) { | ||
/* | ||
@@ -153,12 +148,12 @@ The BrowserAnimationsModule does not clean up after itself :'(. When you unmount/destroy the main module, the | ||
*/ | ||
const animationEngine = opts.bootstrappedModule.injector.get(opts.AnimationEngine); | ||
const animationEngine = options.bootstrappedModule.injector.get(options.AnimationEngine); | ||
animationEngine._transitionEngine.flush(); | ||
} | ||
opts.bootstrappedModule.destroy(); | ||
delete opts.bootstrappedModule; | ||
options.bootstrappedModule.destroy(); | ||
delete options.bootstrappedModule; | ||
// This is an issue. Issue has been created and Angular team is working on the fix: | ||
// https://github.com/angular/angular/issues/36449 | ||
removeApplicationFromDOMIfIvyEnabled(opts, props); | ||
removeApplicationFromDOMIfIvyEnabled(options, props); | ||
}); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2luZ2xlLXNwYS1hbmd1bGFyLmpzIiwic291cmNlUm9vdCI6Im5nOi8vc2luZ2xlLXNwYS1hbmd1bGFyLyIsInNvdXJjZXMiOlsic3JjL3NpbmdsZS1zcGEtYW5ndWxhci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsT0FBTyxFQUNMLGNBQWMsRUFDZCxzQkFBc0IsRUFDdEIsb0NBQW9DLEdBR3JDLE1BQU0sOEJBQThCLENBQUM7QUFFdEMsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFOUQsTUFBTSxXQUFXLEdBQUc7SUFDbEIsMERBQTBEO0lBQzFELE1BQU0sRUFBRSxJQUFLO0lBQ2IsaUJBQWlCLEVBQUUsSUFBSztJQUN4QixRQUFRLEVBQUUsSUF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ucy5ib290c3RyYXBwZWRNb2R1bGUuaW5qZWN0b3IuZ2V0KG9wdGlvbnMuQW5pbWF0aW9uRW5naW5lKTtcbiAgICBhbmltYXRpb25FbmdpbmUuX3RyYW5zaXRpb25FbmdpbmUuZmx1c2goKTtcbiAgfVxuXG4gIG9wdGlvbnMuYm9vdHN0cmFwcGVkTW9kdWxlLmRlc3Ryb3koKTtcbiAgZGVsZXRlIG9wdGlvbnMuYm9vdHN0cmFwcGVkTW9kdWxlO1xuXG4gIC8vIFRoaXMgaXMgYW4gaXNzdWUuIElzc3VlIGhhcyBiZWVuIGNyZWF0ZWQgYW5kIEFuZ3VsYXIgdGVhbSBpcyB3b3JraW5nIG9uIHRoZSBmaXg6XG4gIC8vIGh0dHBzOi8vZ2l0aHViLmNvbS9hbmd1bGFyL2FuZ3VsYXIvaXNzdWVzLzM2NDQ5XG4gIHJlbW92ZUFwcGxpY2F0aW9uRnJvbURPTUlmSXZ5RW5hYmxlZChvcHRpb25zLCBwcm9wcyk7XG59XG4iXX0= |
@@ -1,5 +0,5 @@ | ||
function removeApplicationFromDOMIfIvyEnabled(opts, props) { | ||
function removeApplicationFromDOMIfIvyEnabled(options, props) { | ||
if (ivyEnabled()) { | ||
const domElementGetter = chooseDomElementGetter(opts, props); | ||
const domElement = getContainerEl(domElementGetter); | ||
const domElementGetter = chooseDomElementGetter(options, props); | ||
const domElement = getContainerElement(domElementGetter); | ||
// View Engine removes all nodes automatically when calling `NgModuleRef.destroy()`, | ||
@@ -12,3 +12,12 @@ // which calls `ComponentRef.destroy()`. | ||
} | ||
function getContainerEl(domElementGetter) { | ||
function getContainerElementAndSetTemplate(options, props) { | ||
const domElementGetter = chooseDomElementGetter(options, props); | ||
if (!domElementGetter) { | ||
throw Error(`Cannot mount angular application '${props.name || props.appName}' without a domElementGetter provided either as an opt or a prop`); | ||
} | ||
const containerElement = getContainerElement(domElementGetter); | ||
containerElement.innerHTML = options.template; | ||
return containerElement; | ||
} | ||
function getContainerElement(domElementGetter) { | ||
const element = domElementGetter(); | ||
@@ -67,3 +76,3 @@ if (!element) { | ||
export { chooseDomElementGetter, getContainerEl, removeApplicationFromDOMIfIvyEnabled }; | ||
export { getContainerElementAndSetTemplate, removeApplicationFromDOMIfIvyEnabled }; | ||
//# sourceMappingURL=single-spa-angular-internals.js.map |
@@ -1,7 +0,7 @@ | ||
import { __decorate, __awaiter } from 'tslib'; | ||
import { chooseDomElementGetter, getContainerEl, removeApplicationFromDOMIfIvyEnabled } from 'single-spa-angular/internals'; | ||
import { Injectable, Inject, ElementRef, Input, Component, NgModule } from '@angular/core'; | ||
import { __awaiter } from 'tslib'; | ||
import { getContainerElementAndSetTemplate, removeApplicationFromDOMIfIvyEnabled } from 'single-spa-angular/internals'; | ||
import { Injectable, Inject, Component, ElementRef, Input, NgModule } from '@angular/core'; | ||
import { ɵBrowserPlatformLocation, DOCUMENT, PlatformLocation } from '@angular/common'; | ||
let SingleSpaPlatformLocation = class SingleSpaPlatformLocation extends ɵBrowserPlatformLocation { | ||
class SingleSpaPlatformLocation extends ɵBrowserPlatformLocation { | ||
constructor() { | ||
@@ -12,5 +12,21 @@ super(...arguments); | ||
this.skipNextPopState = false; | ||
this.onPopStateListeners = []; | ||
// The key here is an actual forked `Zone` of some specific application. | ||
// We will be able to find the specific zone when application gets destroyed | ||
// by application `name`. | ||
// The reason of that the `onPopState` method is invoked during `bootstrapModule` | ||
// and we can't know what application has invoked it. Why should we know the application | ||
// that has invoked `onPopState`? When application gets destroyed in a `sharing dependencies mode` | ||
// (when there is a single platform per all applications) we want to remove application | ||
// specific `popstate` listeners. E.g. if there are 2 applications: | ||
// * shop application adds `popstate` listener | ||
// * navbar application adds `popstate` listener | ||
// When shop application gets destroyed we want to remove only its `popstate` listener. | ||
this.zoneToOnPopStateListenersMap = new Map(); | ||
// This is used only to make `Zone.wrap` happy, since it requires 2 arguments | ||
// and the second argument is a unique string which `zone.js` uses for debugging purposes. | ||
// We might want to use the application name, but we're not able to get it when `onPopState` | ||
// method is called during module bootstrapping. | ||
this.source = 0; | ||
} | ||
destroy() { | ||
destroyApplication(zoneIdentifier) { | ||
// TLDR: Angular adds `popstate` event listener and then doesn't remove it when application gets destroyed. | ||
@@ -20,10 +36,15 @@ // Basically, Angular has a potentional memory leak. The `ɵBrowserPlatformLocation` | ||
// https://github.com/angular/angular/blob/14be55c9facf3e47b8c97df4502dc3f0f897da03/packages/common/src/location/platform_location.ts#L126 | ||
for (const onPopStateListener of this.onPopStateListeners) { | ||
window.removeEventListener('popstate', onPopStateListener); | ||
const zone = [...this.zoneToOnPopStateListenersMap.keys()].find( | ||
// `getZoneWith` will return a zone which defines a `key` and in our case | ||
// we define a custom key in `single-spa-angular.ts` | ||
// via this line of code: | ||
// `_properties[zoneIdentifier] = true;` | ||
zone => zone.getZoneWith(zoneIdentifier) !== null); | ||
const onPopStateListeners = this.zoneToOnPopStateListenersMap.get(zone); | ||
if (Array.isArray(onPopStateListeners)) { | ||
for (const onPopStateListener of onPopStateListeners) { | ||
window.removeEventListener('popstate', onPopStateListener); | ||
} | ||
} | ||
// We do this because the `SingleSpaPlatformLocation` is a part of PLATFORM_INJECTOR, | ||
// which means it's created only once and will not be garbage collected, since the PLATFORM_INJECTOR | ||
// will keep reference to its instance. | ||
// TODO: https://github.com/single-spa/single-spa-angular/issues/170 | ||
this.onPopStateListeners = []; | ||
this.zoneToOnPopStateListenersMap.delete(zone); | ||
} | ||
@@ -39,2 +60,12 @@ pushState(state, title, url) { | ||
onPopState(fn) { | ||
// `Zone.current` will reference the zone that serves as an execution context | ||
// to some specific application, especially when `onPopState` is called. | ||
const zone = Zone.current; | ||
// Wrap any event listener into zone that is specific to some application. | ||
// The main issue is `back/forward` buttons of browsers, because they invoke | ||
// `history.back|forward` which dispatch `popstate` event. Since `single-spa` | ||
// overrides `history.replaceState` Angular's zone cannot intercept this event. | ||
// Only the root zone is able to intercept all events. | ||
// See https://github.com/single-spa/single-spa-angular/issues/94 for more details | ||
fn = zone.wrap(fn, `${this.source++}`); | ||
const onPopStateListener = (event) => { | ||
@@ -50,23 +81,21 @@ // The `LocationChangeEvent` doesn't have the `singleSpa` property, since it's added | ||
else { | ||
// Wrap any event listener into zone that is specific to some application. | ||
// The main issue is `back/forward` buttons of browsers, because they invoke | ||
// `history.back|forward` which dispatch `popstate` event. Since `single-spa` | ||
// overrides `history.replaceState` Angular's zone cannot intercept this event. | ||
// Only the root zone is able to intercept all events. | ||
// See https://github.com/single-spa/single-spa-angular/issues/94 for more details | ||
this.ngZone.run(() => fn(event)); | ||
fn(event); | ||
} | ||
}; | ||
this.storeOnPopStateListener(zone, onPopStateListener); | ||
super.onPopState(onPopStateListener); | ||
} | ||
storeOnPopStateListener(zone, onPopStateListener) { | ||
// All listeners should be stored inside an array because the `onPopState` can be called | ||
// multiple times thus we wanna reference all listeners to remove them further. | ||
this.onPopStateListeners.push(onPopStateListener); | ||
super.onPopState(onPopStateListener); | ||
const onPopStateListeners = this.zoneToOnPopStateListenersMap.get(zone) || []; | ||
onPopStateListeners.push(onPopStateListener); | ||
if (!this.zoneToOnPopStateListenersMap.has(zone)) { | ||
this.zoneToOnPopStateListenersMap.set(zone, onPopStateListeners); | ||
} | ||
} | ||
setNgZone(ngZone) { | ||
this.ngZone = ngZone; | ||
} | ||
}; | ||
SingleSpaPlatformLocation = __decorate([ | ||
Injectable() | ||
], SingleSpaPlatformLocation); | ||
} | ||
SingleSpaPlatformLocation.decorators = [ | ||
{ type: Injectable } | ||
]; | ||
/** | ||
@@ -91,8 +120,8 @@ * The `PlatformLocation` class is an "injectee" of the `PathLocationStrategy`, | ||
const defaultOpts = { | ||
// Required opts that will be set by the library consumer. | ||
const defaultOptions = { | ||
// Required options that will be set by the library consumer. | ||
NgZone: null, | ||
bootstrapFunction: null, | ||
template: null, | ||
// optional opts | ||
// Optional options | ||
Router: undefined, | ||
@@ -103,24 +132,24 @@ domElementGetter: undefined, | ||
}; | ||
function singleSpaAngular(userOpts) { | ||
if (typeof userOpts !== 'object') { | ||
function singleSpaAngular(userOptions) { | ||
if (typeof userOptions !== 'object') { | ||
throw Error('single-spa-angular requires a configuration object'); | ||
} | ||
const opts = Object.assign(Object.assign({}, defaultOpts), userOpts); | ||
if (typeof opts.bootstrapFunction !== 'function') { | ||
throw Error('single-spa-angular must be passed an opts.bootstrapFunction'); | ||
const options = Object.assign(Object.assign({}, defaultOptions), userOptions); | ||
if (typeof options.bootstrapFunction !== 'function') { | ||
throw Error('single-spa-angular must be passed an options.bootstrapFunction'); | ||
} | ||
if (typeof opts.template !== 'string') { | ||
throw Error('single-spa-angular must be passed opts.template string'); | ||
if (typeof options.template !== 'string') { | ||
throw Error('single-spa-angular must be passed options.template string'); | ||
} | ||
if (!opts.NgZone) { | ||
throw Error(`single-spa-angular must be passed the NgZone opt`); | ||
if (!options.NgZone) { | ||
throw Error(`single-spa-angular must be passed the NgZone option`); | ||
} | ||
return { | ||
bootstrap: bootstrap.bind(null, opts), | ||
mount: mount.bind(null, opts), | ||
unmount: unmount.bind(null, opts), | ||
update: opts.updateFunction, | ||
bootstrap: bootstrap.bind(null, options), | ||
mount: mount.bind(null, options), | ||
unmount: unmount.bind(null, options), | ||
update: options.updateFunction, | ||
}; | ||
} | ||
function bootstrap(opts, props) { | ||
function bootstrap(options, props) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -130,7 +159,7 @@ // Angular provides an opportunity to develop `zone-less` application, where developers | ||
// See https://angular.io/guide/zone#noopzone | ||
if (opts.NgZone === 'noop') { | ||
if (options.NgZone === 'noop') { | ||
return; | ||
} | ||
// In order for multiple Angular apps to work concurrently on a page, they each need a unique identifier. | ||
opts.zoneIdentifier = `single-spa-angular:${props.name || props.appName}`; | ||
options.zoneIdentifier = `single-spa-angular:${props.name || props.appName}`; | ||
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone. | ||
@@ -141,8 +170,8 @@ // See https://github.com/PlaceMe-SAS/single-spa-angular-cli/issues/33, | ||
// and https://github.com/angular/angular/blob/a14dc2d7a4821a19f20a9547053a5734798f541e/packages/core/src/zone/ng_zone.ts#L257 | ||
opts.NgZone.isInAngularZone = function () { | ||
options.NgZone.isInAngularZone = () => { | ||
// @ts-ignore | ||
return window.Zone.current._properties[opts.zoneIdentifier] === true; | ||
return window.Zone.current._properties[options.zoneIdentifier] === true; | ||
}; | ||
opts.routingEventListener = () => { | ||
opts.bootstrappedNgZone.run(() => { | ||
options.routingEventListener = () => { | ||
options.bootstrappedNgZone.run(() => { | ||
// See https://github.com/single-spa/single-spa-angular/issues/86 | ||
@@ -155,20 +184,15 @@ // Zone is unaware of the single-spa navigation change and so Angular change detection doesn't work | ||
} | ||
function mount(opts, props) { | ||
function mount(options, props) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const domElementGetter = chooseDomElementGetter(opts, props); | ||
if (!domElementGetter) { | ||
throw Error(`cannot mount angular application '${props.name || props.appName}' without a domElementGetter provided either as an opt or a prop`); | ||
} | ||
const containerEl = getContainerEl(domElementGetter); | ||
containerEl.innerHTML = opts.template; | ||
const bootstrapPromise = opts.bootstrapFunction(props); | ||
getContainerElementAndSetTemplate(options, props); | ||
const bootstrapPromise = options.bootstrapFunction(props); | ||
if (!(bootstrapPromise instanceof Promise)) { | ||
throw Error(`single-spa-angular: the opts.bootstrapFunction must return a promise, but instead returned a '${typeof bootstrapPromise}' that is not a Promise`); | ||
throw Error(`single-spa-angular: the options.bootstrapFunction must return a promise, but instead returned a '${typeof bootstrapPromise}' that is not a Promise`); | ||
} | ||
const module = yield bootstrapPromise; | ||
if (!module || typeof module.destroy !== 'function') { | ||
throw Error(`single-spa-angular: the opts.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?`); | ||
throw Error(`single-spa-angular: the options.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?`); | ||
} | ||
const singleSpaPlatformLocation = module.injector.get(SingleSpaPlatformLocation, null); | ||
const ngZoneEnabled = opts.NgZone !== 'noop'; | ||
const ngZoneEnabled = options.NgZone !== 'noop'; | ||
// The user has to provide `BrowserPlatformLocation` only if his application uses routing. | ||
@@ -178,3 +202,3 @@ // So if he provided `Router` but didn't provide `BrowserPlatformLocation` then we have to inform him. | ||
// `zone-less` change detection, if `NgZone` is `noop` then we can skip it. | ||
if (ngZoneEnabled && opts.Router && singleSpaPlatformLocation === null) { | ||
if (ngZoneEnabled && options.Router && singleSpaPlatformLocation === null) { | ||
throw new Error(` | ||
@@ -184,18 +208,18 @@ single-spa-angular: could not retrieve extra providers from the platform injector. Did you call platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule()? | ||
} | ||
const bootstrappedOpts = opts; | ||
const bootstrappedOptions = options; | ||
if (ngZoneEnabled) { | ||
const ngZone = module.injector.get(opts.NgZone); | ||
const ngZone = module.injector.get(options.NgZone); | ||
const zoneIdentifier = bootstrappedOptions.zoneIdentifier; | ||
// `NgZone` can be enabled but routing may not be used thus `getSingleSpaExtraProviders()` | ||
// function was not called. | ||
if (singleSpaPlatformLocation !== null) { | ||
singleSpaPlatformLocation.setNgZone(ngZone); | ||
// Cleanup resources, especially remove event listeners thus they will not be added | ||
// twice when application gets bootstrapped the second time. | ||
module.onDestroy(() => singleSpaPlatformLocation.destroy()); | ||
module.onDestroy(() => singleSpaPlatformLocation.destroyApplication(zoneIdentifier)); | ||
} | ||
bootstrappedOpts.bootstrappedNgZone = ngZone; | ||
bootstrappedOpts.bootstrappedNgZone['_inner']._properties[bootstrappedOpts.zoneIdentifier] = true; | ||
window.addEventListener('single-spa:routing-event', bootstrappedOpts.routingEventListener); | ||
bootstrappedOptions.bootstrappedNgZone = ngZone; | ||
bootstrappedOptions.bootstrappedNgZone['_inner']._properties[zoneIdentifier] = true; | ||
window.addEventListener('single-spa:routing-event', bootstrappedOptions.routingEventListener); | ||
} | ||
bootstrappedOpts.bootstrappedModule = module; | ||
bootstrappedOptions.bootstrappedModule = module; | ||
return module; | ||
@@ -205,13 +229,13 @@ }); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
function unmount(opts, props) { | ||
function unmount(options, props) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (opts.Router) { | ||
if (options.Router) { | ||
// Workaround for https://github.com/angular/angular/issues/19079 | ||
const router = opts.bootstrappedModule.injector.get(opts.Router); | ||
const router = options.bootstrappedModule.injector.get(options.Router); | ||
router.dispose(); | ||
} | ||
if (opts.routingEventListener) { | ||
window.removeEventListener('single-spa:routing-event', opts.routingEventListener); | ||
if (options.routingEventListener) { | ||
window.removeEventListener('single-spa:routing-event', options.routingEventListener); | ||
} | ||
if (opts.AnimationEngine) { | ||
if (options.AnimationEngine) { | ||
/* | ||
@@ -241,14 +265,14 @@ The BrowserAnimationsModule does not clean up after itself :'(. When you unmount/destroy the main module, the | ||
*/ | ||
const animationEngine = opts.bootstrappedModule.injector.get(opts.AnimationEngine); | ||
const animationEngine = options.bootstrappedModule.injector.get(options.AnimationEngine); | ||
animationEngine._transitionEngine.flush(); | ||
} | ||
opts.bootstrappedModule.destroy(); | ||
delete opts.bootstrappedModule; | ||
options.bootstrappedModule.destroy(); | ||
delete options.bootstrappedModule; | ||
// This is an issue. Issue has been created and Angular team is working on the fix: | ||
// https://github.com/angular/angular/issues/36449 | ||
removeApplicationFromDOMIfIvyEnabled(opts, props); | ||
removeApplicationFromDOMIfIvyEnabled(options, props); | ||
}); | ||
} | ||
let ParcelComponent = class ParcelComponent { | ||
class ParcelComponent { | ||
// eslint-disable-next-line @typescript-eslint/no-parameter-properties | ||
@@ -346,44 +370,32 @@ constructor(host) { | ||
} | ||
}; | ||
} | ||
ParcelComponent.decorators = [ | ||
{ type: Component, args: [{ | ||
selector: 'parcel', | ||
template: '<div></div>' | ||
},] } | ||
]; | ||
ParcelComponent.ctorParameters = () => [ | ||
{ type: ElementRef } | ||
]; | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "config", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "mountParcel", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "onParcelMount", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "wrapWith", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "customProps", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "appendTo", void 0); | ||
__decorate([ | ||
Input() | ||
], ParcelComponent.prototype, "handleError", void 0); | ||
ParcelComponent = __decorate([ | ||
Component({ | ||
selector: 'parcel', | ||
template: '<div></div>' | ||
}) | ||
], ParcelComponent); | ||
let ParcelModule = class ParcelModule { | ||
ParcelComponent.propDecorators = { | ||
config: [{ type: Input }], | ||
mountParcel: [{ type: Input }], | ||
onParcelMount: [{ type: Input }], | ||
wrapWith: [{ type: Input }], | ||
customProps: [{ type: Input }], | ||
appendTo: [{ type: Input }], | ||
handleError: [{ type: Input }] | ||
}; | ||
ParcelModule = __decorate([ | ||
NgModule({ | ||
declarations: [ParcelComponent], | ||
exports: [ParcelComponent], | ||
entryComponents: [ParcelComponent], | ||
}) | ||
], ParcelModule); | ||
class ParcelModule { | ||
} | ||
ParcelModule.decorators = [ | ||
{ type: NgModule, args: [{ | ||
declarations: [ParcelComponent], | ||
exports: [ParcelComponent], | ||
entryComponents: [ParcelComponent], | ||
},] } | ||
]; | ||
/** | ||
@@ -390,0 +402,0 @@ * The public api for consumers of single-spa-angular |
@@ -1,4 +0,3 @@ | ||
import { SingleSpaAngularOpts, DomElementGetter } from './types'; | ||
export declare function removeApplicationFromDOMIfIvyEnabled(opts: SingleSpaAngularOpts, props: any): void; | ||
export declare function getContainerEl(domElementGetter: DomElementGetter): never | HTMLElement; | ||
export declare function chooseDomElementGetter(opts: SingleSpaAngularOpts, props: any): DomElementGetter; | ||
import { BaseSingleSpaAngularOptions } from './types'; | ||
export declare function removeApplicationFromDOMIfIvyEnabled<T extends BaseSingleSpaAngularOptions>(options: T, props: any): void; | ||
export declare function getContainerElementAndSetTemplate<T extends BaseSingleSpaAngularOptions>(options: T, props: any): HTMLElement; |
@@ -1,2 +0,2 @@ | ||
export { SingleSpaAngularOpts, BootstrappedSingleSpaAngularOpts } from './types'; | ||
export { getContainerEl, chooseDomElementGetter, removeApplicationFromDOMIfIvyEnabled, } from './dom'; | ||
export * from './types'; | ||
export { getContainerElementAndSetTemplate, removeApplicationFromDOMIfIvyEnabled } from './dom'; |
{ | ||
"main": "../bundles/single-spa-angular-internals.umd.js", | ||
"module": "../fesm5/single-spa-angular-internals.js", | ||
"module": "../fesm2015/single-spa-angular-internals.js", | ||
"es2015": "../fesm2015/single-spa-angular-internals.js", | ||
"esm5": "../esm5/internals/single-spa-angular-internals.js", | ||
"esm2015": "../esm2015/internals/single-spa-angular-internals.js", | ||
"fesm5": "../fesm5/single-spa-angular-internals.js", | ||
"fesm2015": "../fesm2015/single-spa-angular-internals.js", | ||
@@ -9,0 +7,0 @@ "typings": "single-spa-angular-internals.d.ts", |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"SingleSpaAngularOpts":{"__symbolic":"interface"},"BootstrappedSingleSpaAngularOpts":{"__symbolic":"interface"},"getContainerEl":{"__symbolic":"function"},"chooseDomElementGetter":{"__symbolic":"function"},"removeApplicationFromDOMIfIvyEnabled":{"__symbolic":"function"}},"origins":{"SingleSpaAngularOpts":"./types","BootstrappedSingleSpaAngularOpts":"./types","getContainerEl":"./dom","chooseDomElementGetter":"./dom","removeApplicationFromDOMIfIvyEnabled":"./dom"},"importAs":"single-spa-angular/internals"} | ||
{"__symbolic":"module","version":4,"metadata":{"DomElementGetter":{"__symbolic":"interface"},"BaseSingleSpaAngularOptions":{"__symbolic":"interface"},"getContainerElementAndSetTemplate":{"__symbolic":"function"},"removeApplicationFromDOMIfIvyEnabled":{"__symbolic":"function"}},"origins":{"DomElementGetter":"./types","BaseSingleSpaAngularOptions":"./types","getContainerElementAndSetTemplate":"./dom","removeApplicationFromDOMIfIvyEnabled":"./dom"},"importAs":"single-spa-angular/internals"} |
@@ -1,18 +0,8 @@ | ||
import { NgModuleRef, Type } from '@angular/core'; | ||
import { AppProps } from 'single-spa'; | ||
import { NgModuleRef } from '@angular/core'; | ||
export declare type DomElementGetter = () => HTMLElement; | ||
export interface SingleSpaAngularOpts { | ||
NgZone: typeof import('@angular/core').NgZone | 'noop'; | ||
bootstrapFunction(props: AppProps): Promise<NgModuleRef<any>>; | ||
updateFunction?(props: AppProps): Promise<any>; | ||
export interface BaseSingleSpaAngularOptions { | ||
template: string; | ||
Router?: Type<any>; | ||
domElementGetter?(): HTMLElement; | ||
AnimationEngine?: Type<any>; | ||
bootstrapFunction(props: AppProps): Promise<NgModuleRef<any>>; | ||
} | ||
export interface BootstrappedSingleSpaAngularOpts extends SingleSpaAngularOpts { | ||
bootstrappedModule: NgModuleRef<any>; | ||
bootstrappedNgZone?: import('@angular/core').NgZone; | ||
routingEventListener?: () => void; | ||
zoneIdentifier?: string; | ||
} |
@@ -70,3 +70,4 @@ "use strict"; | ||
if (rule.use) { | ||
const cssMiniExtractIndex = rule.use.findIndex((use) => typeof use === 'string' && use.includes('mini-css-extract-plugin')); | ||
const cssMiniExtractIndex = rule.use.findIndex((use) => (typeof use === 'string' && use.includes('mini-css-extract-plugin')) || | ||
(typeof use === 'object' && use.loader && use.loader.includes('mini-css-extract-plugin'))); | ||
if (cssMiniExtractIndex >= 0) { | ||
@@ -73,0 +74,0 @@ rule.use[cssMiniExtractIndex] = { loader: 'style-loader' }; |
{ | ||
"$schema": "../node_modules/ng-packagr/ng-package.schema.json", | ||
"name": "single-spa-angular", | ||
"version": "4.3.2", | ||
"version": "4.4.1", | ||
"description": "Helpers for building single-spa applications which use Angular 2", | ||
@@ -28,14 +28,14 @@ "schematics": "./schematics/schematics.json", | ||
"@angular/core": ">=9", | ||
"single-spa": ">=4.0.0", | ||
"tslib": "^1.10.0" | ||
"single-spa": ">=4.0.0" | ||
}, | ||
"main": "bundles/single-spa-angular.umd.js", | ||
"module": "fesm5/single-spa-angular.js", | ||
"module": "fesm2015/single-spa-angular.js", | ||
"es2015": "fesm2015/single-spa-angular.js", | ||
"esm5": "esm5/single-spa-angular.js", | ||
"esm2015": "esm2015/single-spa-angular.js", | ||
"fesm5": "fesm5/single-spa-angular.js", | ||
"fesm2015": "fesm2015/single-spa-angular.js", | ||
"typings": "single-spa-angular.d.ts", | ||
"metadata": "single-spa-angular.metadata.json" | ||
"metadata": "single-spa-angular.metadata.json", | ||
"dependencies": { | ||
"tslib": "^2.0.0" | ||
} | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addScripts = void 0; | ||
const DEFAULT_PORT = 4200; | ||
@@ -4,0 +5,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getAngularBuildersCustomWebpackDependency = exports.getSingleSpaAngularDependency = exports.getSingleSpaDependency = void 0; | ||
const dependencies_1 = require("@schematics/angular/utility/dependencies"); | ||
@@ -4,0 +5,0 @@ const { version, peerDependencies, dependencies } = require('../../package.json'); |
@@ -1,2 +0,2 @@ | ||
import { Rule, SchematicContext } from '@angular-devkit/schematics'; | ||
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; | ||
import { Schema as NgAddOptions } from './schema'; | ||
@@ -6,3 +6,3 @@ export default function (options: NgAddOptions): Rule; | ||
export declare function createMainEntry(options: NgAddOptions): Rule; | ||
export declare function updateConfiguration(options: NgAddOptions): (host: import("@angular-devkit/schematics/src/tree/interface").Tree, context: SchematicContext) => import("@angular-devkit/schematics/src/tree/interface").Tree; | ||
export declare function updateConfiguration(options: NgAddOptions): (host: Tree, context: SchematicContext) => import("@angular-devkit/schematics/src/tree/interface").Tree; | ||
export declare function addNPMScripts(options: NgAddOptions): Rule; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.addNPMScripts = exports.updateConfiguration = exports.createMainEntry = exports.addDependencies = void 0; | ||
const schematics_1 = require("@angular-devkit/schematics"); | ||
@@ -4,0 +5,0 @@ const config_1 = require("@schematics/angular/utility/config"); |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"ɵa":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/common","name":"ɵBrowserPlatformLocation","line":9,"character":47},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":8,"character":1}}],"members":{"destroy":[{"__symbolic":"method"}],"pushState":[{"__symbolic":"method"}],"replaceState":[{"__symbolic":"method"}],"onPopState":[{"__symbolic":"method"}],"setNgZone":[{"__symbolic":"method"}]}},"singleSpaAngular":{"__symbolic":"function"},"getSingleSpaExtraProviders":{"__symbolic":"function","parameters":[],"value":[{"provide":{"__symbolic":"reference","name":"ɵa"},"useClass":{"__symbolic":"reference","name":"ɵa"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":87,"character":18},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":87,"character":25}]}]]},{"provide":{"__symbolic":"reference","module":"@angular/common","name":"PlatformLocation","line":90,"character":15},"useExisting":{"__symbolic":"reference","name":"ɵa"}}]},"ParcelModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ParcelComponent"}],"exports":[{"__symbolic":"reference","name":"ParcelComponent"}],"entryComponents":[{"__symbolic":"reference","name":"ParcelComponent"}]}]}],"members":{}},"ParcelComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"parcel","template":"<div></div>"}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"mountParcel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"onParcelMount":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"wrapWith":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"customProps":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"appendTo":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"handleError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":39,"context":{"typeName":"HTMLElement"},"module":"./src/parcel-lib/parcel.component"}]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"addThingToDo":[{"__symbolic":"method"}]}}},"origins":{"ɵa":"./src/extra-providers","singleSpaAngular":"./src/single-spa-angular","getSingleSpaExtraProviders":"./src/extra-providers","ParcelModule":"./src/parcel-lib/index","ParcelComponent":"./src/parcel-lib/parcel.component"},"importAs":"single-spa-angular"} | ||
{"__symbolic":"module","version":4,"metadata":{"ɵa":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/common","name":"ɵBrowserPlatformLocation","line":13,"character":47},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"character":1}}],"members":{"destroyApplication":[{"__symbolic":"method"}],"pushState":[{"__symbolic":"method"}],"replaceState":[{"__symbolic":"method"}],"onPopState":[{"__symbolic":"method"}],"storeOnPopStateListener":[{"__symbolic":"method"}]}},"singleSpaAngular":{"__symbolic":"function"},"getSingleSpaExtraProviders":{"__symbolic":"function","parameters":[],"value":[{"provide":{"__symbolic":"reference","name":"ɵa"},"useClass":{"__symbolic":"reference","name":"ɵa"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":128,"character":18},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":128,"character":25}]}]]},{"provide":{"__symbolic":"reference","module":"@angular/common","name":"PlatformLocation","line":131,"character":15},"useExisting":{"__symbolic":"reference","name":"ɵa"}}]},"ParcelModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ParcelComponent"}],"exports":[{"__symbolic":"reference","name":"ParcelComponent"}],"entryComponents":[{"__symbolic":"reference","name":"ParcelComponent"}]}]}],"members":{}},"ParcelComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"parcel","template":"<div></div>"}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"mountParcel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"onParcelMount":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"wrapWith":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"customProps":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"appendTo":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"handleError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":39,"context":{"typeName":"HTMLElement"},"module":"./src/parcel-lib/parcel.component"}]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"addThingToDo":[{"__symbolic":"method"}]}}},"origins":{"ɵa":"./src/extra-providers","singleSpaAngular":"./src/single-spa-angular","getSingleSpaExtraProviders":"./src/extra-providers","ParcelModule":"./src/parcel-lib/index","ParcelComponent":"./src/parcel-lib/parcel.component"},"importAs":"single-spa-angular"} |
@@ -1,12 +0,13 @@ | ||
import { NgZone, StaticProvider } from '@angular/core'; | ||
import { StaticProvider } from '@angular/core'; | ||
import { ɵBrowserPlatformLocation, LocationChangeEvent } from '@angular/common'; | ||
declare type OnPopStateListener = (event: LocationChangeEvent) => void; | ||
export declare class SingleSpaPlatformLocation extends ɵBrowserPlatformLocation { | ||
private ngZone; | ||
private skipNextPopState; | ||
private onPopStateListeners; | ||
destroy(): void; | ||
private zoneToOnPopStateListenersMap; | ||
private source; | ||
destroyApplication(zoneIdentifier: string): void; | ||
pushState(state: any, title: string, url: string): void; | ||
replaceState(state: any, title: string, url: string): void; | ||
onPopState(fn: (event: LocationChangeEvent) => void): void; | ||
setNgZone(ngZone: NgZone): void; | ||
onPopState(fn: OnPopStateListener): void; | ||
private storeOnPopStateListener; | ||
} | ||
@@ -19,1 +20,2 @@ /** | ||
export declare function getSingleSpaExtraProviders(): StaticProvider[]; | ||
export {}; |
import { LifeCycles } from 'single-spa'; | ||
import { SingleSpaAngularOpts } from 'single-spa-angular/internals'; | ||
export declare function singleSpaAngular(userOpts: SingleSpaAngularOpts): LifeCycles; | ||
import { SingleSpaAngularOptions } from './types'; | ||
export declare function singleSpaAngular(userOptions: SingleSpaAngularOptions): LifeCycles; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78
412208
2869
3
1
+ Addedtslib@^2.0.0
- Removedtslib@1.14.1(transitive)