@edynamix/mf-isolation 0.0.2 → 0.0.3
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/README.md
CHANGED
|
@@ -70,8 +70,33 @@ const providers = provideMfOverlayRoot(mountElement);
|
|
|
70
70
|
|
|
71
71
|
The Angular entry point requires `@angular/core` and `@angular/cdk`.
|
|
72
72
|
|
|
73
|
+
## Host-owned Zone.js
|
|
74
|
+
|
|
75
|
+
Standalone Angular applications load their own Zone.js runtime as usual:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import 'zone.js';
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
When the application runs as a hosted lifecycle, the host owns the single Zone.js runtime. Check that runtime before dynamically importing any Angular code:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import { assertHostZoneRuntime } from '@edynamix/mf-isolation/angular-runtime';
|
|
85
|
+
import type { IShellContext } from './shell-context';
|
|
86
|
+
|
|
87
|
+
export const mount = async (host: HTMLElement, context: IShellContext): Promise<void> => {
|
|
88
|
+
assertHostZoneRuntime();
|
|
89
|
+
|
|
90
|
+
const lifecycle = await import('./lifecycle-impl');
|
|
91
|
+
return lifecycle.mount(host, context);
|
|
92
|
+
};
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`angular-runtime` is framework-free. It verifies that `globalThis.Zone` is a function; it does not load or modify Zone.js.
|
|
96
|
+
|
|
73
97
|
## Exports
|
|
74
98
|
|
|
75
99
|
- `@edynamix/mf-isolation`
|
|
76
100
|
- `@edynamix/mf-isolation/angular`
|
|
101
|
+
- `@edynamix/mf-isolation/angular-runtime`
|
|
77
102
|
- `@edynamix/mf-isolation/postcss`
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verifies the host-owned Zone.js runtime before Angular is loaded.
|
|
3
|
+
*
|
|
4
|
+
* This check is intentionally framework-free and must run before dynamically
|
|
5
|
+
* importing an Angular bootstrap module.
|
|
6
|
+
*/
|
|
7
|
+
export declare const assertHostZoneRuntime: () => void;
|
|
8
|
+
//# sourceMappingURL=angular-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular-runtime.d.ts","sourceRoot":"","sources":["../src/angular-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAO,IAMxC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verifies the host-owned Zone.js runtime before Angular is loaded.
|
|
3
|
+
*
|
|
4
|
+
* This check is intentionally framework-free and must run before dynamically
|
|
5
|
+
* importing an Angular bootstrap module.
|
|
6
|
+
*/
|
|
7
|
+
export const assertHostZoneRuntime = () => {
|
|
8
|
+
const zoneRuntime = globalThis.Zone;
|
|
9
|
+
if (typeof zoneRuntime !== 'function') {
|
|
10
|
+
throw new Error('Host Zone.js runtime is missing. Expected globalThis.Zone to be a function before loading Angular.');
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=angular-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular-runtime.js","sourceRoot":"","sources":["../src/angular-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAS,EAAE;IAC9C,MAAM,WAAW,GAAI,UAAqD,CAAC,IAAI,CAAC;IAEhF,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,oGAAoG,CAAC,CAAC;IACxH,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edynamix/mf-isolation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "CSS and overlay isolation helpers for eDynamix microfrontends.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"types": "./dist/angular.d.ts",
|
|
21
21
|
"import": "./dist/angular.js"
|
|
22
22
|
},
|
|
23
|
+
"./angular-runtime": {
|
|
24
|
+
"types": "./dist/angular-runtime.d.ts",
|
|
25
|
+
"import": "./dist/angular-runtime.js"
|
|
26
|
+
},
|
|
23
27
|
"./postcss": {
|
|
24
28
|
"types": "./dist/postcss.d.ts",
|
|
25
29
|
"import": "./dist/postcss.js"
|