piral-ng 0.15.0-beta.4803 → 0.15.0-beta.4812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/RoutingService.js +33 -4
- package/esm/RoutingService.js.map +1 -1
- package/esm/bootstrap.d.ts +3 -2
- package/esm/bootstrap.js +41 -19
- package/esm/bootstrap.js.map +1 -1
- package/esm/converter.js +10 -5
- package/esm/converter.js.map +1 -1
- package/esm/module.d.ts +20 -1
- package/esm/module.js +35 -13
- package/esm/module.js.map +1 -1
- package/esm/queue.d.ts +1 -1
- package/esm/queue.js.map +1 -1
- package/esm/startup.d.ts +1 -0
- package/esm/startup.js +51 -35
- package/esm/startup.js.map +1 -1
- package/esm/types.d.ts +31 -3
- package/esm/utils.d.ts +2 -0
- package/esm/utils.js +7 -0
- package/esm/utils.js.map +1 -1
- package/lib/RoutingService.js +33 -4
- package/lib/RoutingService.js.map +1 -1
- package/lib/bootstrap.d.ts +3 -2
- package/lib/bootstrap.js +41 -19
- package/lib/bootstrap.js.map +1 -1
- package/lib/converter.js +10 -5
- package/lib/converter.js.map +1 -1
- package/lib/module.d.ts +20 -1
- package/lib/module.js +38 -14
- package/lib/module.js.map +1 -1
- package/lib/queue.d.ts +1 -1
- package/lib/queue.js.map +1 -1
- package/lib/startup.d.ts +1 -0
- package/lib/startup.js +52 -35
- package/lib/startup.js.map +1 -1
- package/lib/types.d.ts +31 -3
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +10 -1
- package/lib/utils.js.map +1 -1
- package/package.json +3 -3
- package/src/RoutingService.ts +36 -4
- package/src/bootstrap.ts +48 -21
- package/src/converter.ts +13 -8
- package/src/module.ts +37 -13
- package/src/queue.ts +1 -1
- package/src/startup.ts +61 -39
- package/src/types.ts +29 -3
- package/src/utils.ts +9 -0
package/lib/RoutingService.js
CHANGED
|
@@ -4,6 +4,31 @@ exports.RoutingService = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@angular/core");
|
|
6
6
|
const router_1 = require("@angular/router");
|
|
7
|
+
const common_1 = require("@angular/common");
|
|
8
|
+
const noop = function () { };
|
|
9
|
+
// deactivates the usual platform behavior; all these operations are performed via the RoutingService
|
|
10
|
+
// to avoid any conflict, e.g., double-booking URL changes in React and Angular
|
|
11
|
+
common_1.ɵBrowserPlatformLocation.prototype.pushState = noop;
|
|
12
|
+
common_1.ɵBrowserPlatformLocation.prototype.replaceState = noop;
|
|
13
|
+
common_1.ɵBrowserPlatformLocation.prototype.forward = noop;
|
|
14
|
+
common_1.ɵBrowserPlatformLocation.prototype.back = noop;
|
|
15
|
+
common_1.ɵBrowserPlatformLocation.prototype.historyGo = noop;
|
|
16
|
+
function normalize(url) {
|
|
17
|
+
const search = url.indexOf('?');
|
|
18
|
+
const hash = url.indexOf('#');
|
|
19
|
+
if (search !== -1 || hash !== -1) {
|
|
20
|
+
if (search === -1) {
|
|
21
|
+
return url.substring(0, hash);
|
|
22
|
+
}
|
|
23
|
+
else if (hash === -1) {
|
|
24
|
+
return url.substring(0, search);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return url.substring(0, Math.min(search, hash));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return url;
|
|
31
|
+
}
|
|
7
32
|
let RoutingService = class RoutingService {
|
|
8
33
|
constructor(context, router, zone) {
|
|
9
34
|
this.context = context;
|
|
@@ -22,21 +47,25 @@ let RoutingService = class RoutingService {
|
|
|
22
47
|
this.dispose = nav.listen(({ location }) => {
|
|
23
48
|
const path = location.pathname;
|
|
24
49
|
if (!this.invalidRoutes.includes(path)) {
|
|
25
|
-
const url = path
|
|
50
|
+
const url = `${path}${location.search}${location.hash}`;
|
|
26
51
|
this.zone.run(() => this.router.navigateByUrl(url));
|
|
27
52
|
}
|
|
28
53
|
});
|
|
29
54
|
this.subscription = this.router.events.subscribe((e) => {
|
|
30
55
|
if (e instanceof router_1.NavigationError) {
|
|
31
|
-
const
|
|
56
|
+
const routerUrl = e.url;
|
|
57
|
+
const path = normalize(routerUrl);
|
|
58
|
+
const locationUrl = nav.url;
|
|
32
59
|
if (!this.invalidRoutes.includes(path)) {
|
|
33
60
|
this.invalidRoutes.push(path);
|
|
34
61
|
}
|
|
35
|
-
|
|
62
|
+
if (routerUrl !== locationUrl) {
|
|
63
|
+
nav.push(routerUrl);
|
|
64
|
+
}
|
|
36
65
|
}
|
|
37
66
|
else if (e.type === 15) {
|
|
38
67
|
// consistency check to avoid #535 and other Angular-specific issues
|
|
39
|
-
const locationUrl = nav.
|
|
68
|
+
const locationUrl = nav.url;
|
|
40
69
|
const routerUrl = e.routerEvent.url;
|
|
41
70
|
if (routerUrl !== locationUrl) {
|
|
42
71
|
nav.push(routerUrl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoutingService.js","sourceRoot":"","sources":["../src/RoutingService.ts"],"names":[],"mappings":";;;;AAEA,wCAAgF;AAChF,4CAAkE;
|
|
1
|
+
{"version":3,"file":"RoutingService.js","sourceRoot":"","sources":["../src/RoutingService.ts"],"names":[],"mappings":";;;;AAEA,wCAAgF;AAChF,4CAAkE;AAClE,4CAA2D;AAE3D,MAAM,IAAI,GAAG,cAAa,CAAC,CAAC;AAE5B,qGAAqG;AACrG,+EAA+E;AAC/E,iCAAwB,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;AACpD,iCAAwB,CAAC,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC;AACvD,iCAAwB,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;AAClD,iCAAwB,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC/C,iCAAwB,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;AAEpD,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,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ACnC,CAAC;CACF,CAAA;AA5DY,cAAc;IAD1B,IAAA,iBAAU,GAAE;IAOR,mBAAA,IAAA,aAAM,EAAC,SAAS,CAAC,CAAA;IACjB,mBAAA,IAAA,eAAQ,GAAE,CAAA;IACV,mBAAA,IAAA,eAAQ,GAAE,CAAA;qDADiB,eAAM;QACR,aAAM;GARvB,cAAc,CA4D1B;AA5DY,wCAAc"}
|
package/lib/bootstrap.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BaseComponentProps, ComponentContext, Disposable, PiletApi } from 'piral-core';
|
|
2
2
|
import type { BehaviorSubject } from 'rxjs';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
3
|
+
import type { Type } from '@angular/core';
|
|
4
|
+
import type { NgLazyType, PrepareBootstrapResult } from './types';
|
|
5
|
+
export declare function prepareBootstrap(moduleOrComponent: Type<any> | NgLazyType, piral: PiletApi): Promise<PrepareBootstrapResult>;
|
|
5
6
|
export declare function bootstrap<TProps extends BaseComponentProps>(result: PrepareBootstrapResult, node: HTMLElement, props: BehaviorSubject<TProps>, context: ComponentContext): Promise<Disposable>;
|
package/lib/bootstrap.js
CHANGED
|
@@ -2,27 +2,49 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bootstrap = exports.prepareBootstrap = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const startup_1 = require("./startup");
|
|
6
|
-
const utils_1 = require("./utils");
|
|
7
5
|
const module_1 = require("./module");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const startup_1 = require("./startup");
|
|
8
8
|
function prepareBootstrap(moduleOrComponent, piral) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
if ('module' in moduleOrComponent && typeof moduleOrComponent.module === 'function') {
|
|
11
|
+
if (!(moduleOrComponent.state.current instanceof Promise)) {
|
|
12
|
+
moduleOrComponent.state.current = moduleOrComponent.module().then((result) => {
|
|
13
|
+
if (typeof result !== 'object' || !('default' in result)) {
|
|
14
|
+
throw new Error('The lazy loaded module does not `default` export a NgModule class.');
|
|
15
|
+
}
|
|
16
|
+
(0, module_1.defineModule)(result.default, moduleOrComponent.opts);
|
|
17
|
+
return (0, module_1.findModule)(result.default);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const moduleDef = yield moduleOrComponent.state.current;
|
|
21
|
+
const { components } = moduleDef;
|
|
22
|
+
const component = components.find((m) => (0, utils_1.hasSelector)(m, moduleOrComponent.selector));
|
|
23
|
+
if (!component) {
|
|
24
|
+
throw new Error(`No component matching the selector "${moduleOrComponent.selector}" has been found.`);
|
|
25
|
+
}
|
|
26
|
+
return [...(0, module_1.activateModuleInstance)(moduleDef, piral), component];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const [annotation] = (0, utils_1.getAnnotations)(moduleOrComponent);
|
|
30
|
+
const standalone = annotation === null || annotation === void 0 ? void 0 : annotation.standalone;
|
|
31
|
+
// first way is to directly use a module, which is the legacy way
|
|
32
|
+
// second way is to find a previously defined Angular module
|
|
33
|
+
if (annotation && annotation.bootstrap) {
|
|
34
|
+
// usually contains things like imports, exports, declarations, ...
|
|
35
|
+
const [component] = annotation.bootstrap;
|
|
36
|
+
annotation.exports = [component];
|
|
37
|
+
(0, module_1.defineModule)(moduleOrComponent);
|
|
38
|
+
return [...(0, module_1.getModuleInstance)(component, standalone, piral), component];
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// usually contains things like selector, template or templateUrl, changeDetection, ...
|
|
42
|
+
const result = (0, module_1.getModuleInstance)(moduleOrComponent, standalone, piral) ||
|
|
43
|
+
(0, module_1.createModuleInstance)(moduleOrComponent, standalone, piral);
|
|
44
|
+
return [...result, moduleOrComponent];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
26
48
|
}
|
|
27
49
|
exports.prepareBootstrap = prepareBootstrap;
|
|
28
50
|
function bootstrap(result, node, props, context) {
|
package/lib/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;;;AAIA,qCAAqH;AACrH,mCAAsD;AACtD,uCAAoC;AAEpC,SAAsB,gBAAgB,CACpC,iBAAyC,EACzC,KAAe;;QAEf,IAAI,QAAQ,IAAI,iBAAiB,IAAI,OAAO,iBAAiB,CAAC,MAAM,KAAK,UAAU,EAAE;YACnF,IAAI,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,YAAY,OAAO,CAAC,EAAE;gBACzD,iBAAiB,CAAC,KAAK,CAAC,OAAO,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;oBAC3E,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE;wBACxD,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;qBACvF;oBAED,IAAA,qBAAY,EAAC,MAAM,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;oBACrD,OAAO,IAAA,mBAAU,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACpC,CAAC,CAAC,CAAC;aACJ;YAED,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC;YACxD,MAAM,EAAE,UAAU,EAAE,GAAG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,KAA8B,EAC9B,OAAyB;;QAEzB,MAAM,CAAC,cAAc,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC;QACtD,MAAM,GAAG,GAAG,MAAM,IAAA,iBAAO,EAAC,cAAc,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QAE9D,IAAI,GAAG,EAAE;YACP,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YAC5C,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;SACnD;QAED,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC;CAAA;AAfD,8BAeC"}
|
package/lib/converter.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createConverter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const rxjs_1 = require("rxjs");
|
|
5
6
|
const NgExtension_1 = require("./NgExtension");
|
|
6
7
|
const queue_1 = require("./queue");
|
|
@@ -11,23 +12,27 @@ function createConverter(_ = {}) {
|
|
|
11
12
|
const convert = (component) => ({
|
|
12
13
|
mount(el, props, ctx, locals) {
|
|
13
14
|
locals.active = true;
|
|
14
|
-
if (!registry.has(component)) {
|
|
15
|
-
registry.set(component, (0, bootstrap_1.prepareBootstrap)(component, props.piral));
|
|
16
|
-
}
|
|
17
15
|
if (!locals.props) {
|
|
18
16
|
locals.props = new rxjs_1.BehaviorSubject(props);
|
|
19
17
|
}
|
|
20
18
|
if (!locals.queued) {
|
|
21
19
|
locals.queued = Promise.resolve();
|
|
22
20
|
}
|
|
23
|
-
locals.queued = locals.queued.then(() => (0, queue_1.enqueue)(() =>
|
|
21
|
+
locals.queued = locals.queued.then(() => (0, queue_1.enqueue)(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
if (!registry.has(component)) {
|
|
23
|
+
registry.set(component, yield (0, bootstrap_1.prepareBootstrap)(component, props.piral));
|
|
24
|
+
}
|
|
25
|
+
if (locals.active) {
|
|
26
|
+
(0, bootstrap_1.bootstrap)(registry.get(component), el, locals.props, ctx);
|
|
27
|
+
}
|
|
28
|
+
})));
|
|
24
29
|
},
|
|
25
30
|
update(el, props, ctx, locals) {
|
|
26
31
|
locals.props.next(props);
|
|
27
32
|
},
|
|
28
33
|
unmount(el, locals) {
|
|
29
34
|
locals.active = false;
|
|
30
|
-
locals.queued = locals.queued.then((dispose) => dispose &&
|
|
35
|
+
locals.queued = locals.queued.then((dispose) => dispose && (0, queue_1.enqueue)(dispose));
|
|
31
36
|
},
|
|
32
37
|
});
|
|
33
38
|
convert.defineModule = module_1.defineModule;
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;;AAGA,+BAAuC;AACvC,+CAA4C;AAC5C,mCAAkC;AAClC,qCAAwC;AACxC,2CAA0D;AAgB1D,SAAgB,eAAe,CAAC,IAAwB,EAAE;IACxD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA+B,CAAC;IACxD,MAAM,OAAO,GAAG,CAAoC,SAAiC,EAA4B,EAAE,CAAC,CAAC;QACnH,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAuB;YAC3C,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;YAErB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;gBACjB,MAAM,CAAC,KAAK,GAAG,IAAI,sBAAe,CAAC,KAAK,CAAC,CAAC;aAC3C;YAED,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;gBAClB,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;aACnC;YAED,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CACtC,IAAA,eAAO,EAAC,GAAS,EAAE;gBACjB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;oBAC5B,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,IAAA,4BAAgB,EAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;iBACzE;gBAED,IAAI,MAAM,CAAC,MAAM,EAAE;oBACjB,IAAA,qBAAS,EAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;iBAC3D;YACH,CAAC,CAAA,CAAC,CACH,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAuB;YAC5C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,MAAuB;YACjC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC;YACtB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,IAAA,eAAO,EAAC,OAAO,CAAC,CAAC,CAAC;QAC/E,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,YAAY,GAAG,qBAAY,CAAC;IACpC,OAAO,CAAC,SAAS,GAAG,yBAAW,CAAC;IAChC,OAAO,OAAO,CAAC;AACjB,CAAC;AArCD,0CAqCC"}
|
package/lib/module.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import type { PiletApi } from 'piral-core';
|
|
2
2
|
import type { NgOptions, ModuleInstanceResult } from './types';
|
|
3
|
+
interface ModuleDefinition {
|
|
4
|
+
active: any;
|
|
5
|
+
module: any;
|
|
6
|
+
components: Array<any>;
|
|
7
|
+
opts: NgOptions;
|
|
8
|
+
}
|
|
9
|
+
export declare function activateModuleInstance(moduleDef: ModuleDefinition, piral: PiletApi): ModuleInstanceResult;
|
|
3
10
|
export declare function getModuleInstance(component: any, standalone: boolean, piral: PiletApi): ModuleInstanceResult;
|
|
4
11
|
export declare function createModuleInstance(component: any, standalone: boolean, piral: PiletApi): ModuleInstanceResult;
|
|
5
|
-
export declare function
|
|
12
|
+
export declare function findModule(module: any): ModuleDefinition;
|
|
13
|
+
export declare function defineModule(module: any, opts?: NgOptions): (selector: string) => {
|
|
14
|
+
component: {
|
|
15
|
+
selector: string;
|
|
16
|
+
module: any;
|
|
17
|
+
opts: (import("@angular/core").CompilerOptions & import("@angular/core").BootstrapOptions) | (import("@angular/core").CompilerOptions & import("@angular/core").BootstrapOptions)[];
|
|
18
|
+
state: {
|
|
19
|
+
current: any;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type: "ng";
|
|
23
|
+
};
|
|
24
|
+
export {};
|
package/lib/module.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineModule = exports.createModuleInstance = exports.getModuleInstance = void 0;
|
|
3
|
+
exports.defineModule = exports.findModule = exports.createModuleInstance = exports.getModuleInstance = exports.activateModuleInstance = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const platform_browser_1 = require("@angular/platform-browser");
|
|
6
6
|
const common_1 = require("@angular/common");
|
|
7
7
|
const core_1 = require("@angular/core");
|
|
8
|
+
const startup_1 = require("./startup");
|
|
8
9
|
const RoutingService_1 = require("./RoutingService");
|
|
9
10
|
const SharedModule_1 = require("./SharedModule");
|
|
10
11
|
const utils_1 = require("./utils");
|
|
11
12
|
const availableModules = [];
|
|
12
13
|
function instantiateModule(moduleDef, piral) {
|
|
14
|
+
var BootstrapModule_1;
|
|
13
15
|
const { module, components } = moduleDef;
|
|
14
16
|
const imports = [platform_browser_1.BrowserModule, SharedModule_1.SharedModule, module];
|
|
15
17
|
const props = { current: undefined };
|
|
@@ -18,7 +20,7 @@ function instantiateModule(moduleDef, piral) {
|
|
|
18
20
|
{ provide: 'Props', useFactory: () => props.current.value, deps: [] },
|
|
19
21
|
{ provide: 'piral', useFactory: () => piral, deps: [] },
|
|
20
22
|
];
|
|
21
|
-
let BootstrapModule = class BootstrapModule {
|
|
23
|
+
let BootstrapModule = BootstrapModule_1 = class BootstrapModule {
|
|
22
24
|
constructor(resolver, zone, routing) {
|
|
23
25
|
this.resolver = resolver;
|
|
24
26
|
this.zone = zone;
|
|
@@ -54,9 +56,12 @@ function instantiateModule(moduleDef, piral) {
|
|
|
54
56
|
this.refs.splice(i, 1);
|
|
55
57
|
}
|
|
56
58
|
}
|
|
59
|
+
if (this.refs.length === 0) {
|
|
60
|
+
(0, startup_1.teardown)(BootstrapModule_1);
|
|
61
|
+
}
|
|
57
62
|
}
|
|
58
63
|
};
|
|
59
|
-
BootstrapModule = tslib_1.__decorate([
|
|
64
|
+
BootstrapModule = BootstrapModule_1 = tslib_1.__decorate([
|
|
60
65
|
(0, core_1.NgModule)({
|
|
61
66
|
imports,
|
|
62
67
|
entryComponents: components,
|
|
@@ -66,13 +71,17 @@ function instantiateModule(moduleDef, piral) {
|
|
|
66
71
|
], BootstrapModule);
|
|
67
72
|
return BootstrapModule;
|
|
68
73
|
}
|
|
74
|
+
function activateModuleInstance(moduleDef, piral) {
|
|
75
|
+
if (!moduleDef.active) {
|
|
76
|
+
moduleDef.active = instantiateModule(moduleDef, piral);
|
|
77
|
+
}
|
|
78
|
+
return [moduleDef.active, moduleDef.opts];
|
|
79
|
+
}
|
|
80
|
+
exports.activateModuleInstance = activateModuleInstance;
|
|
69
81
|
function getModuleInstance(component, standalone, piral) {
|
|
70
82
|
const [moduleDef] = availableModules.filter((m) => m.components.includes(component));
|
|
71
83
|
if (moduleDef) {
|
|
72
|
-
|
|
73
|
-
moduleDef.active = instantiateModule(moduleDef, piral);
|
|
74
|
-
}
|
|
75
|
-
return [moduleDef.active, moduleDef.opts];
|
|
84
|
+
return activateModuleInstance(moduleDef, piral);
|
|
76
85
|
}
|
|
77
86
|
if (process.env.NODE_ENV === 'development') {
|
|
78
87
|
if (!standalone) {
|
|
@@ -101,14 +110,29 @@ function createModuleInstance(component, standalone, piral) {
|
|
|
101
110
|
return getModuleInstance(component, standalone, piral);
|
|
102
111
|
}
|
|
103
112
|
exports.createModuleInstance = createModuleInstance;
|
|
113
|
+
function findModule(module) {
|
|
114
|
+
return availableModules.find(m => m.module === module);
|
|
115
|
+
}
|
|
116
|
+
exports.findModule = findModule;
|
|
104
117
|
function defineModule(module, opts = undefined) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
if (typeof module !== 'function') {
|
|
119
|
+
const [annotation] = (0, utils_1.getAnnotations)(module);
|
|
120
|
+
availableModules.push({
|
|
121
|
+
active: undefined,
|
|
122
|
+
components: (0, utils_1.findComponents)(annotation.exports),
|
|
123
|
+
module,
|
|
124
|
+
opts,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const state = {
|
|
129
|
+
current: undefined,
|
|
130
|
+
};
|
|
131
|
+
return (selector) => ({
|
|
132
|
+
component: { selector, module, opts, state },
|
|
133
|
+
type: 'ng',
|
|
134
|
+
});
|
|
135
|
+
}
|
|
112
136
|
}
|
|
113
137
|
exports.defineModule = defineModule;
|
|
114
138
|
//# sourceMappingURL=module.js.map
|
package/lib/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;AAGA,gEAA0D;AAC1D,4CAA+C;AAC/C,wCAOuB;AACvB,qDAAk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,EAAE,CAAC,CAAC;YAC5B,SAAS,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE;YAC5C,IAAI,EAAE,IAAa;SACpB,CAAC,CAAC;KACJ;AACH,CAAC;AAnBD,oCAmBC"}
|
package/lib/queue.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function enqueue<T>(callback: () => Promise<T>): Promise<T>;
|
|
1
|
+
export declare function enqueue<T>(callback: () => T | Promise<T>): Promise<T>;
|
package/lib/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":";;;AAAA,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AAE9B,SAAgB,OAAO,CAAI,
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":";;;AAAA,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AAE9B,SAAgB,OAAO,CAAI,QAA8B;IACvD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC;AAJD,0BAIC"}
|
package/lib/startup.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ import { NgModuleRef } from '@angular/core';
|
|
|
4
4
|
export declare type NgModuleInt = NgModuleRef<any> & {
|
|
5
5
|
_destroyed: boolean;
|
|
6
6
|
};
|
|
7
|
+
export declare function teardown(BootstrapModule: any): void;
|
|
7
8
|
export declare function startup(BootstrapModule: any, context: ComponentContext, ngOptions?: NgOptions): Promise<void | NgModuleInt>;
|
package/lib/startup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startup = void 0;
|
|
3
|
+
exports.startup = exports.teardown = void 0;
|
|
4
4
|
const core_1 = require("@angular/core");
|
|
5
5
|
const common_1 = require("@angular/common");
|
|
6
6
|
const platform_browser_dynamic_1 = require("@angular/platform-browser-dynamic");
|
|
@@ -11,44 +11,61 @@ function getVersionHandler(versions) {
|
|
|
11
11
|
return versions[version];
|
|
12
12
|
}
|
|
13
13
|
const runningModules = [];
|
|
14
|
+
function startNew(BootstrapModule, context, ngOptions) {
|
|
15
|
+
const path = context.publicPath || '/';
|
|
16
|
+
const platform = (0, platform_browser_dynamic_1.platformBrowserDynamic)([
|
|
17
|
+
{ provide: 'Context', useValue: context },
|
|
18
|
+
{ provide: common_1.APP_BASE_HREF, useValue: path },
|
|
19
|
+
]);
|
|
20
|
+
const id = (0, utils_1.getId)();
|
|
21
|
+
const zoneIdentifier = `piral-ng:${id}`;
|
|
22
|
+
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone.
|
|
23
|
+
// See:
|
|
24
|
+
// - https://github.com/PlaceMe-SAS/single-spa-angular-cli/issues/33
|
|
25
|
+
// - https://github.com/angular/angular/blob/a14dc2d7a4821a19f20a9547053a5734798f541e/packages/core/src/zone/ng_zone.ts#L144
|
|
26
|
+
// - https://github.com/angular/angular/blob/a14dc2d7a4821a19f20a9547053a5734798f541e/packages/core/src/zone/ng_zone.ts#L257
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
core_1.NgZone.isInAngularZone = () => window.Zone.current._properties[zoneIdentifier] === true;
|
|
29
|
+
return platform
|
|
30
|
+
.bootstrapModule(BootstrapModule, ngOptions)
|
|
31
|
+
.catch((err) => console.log(err))
|
|
32
|
+
.then((instance) => {
|
|
33
|
+
var _a;
|
|
34
|
+
if (instance) {
|
|
35
|
+
const zone = instance.injector.get(core_1.NgZone);
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
const z = (_a = zone === null || zone === void 0 ? void 0 : zone._inner) !== null && _a !== void 0 ? _a : zone === null || zone === void 0 ? void 0 : zone.inner;
|
|
38
|
+
if (z && '_properties' in z) {
|
|
39
|
+
z._properties[zoneIdentifier] = true;
|
|
40
|
+
}
|
|
41
|
+
runningModules.push([BootstrapModule, instance, platform]);
|
|
42
|
+
}
|
|
43
|
+
return instance;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function teardown(BootstrapModule) {
|
|
47
|
+
const runningModuleIndex = runningModules.findIndex(([ref]) => ref === BootstrapModule);
|
|
48
|
+
if (runningModuleIndex !== -1) {
|
|
49
|
+
const [, , platform] = runningModules[runningModuleIndex];
|
|
50
|
+
runningModules.splice(runningModuleIndex, 1);
|
|
51
|
+
if (!platform.destroyed) {
|
|
52
|
+
platform.destroy();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.teardown = teardown;
|
|
14
57
|
function startup(BootstrapModule, context, ngOptions) {
|
|
15
58
|
const runningModule = runningModules.find(([ref]) => ref === BootstrapModule);
|
|
16
59
|
if (runningModule) {
|
|
17
|
-
const [, instance] = runningModule;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{ provide: common_1.APP_BASE_HREF, useValue: path },
|
|
25
|
-
]);
|
|
26
|
-
const id = Math.random().toString(36);
|
|
27
|
-
const zoneIdentifier = `piral-ng:${id}`;
|
|
28
|
-
// This is a hack, since NgZone doesn't allow you to configure the property that identifies your zone.
|
|
29
|
-
// See:
|
|
30
|
-
// - https://github.com/PlaceMe-SAS/single-spa-angular-cli/issues/33
|
|
31
|
-
// - https://github.com/angular/angular/blob/a14dc2d7a4821a19f20a9547053a5734798f541e/packages/core/src/zone/ng_zone.ts#L144
|
|
32
|
-
// - https://github.com/angular/angular/blob/a14dc2d7a4821a19f20a9547053a5734798f541e/packages/core/src/zone/ng_zone.ts#L257
|
|
33
|
-
// @ts-ignore
|
|
34
|
-
core_1.NgZone.isInAngularZone = () => window.Zone.current._properties[zoneIdentifier] === true;
|
|
35
|
-
return platform
|
|
36
|
-
.bootstrapModule(BootstrapModule, ngOptions)
|
|
37
|
-
.catch((err) => console.log(err))
|
|
38
|
-
.then((instance) => {
|
|
39
|
-
var _a;
|
|
40
|
-
if (instance) {
|
|
41
|
-
const zone = instance.injector.get(core_1.NgZone);
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
const z = (_a = zone === null || zone === void 0 ? void 0 : zone._inner) !== null && _a !== void 0 ? _a : zone === null || zone === void 0 ? void 0 : zone.inner;
|
|
44
|
-
if (z && '_properties' in z) {
|
|
45
|
-
z._properties[zoneIdentifier] = true;
|
|
46
|
-
}
|
|
47
|
-
runningModules.push([BootstrapModule, instance]);
|
|
48
|
-
}
|
|
49
|
-
return instance;
|
|
50
|
-
});
|
|
60
|
+
const [, instance, platform] = runningModule;
|
|
61
|
+
if (platform.destroyed) {
|
|
62
|
+
teardown(BootstrapModule);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return Promise.resolve(instance);
|
|
66
|
+
}
|
|
51
67
|
}
|
|
68
|
+
return startNew(BootstrapModule, context, ngOptions);
|
|
52
69
|
}
|
|
53
70
|
exports.startup = startup;
|
|
54
71
|
if (process.env.NODE_ENV === 'development') {
|
package/lib/startup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup.js","sourceRoot":"","sources":["../src/startup.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"startup.js","sourceRoot":"","sources":["../src/startup.ts"],"names":[],"mappings":";;;AAEA,wCAAiF;AACjF,4CAAgD;AAChD,gFAA2E;AAC3E,mCAA8C;AAE9C,SAAS,iBAAiB,CAAC,QAAoC;IAC7D,MAAM,KAAK,GAAG,IAAA,oBAAY,GAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,IAAI,KAAK,EAAE,CAAC;IAC5B,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;AA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Component } from 'piral-core';
|
|
3
|
+
import type { Type } from '@angular/core';
|
|
3
4
|
declare module 'piral-core/lib/types/custom' {
|
|
4
5
|
interface PiletCustomApi extends PiletNgApi {
|
|
5
6
|
}
|
|
@@ -19,6 +20,24 @@ export declare type PrepareBootstrapResult = [...ModuleInstanceResult, any];
|
|
|
19
20
|
export declare type NgModuleInt = NgModuleRef<any> & {
|
|
20
21
|
_destroyed: boolean;
|
|
21
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Gives you the ability to use a component from a lazy loaded module.
|
|
25
|
+
*/
|
|
26
|
+
export interface NgComponentLoader {
|
|
27
|
+
/**
|
|
28
|
+
* Uses a component from a lazy loaded module.
|
|
29
|
+
* @param selector The selector defined for the component to load.
|
|
30
|
+
*/
|
|
31
|
+
(selector: string): NgComponent;
|
|
32
|
+
}
|
|
33
|
+
export interface NgLazyType {
|
|
34
|
+
selector: string;
|
|
35
|
+
module: () => Promise<{
|
|
36
|
+
default: Type<any>;
|
|
37
|
+
}>;
|
|
38
|
+
opts: NgOptions;
|
|
39
|
+
state: any;
|
|
40
|
+
}
|
|
22
41
|
/**
|
|
23
42
|
* Represents the interface implemented by a module definer function.
|
|
24
43
|
*/
|
|
@@ -28,13 +47,22 @@ export interface NgModuleDefiner {
|
|
|
28
47
|
* @param ngModule The module to use for running Angular.
|
|
29
48
|
* @param opts The options to pass when bootstrapping.
|
|
30
49
|
*/
|
|
31
|
-
(module:
|
|
50
|
+
<T>(module: Type<T>, opts?: NgOptions): void;
|
|
51
|
+
/**
|
|
52
|
+
* Defines the module to lazy load for bootstrapping the Angular pilet.
|
|
53
|
+
* @param getModule The module lazy loader to use for running Angular.
|
|
54
|
+
* @param opts The options to pass when bootstrapping.
|
|
55
|
+
* @returns The module ID to be used to reference components.
|
|
56
|
+
*/
|
|
57
|
+
<T>(getModule: () => Promise<{
|
|
58
|
+
default: Type<T>;
|
|
59
|
+
}>, opts?: NgOptions): NgComponentLoader;
|
|
32
60
|
}
|
|
33
61
|
export interface NgComponent {
|
|
34
62
|
/**
|
|
35
63
|
* The component root.
|
|
36
64
|
*/
|
|
37
|
-
component: any;
|
|
65
|
+
component: Type<any> | NgLazyType;
|
|
38
66
|
/**
|
|
39
67
|
* The type of the Angular component.
|
|
40
68
|
*/
|
|
@@ -56,7 +84,7 @@ export interface PiletNgApi {
|
|
|
56
84
|
* @param component The component root.
|
|
57
85
|
* @returns The Piral Ng component.
|
|
58
86
|
*/
|
|
59
|
-
fromNg(component:
|
|
87
|
+
fromNg<T>(component: Type<T>): NgComponent;
|
|
60
88
|
/**
|
|
61
89
|
* Angular component for displaying extensions of the given name.
|
|
62
90
|
*/
|
package/lib/utils.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ export interface NgAnnotation {
|
|
|
10
10
|
bootstrap: any;
|
|
11
11
|
selector: string;
|
|
12
12
|
}
|
|
13
|
+
export declare function getId(): string;
|
|
13
14
|
export declare function getNgVersion(): string;
|
|
14
15
|
export declare function getMinVersion(): string;
|
|
15
16
|
export declare function getAnnotations(component: any): Array<NgAnnotation>;
|
|
17
|
+
export declare function hasSelector(component: any, selector: string): boolean;
|
|
16
18
|
export declare function findComponents(exports: Array<any>): Array<any>;
|
package/lib/utils.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findComponents = exports.getAnnotations = exports.getMinVersion = exports.getNgVersion = void 0;
|
|
3
|
+
exports.findComponents = exports.hasSelector = exports.getAnnotations = exports.getMinVersion = exports.getNgVersion = exports.getId = void 0;
|
|
4
4
|
const core_1 = require("@angular/core");
|
|
5
|
+
function getId() {
|
|
6
|
+
return Math.random().toString(36);
|
|
7
|
+
}
|
|
8
|
+
exports.getId = getId;
|
|
5
9
|
function getNgVersion() {
|
|
6
10
|
return core_1.VERSION.major || core_1.VERSION.full.split('.')[0];
|
|
7
11
|
}
|
|
@@ -25,6 +29,11 @@ function getAnnotations(component) {
|
|
|
25
29
|
return annotations || [];
|
|
26
30
|
}
|
|
27
31
|
exports.getAnnotations = getAnnotations;
|
|
32
|
+
function hasSelector(component, selector) {
|
|
33
|
+
const [annotation] = getAnnotations(component);
|
|
34
|
+
return annotation && annotation.selector === selector;
|
|
35
|
+
}
|
|
36
|
+
exports.hasSelector = hasSelector;
|
|
28
37
|
function findComponents(exports) {
|
|
29
38
|
const components = [];
|
|
30
39
|
if (Array.isArray(exports)) {
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,wCAAwD;AAcxD,SAAgB,YAAY;IAC1B,OAAO,cAAO,CAAC,KAAK,IAAI,cAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa;IAC3B,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,OAAO,GAAG,KAAK,MAAM,CAAC;AACxB,CAAC;AAHD,sCAGC;AAED,SAAgB,cAAc,CAAC,SAAc;IAC3C,IAAI,WAAW,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,CAAC;IAE7C,IAAI,CAAC,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,gBAAgB,IAAI,OAAO,EAAE;QACjF,WAAW,GAAI,OAAe,CAAC,cAAc,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;KACzE;IAED,IAAI,CAAC,WAAW,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,WAAW,EAAE;QACzD,WAAW,GAAG,CAAC,EAAE,CAAC,CAAC;KACpB;IAED,IAAI,CAAC,WAAW,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,WAAW,EAAE;QACzD,WAAW,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;KAChC;IAED,OAAO,WAA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