@softarc/native-federation-orchestrator 4.2.1 → 4.2.2

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.
@@ -1,6 +1,32 @@
1
1
  import type { FederationManifest } from './1.domain';
2
2
  import type { NFOptions } from './2.app/config/config.contract';
3
3
  import type { NativeFederationResult } from './init-federation.contract';
4
- export type InitNodeFederationOptions = NFOptions;
4
+ import { type HostInstancesOption } from './4.config/import-map/resolve-host-instances';
5
+ export type { HostInstancesOption, HostInstancesAuto } from './4.config/import-map/resolve-host-instances';
6
+ export type InitNodeFederationOptions = NFOptions & {
7
+ /**
8
+ * Bridge specifiers to instances already loaded in the host process (dev).
9
+ *
10
+ * The host's instances are published on `globalThis.__NF_HOST_INSTANCES__`
11
+ * and the node loader synthesizes a re-export module for each specifier
12
+ * instead of resolving it through the import map, so remotes share the host's
13
+ * singletons. Three forms:
14
+ *
15
+ * - **Explicit map** — `{ '@angular/core': await import('@angular/core') }`.
16
+ * - **`'all'`** — auto-derive every shared singleton from the host remoteEntry
17
+ * and import each in the host realm. Needs `hostRemoteEntry`.
18
+ * - **`{ include, exclude }`** — auto-derive, filtered by exact/prefix match,
19
+ * e.g. `{ include: ['@angular/', 'rxjs', 'zone.js'] }`.
20
+ *
21
+ * This is an escape hatch that bypasses the version resolver, the import map,
22
+ * and integrity checks entirely. Exports are value snapshots, not live
23
+ * bindings — fine for packages whose exports are stable refs (Angular's
24
+ * classes/functions), not for packages that reassign their exports after init.
25
+ *
26
+ * Omit in production: with no `hostInstances`, nothing is published and the
27
+ * loader never routes to the bridge — resolution is import-map only.
28
+ */
29
+ hostInstances?: HostInstancesOption;
30
+ };
5
31
  declare const initNodeFederation: (remotesOrManifestUrl: string | FederationManifest, options?: InitNodeFederationOptions) => Promise<NativeFederationResult>;
6
32
  export { initNodeFederation };