@fulgurjs/federation 6.12.5 → 6.12.6
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/CHANGELOG.md +5 -0
- package/README.en.md +12 -5
- package/README.md +11 -4
- package/dist/cli.js +5 -3
- package/dist/index.cjs +6 -4
- package/dist/index.js +6 -4
- package/dist/runtime.js +1 -1
- package/docs/en/reference/api.md +64 -100
- package/docs/en/reference/errors.md +2 -2
- package/docs/en/reference/types.md +161 -162
- package/docs/zh/reference/api.md +69 -104
- package/docs/zh/reference/errors.md +3 -3
- package/docs/zh/reference/types.md +86 -86
- package/package.json +1 -1
|
@@ -12,18 +12,18 @@ Import from: `@fulgurjs/federation`.
|
|
|
12
12
|
|
|
13
13
|
| Field | Optional | Type | Contract |
|
|
14
14
|
|---|---|---|---|
|
|
15
|
-
| `name` | no | `string` |
|
|
16
|
-
| `filename` | yes | `string` |
|
|
17
|
-
| `exposes` | yes | `Record<string, string \| ExposeHint>` |
|
|
18
|
-
| `setup` | yes | `string` |
|
|
19
|
-
| `remotes` | yes | `Record<string, string \| RemoteEntryConfig \| (() => Promise<any>)>` |
|
|
20
|
-
| `shared` | yes | `SharedConfig` |
|
|
21
|
-
| `shareScope` | yes | `string` |
|
|
22
|
-
| `manifest` | yes | `boolean \| Record<string, unknown>` |
|
|
23
|
-
| `runtimePlugins` | yes | `string[]` |
|
|
15
|
+
| `name` | no | `string` | Required page-unique container name: starts with a letter, followed by letters/digits/underscore/dot/hyphen. |
|
|
16
|
+
| `filename` | yes | `string` | Production entry filename, default fulgurjs-remoteEntry.js; update caching rules and doctor --entry together. |
|
|
17
|
+
| `exposes` | yes | `Record<string, string \| ExposeHint>` | Public module keys mapped to real source files; both components and ordinary modules may be exposed. |
|
|
18
|
+
| `setup` | yes | `string` | Optional setup module path. The default setup function is optional; declare at least one of default/onSession/globalComponents/pageProviders. Application/session/consumer execution scopes are defined in the [setup contract](api.md). |
|
|
19
|
+
| `remotes` | yes | `Record<string, string \| RemoteEntryConfig \| (() => Promise<any>)>` | Configured remotes; addresses must resolve in every dev/prod environment actually used. |
|
|
20
|
+
| `shared` | yes | `SharedConfig` | Dependency keys and consumption conditions; does not create or automatically share business stores. |
|
|
21
|
+
| `shareScope` | yes | `string` | Sharing group name; scopes negotiate independently, default default. |
|
|
22
|
+
| `manifest` | yes | `boolean \| Record<string, unknown>` | Production manifest enabled by default; false disables it without disabling ordinary module loading, but limits manifest-based checks/preloading. |
|
|
23
|
+
| `runtimePlugins` | yes | `string[]` | Runtime plugin module paths, empty by default; relative paths resolve from the application root. |
|
|
24
24
|
| `dts` | yes | `boolean \| { dir?: string }` | Remote type generation and sync (see the [configuration reference](configuration.md) and [API · remote types](api.md#remote-types-generation-and-sync)). |
|
|
25
|
-
| `devSharedSelf` | yes | `boolean` |
|
|
26
|
-
| `devCorsOrigins` | yes | `string[] \| "*"` |
|
|
25
|
+
| `devSharedSelf` | yes | `boolean` | Whether dev source participates in sharing. Omitted: true for exposes/setup providers, false for pure consumers; explicit values win. The plugin manages its pre-bundling wiring; do not manually exclude all shared packages by default. |
|
|
26
|
+
| `devCorsOrigins` | yes | `string[] \| "*"` | Dev federation entry/manifest/types Origin policy, default *. It supplies Vite module CORS only when server.cors is omitted; explicit server.cors does not override plugin endpoints. Non-loopback wildcard configurations may still warn DEV-011. Production CORS is separate. |
|
|
27
27
|
|
|
28
28
|
## PageRouteLike
|
|
29
29
|
|
|
@@ -33,9 +33,9 @@ Import from: `@fulgurjs/federation`, `@fulgurjs/federation/react`, `@fulgurjs/fe
|
|
|
33
33
|
|
|
34
34
|
| Field | Optional | Type | Contract |
|
|
35
35
|
|---|---|---|---|
|
|
36
|
-
| `route` | no | `string` |
|
|
37
|
-
| `spec` | yes | `string` |
|
|
38
|
-
| `name` | yes | `string` |
|
|
36
|
+
| `route` | no | `string` | Host logical route matched by static/:param segments, not a remote deployment URL. |
|
|
37
|
+
| `spec` | yes | `string` | In a page table, an expose key without the remote name; in a resolved result, a full remote/expose spec. |
|
|
38
|
+
| `name` | yes | `string` | Host route name; title/keepAlive and other fields may be added, without automatic router registration. |
|
|
39
39
|
|
|
40
40
|
## ShareEntry
|
|
41
41
|
|
|
@@ -45,13 +45,13 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
45
45
|
|
|
46
46
|
| Field | Optional | Type | Contract |
|
|
47
47
|
|---|---|---|---|
|
|
48
|
-
| `version` | no | `string` |
|
|
49
|
-
| `get` | no | `() => Promise<any>` |
|
|
50
|
-
| `from` | no | `string` |
|
|
51
|
-
| `eager` | no | `boolean` |
|
|
52
|
-
| `loaded` | yes | `boolean` |
|
|
53
|
-
| `value` | yes | `any` |
|
|
54
|
-
| `pendingGet` | yes | `Promise<any>` |
|
|
48
|
+
| `version` | no | `string` | Actual provided dependency version used in negotiation; never mislabel versions to bypass compatibility checks. |
|
|
49
|
+
| `get` | no | `() => Promise<any>` | Factory loading this version module; successful results are reused by the runtime. |
|
|
50
|
+
| `from` | no | `string` | Provider identity for arbitration diagnostics and provenance. |
|
|
51
|
+
| `eager` | no | `boolean` | Whether the local share is eagerly/synchronously available; does not preload business modules. |
|
|
52
|
+
| `loaded` | yes | `boolean` | Whether the provider entry has been consumed; singleton selection prefers loaded entries. |
|
|
53
|
+
| `value` | yes | `any` | Cached successfully loaded module instance; application code should not mutate the registry. |
|
|
54
|
+
| `pendingGet` | yes | `Promise<any>` | In-flight shared loading Promise, reused concurrently and cleared after settlement. |
|
|
55
55
|
|
|
56
56
|
## ShareScope
|
|
57
57
|
|
|
@@ -81,15 +81,15 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
81
81
|
|
|
82
82
|
| Field | Optional | Type | Contract |
|
|
83
83
|
|---|---|---|---|
|
|
84
|
-
| `name` | no | `string` |
|
|
85
|
-
| `entry` | no | `string` |
|
|
86
|
-
| `shareScope` | yes | `string` |
|
|
87
|
-
| `timeout` | yes | `number` |
|
|
88
|
-
| `retries` | yes | `number` |
|
|
89
|
-
| `fallback` | yes | `string[]` |
|
|
90
|
-
| `breaker` | yes | `{ threshold?: number; resetMs?: number; }` |
|
|
91
|
-
| `promise` | yes | `() => Promise<any>` |
|
|
92
|
-
| `manifestUrl` | yes | `string` |
|
|
84
|
+
| `name` | no | `string` | Runtime registration name matching the remote prefix in loading specs. |
|
|
85
|
+
| `entry` | no | `string` | Remote container entry URL; runtime registration expects the actual entry file, not a business page. |
|
|
86
|
+
| `shareScope` | yes | `string` | Sharing group name; scopes negotiate independently, default default. |
|
|
87
|
+
| `timeout` | yes | `number` | Container wait limit, default 15000 ms; does not cancel browser dynamic import. |
|
|
88
|
+
| `retries` | yes | `number` | Retry count after load failure, integer 0–10; omitted inherits the remote registration default of 2. |
|
|
89
|
+
| `fallback` | yes | `string[]` | Backup entry URLs tried in order after primary-entry failure. |
|
|
90
|
+
| `breaker` | yes | `{ threshold?: number; resetMs?: number; }` | Breaker threshold and reset delay, default threshold=5 and resetMs=30000; values must be finite and positive. |
|
|
91
|
+
| `promise` | yes | `() => Promise<any>` | Resolve a container or entry URL dynamically, subject to runtime timeout/retry policy. |
|
|
92
|
+
| `manifestUrl` | yes | `string` | Optional manifest locator for preloading, normally supplied by generated registration config. |
|
|
93
93
|
|
|
94
94
|
## LoadShareOptions
|
|
95
95
|
|
|
@@ -99,13 +99,13 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
99
99
|
|
|
100
100
|
| Field | Optional | Type | Contract |
|
|
101
101
|
|---|---|---|---|
|
|
102
|
-
| `requiredVersion` | yes | `string \| false` |
|
|
103
|
-
| `singleton` | yes | `boolean` |
|
|
104
|
-
| `strictVersion` | yes | `boolean` |
|
|
105
|
-
| `shareKey` | yes | `string` |
|
|
106
|
-
| `shareScope` | yes | `string` |
|
|
107
|
-
| `fallback` | yes | `() => Promise<any>` |
|
|
108
|
-
| `localVersion` | yes | `string` |
|
|
102
|
+
| `requiredVersion` | yes | `string \| false` | Semver range accepted by this call; false accepts any version. This runtime call does not infer package.json ranges. |
|
|
103
|
+
| `singleton` | yes | `boolean` | Consume one instance within a shareScope/shareKey; does not make incompatible versions compatible. |
|
|
104
|
+
| `strictVersion` | yes | `boolean` | Reject incompatible versions; manual runtime calls do not inherit build-time inferred default combinations. |
|
|
105
|
+
| `shareKey` | yes | `string` | Dependency key looked up in the scope; omitted uses the call name. |
|
|
106
|
+
| `shareScope` | yes | `string` | Sharing group name; scopes negotiate independently, default default. |
|
|
107
|
+
| `fallback` | yes | `() => Promise<any>` | Explicit local copy when no usable share is available; does not hide strict version conflicts. |
|
|
108
|
+
| `localVersion` | yes | `string` | Actual local fallback version used by synchronous facades/instance registration, not a compatibility override. |
|
|
109
109
|
|
|
110
110
|
## LoadRemoteOptions
|
|
111
111
|
|
|
@@ -115,10 +115,10 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
115
115
|
|
|
116
116
|
| Field | Optional | Type | Contract |
|
|
117
117
|
|---|---|---|---|
|
|
118
|
-
| `shareScope` | yes | `string` |
|
|
119
|
-
| `retries` | yes | `number` |
|
|
120
|
-
| `fallbackModule` | yes | `() => any` |
|
|
121
|
-
| `consumerApp` | yes | `unknown` |
|
|
118
|
+
| `shareScope` | yes | `string` | Sharing group name; scopes negotiate independently, default default. |
|
|
119
|
+
| `retries` | yes | `number` | Retry count after load failure, integer 0–10; omitted inherits the remote registration default of 2. |
|
|
120
|
+
| `fallbackModule` | yes | `() => any` | Explicit replacement module after remote module loading failure; initialization failures still reject rather than being hidden. |
|
|
121
|
+
| `consumerApp` | yes | `unknown` | Vue remoteComponent/createHostPages supplies the actual consumer app for idempotent globalComponents registration; manual loading and React do not supply it automatically. |
|
|
122
122
|
|
|
123
123
|
## PreloadRemoteOptions
|
|
124
124
|
|
|
@@ -128,7 +128,7 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
128
128
|
|
|
129
129
|
| Field | Optional | Type | Contract |
|
|
130
130
|
|---|---|---|---|
|
|
131
|
-
| `mode` | yes | `"preload" \| "prefetch"` |
|
|
131
|
+
| `mode` | yes | `"preload" \| "prefetch"` | Default preload; prefetch lowers resource-hint priority without automatic idle scheduling; see the API for wait boundaries. |
|
|
132
132
|
|
|
133
133
|
## RuntimePlugin
|
|
134
134
|
|
|
@@ -138,8 +138,8 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
138
138
|
|
|
139
139
|
| Field | Optional | Type | Contract |
|
|
140
140
|
|---|---|---|---|
|
|
141
|
-
| `name` | yes | `string` |
|
|
142
|
-
| `init` | yes | `(hooks: RuntimeHooks) => void` |
|
|
141
|
+
| `name` | yes | `string` | Optional diagnostic plugin name identifying hook provenance. |
|
|
142
|
+
| `init` | yes | `(hooks: RuntimeHooks) => void` | Receives the mutable hooks object during plugin registration; install needed hooks rather than loading business pages here. |
|
|
143
143
|
|
|
144
144
|
## RuntimeHooks
|
|
145
145
|
|
|
@@ -149,10 +149,10 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
149
149
|
|
|
150
150
|
| Field | Optional | Type | Contract |
|
|
151
151
|
|---|---|---|---|
|
|
152
|
-
| `resolveShare` | yes | `(shareInfo: { shareKey: string; shareScope: string; requiredVersion?: string \| false; picked?: ShareEntry; available: ShareEntry[]; }) => void \| ShareEntry \| Promise<void \| ShareEntry>` |
|
|
153
|
-
| `beforeLoadRemote` | yes | `(info: { remote: string; module: string; }) => void` |
|
|
154
|
-
| `afterLoadRemote` | yes | `(info: { remote: string; module: string; module_ns?: any; }) => void` |
|
|
155
|
-
| `onRemoteError` | yes | `(info: { remote: string; error: FgError; }) => void` |
|
|
152
|
+
| `resolveShare` | yes | `(shareInfo: { shareKey: string; shareScope: string; requiredVersion?: string \| false; picked?: ShareEntry; available: ShareEntry[]; }) => void \| ShareEntry \| Promise<void \| ShareEntry>` | Decision hook: return ShareEntry to override, void to retain the default, optionally via Promise; explicit errors propagate to the caller. |
|
|
153
|
+
| `beforeLoadRemote` | yes | `(info: { remote: string; module: string; }) => void` | Observation hook before remote loading; thrown errors warn without changing the loading decision. |
|
|
154
|
+
| `afterLoadRemote` | yes | `(info: { remote: string; module: string; module_ns?: any; }) => void` | Observation hook after remote loading; module_ns is the actual result, and thrown errors do not replace it. |
|
|
155
|
+
| `onRemoteError` | yes | `(info: { remote: string; error: FgError; }) => void` | Receives remote errors and identity for logging/diagnostics, not as a replacement-module return channel. |
|
|
156
156
|
|
|
157
157
|
## RemoteDebugInfo
|
|
158
158
|
|
|
@@ -162,11 +162,11 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
162
162
|
|
|
163
163
|
| Field | Optional | Type | Contract |
|
|
164
164
|
|---|---|---|---|
|
|
165
|
-
| `entry` | no | `string` |
|
|
166
|
-
| `status` | no | `"idle" \| "loading" \| "loaded" \| "failed"` |
|
|
167
|
-
| `lastLoadMs` | yes | `number` |
|
|
168
|
-
| `error` | yes | `string` |
|
|
169
|
-
| `setup` | yes | `"
|
|
165
|
+
| `entry` | no | `string` | Remote container entry URL; runtime registration expects the actual entry file, not a business page. |
|
|
166
|
+
| `status` | no | `"idle" \| "loading" \| "loaded" \| "failed"` | Container state idle/loading/loaded/failed; loaded does not mean every business page request is complete. |
|
|
167
|
+
| `lastLoadMs` | yes | `number` | Latest container load duration in milliseconds, not complete business-page readiness time. |
|
|
168
|
+
| `error` | yes | `string` | Latest container error message string, not a React error-rendering option. |
|
|
169
|
+
| `setup` | yes | `"none" \| "pending" \| "ready" \| "failed"` | Remote application-level setup status, not a module path; ready does not mean every session/business request is complete. |
|
|
170
170
|
|
|
171
171
|
## FgRuntime
|
|
172
172
|
|
|
@@ -176,22 +176,22 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
176
176
|
|
|
177
177
|
| Field | Optional | Type | Contract |
|
|
178
178
|
|---|---|---|---|
|
|
179
|
-
| `shareScopeMap` | no | `ShareScopeMap` |
|
|
180
|
-
| `initSharing` | no | `(scopeName?: string) => ShareScopeMap` |
|
|
181
|
-
| `registerShare` | no | `(scopeName: string, name: string, version: string, get: () => Promise<any>, opts?: { from?: string; eager?: boolean; loaded?: boolean; }) => void` |
|
|
182
|
-
| `registerRemotes` | no | `(list: RemoteConfig[]) => void` |
|
|
183
|
-
| `registerRemote` | no | `(remote: RemoteConfig) => void` |
|
|
184
|
-
| `registerPlugins` | no | `(list: RuntimePlugin[]) => void` |
|
|
185
|
-
| `loadShare` | no | `(name: string, opts?: LoadShareOptions) => Promise<any>` |
|
|
186
|
-
| `loadShareSync` | no | `(name: string, opts: LoadShareOptions) => { kind: "ready" \| "local"; value?: any; }` |
|
|
187
|
-
| `prepareShares` | no | `(requests: { name: string; opts: LoadShareOptions; }[]) => Promise<void>` |
|
|
188
|
-
| `getLoadedShare` | no | `(name: string, opts?: LoadShareOptions) => any` |
|
|
189
|
-
| `pinLoadedShare` | no | `(name: string, opts: LoadShareOptions, localVersion: string, instance: unknown) => void` |
|
|
190
|
-
| `loadRemote` | no |
|
|
191
|
-
| `getContainer` | no | `(name: string) => Promise<any>` |
|
|
192
|
-
| `preloadRemote` | no | `(spec: string, opts?: PreloadRemoteOptions) => Promise<void>` |
|
|
193
|
-
| `parseSpec` | no | `(spec: string) => { remote: string; module: string; }` |
|
|
194
|
-
| `clearSessionState` | no | `() => void` |
|
|
179
|
+
| `shareScopeMap` | no | `ShareScopeMap` | Current share registry for diagnostics, not direct business-state mutation. |
|
|
180
|
+
| `initSharing` | no | `(scopeName?: string) => ShareScopeMap` | Initialize a named scope, default default; normally called by generated plugin code. |
|
|
181
|
+
| `registerShare` | no | `(scopeName: string, name: string, version: string, get: () => Promise<any>, opts?: { from?: string; eager?: boolean; loaded?: boolean; }) => void` | Register one dependency version and loader; normally generated by the plugin. |
|
|
182
|
+
| `registerRemotes` | no | `(list: RemoteConfig[]) => void` | Register several remote configs with registerRemote semantics. |
|
|
183
|
+
| `registerRemote` | no | `(remote: RemoteConfig) => void` | Register/update remote config with immediate validation; provide the actual entry URL. |
|
|
184
|
+
| `registerPlugins` | no | `(list: RuntimePlugin[]) => void` | Install runtime hooks; later sharing-policy changes do not rewrite evaluated static bindings. |
|
|
185
|
+
| `loadShare` | no | `(name: string, opts?: LoadShareOptions) => Promise<any>` | Negotiate and retrieve a share asynchronously; ordinary imports are transformed by the plugin. |
|
|
186
|
+
| `loadShareSync` | no | `(name: string, opts: LoadShareOptions) => { kind: "ready" \| "local"; value?: any; }` | Used by generated synchronous facades: ready/value or local; unsupported async decisions fail explicitly. Not the normal application loader. |
|
|
187
|
+
| `prepareShares` | no | `(requests: { name: string; opts: LoadShareOptions; }[]) => Promise<void>` | Prepare a group of share decisions before generated entry evaluation; for advanced custom integration. |
|
|
188
|
+
| `getLoadedShare` | no | `(name: string, opts?: LoadShareOptions) => any` | Synchronously read a ready share, undefined if absent; no download, while strict version errors may still throw. |
|
|
189
|
+
| `pinLoadedShare` | no | `(name: string, opts: LoadShareOptions, localVersion: string, instance: unknown) => void` | Register an existing instance under its actual version without overwriting other provider facts; normally plugin-managed. |
|
|
190
|
+
| `loadRemote` | no | `typeof loadRemote` | Same as loadRemote from the public entry; infers synchronized entries by default, while explicit `loadRemote<T>` puts type ownership on the caller. |
|
|
191
|
+
| `getContainer` | no | `(name: string) => Promise<any>` | Load/init the remote container without running business setup/onSession. |
|
|
192
|
+
| `preloadRemote` | no | `(spec: string, opts?: PreloadRemoteOptions) => Promise<void>` | Preload resources without executing modules; prefetch does not schedule idle time, and stylesheets can affect the current page. |
|
|
193
|
+
| `parseSpec` | no | `(spec: string) => { remote: string; module: string; }` | Split remote and ./module; module is empty for a bare remote name. |
|
|
194
|
+
| `clearSessionState` | no | `() => void` | Invalidate onSession signals/deduplication without deleting AppContext; normal logout uses clearAppContext. |
|
|
195
195
|
|
|
196
196
|
## RemoteSetupContext
|
|
197
197
|
|
|
@@ -201,9 +201,9 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
201
201
|
|
|
202
202
|
| Field | Optional | Type | Contract |
|
|
203
203
|
|---|---|---|---|
|
|
204
|
-
| `appContext` | no | `Readonly<Record<string, any>>` |
|
|
205
|
-
| `sessionKey` | yes | `string` |
|
|
206
|
-
| `signal` | no | `AbortSignal` |
|
|
204
|
+
| `appContext` | no | `Readonly<Record<string, any>>` | Readonly context snapshot at call time, not a continuing reactive subscription. |
|
|
205
|
+
| `sessionKey` | yes | `string` | Non-sensitive login generation, distinct from user ID/token; required by onSession and stable within the session. |
|
|
206
|
+
| `signal` | no | `AbortSignal` | Cancellation signal for this lifecycle; check aborted after awaits before writing state. |
|
|
207
207
|
|
|
208
208
|
## RemoteSetupModule
|
|
209
209
|
|
|
@@ -213,8 +213,8 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
213
213
|
|
|
214
214
|
| Field | Optional | Type | Contract |
|
|
215
215
|
|---|---|---|---|
|
|
216
|
-
| `default` | yes | `(ctx: RemoteSetupContext) => void \| Promise<void>` |
|
|
217
|
-
| `onSession` | yes | `(ctx: RemoteSetupContext) => void \| Promise<void>` |
|
|
216
|
+
| `default` | yes | `(ctx: RemoteSetupContext) => void \| Promise<void>` | Optional application-level setup, once per successfully initialized remote container; not a per-app/component factory. |
|
|
217
|
+
| `onSession` | yes | `(ctx: RemoteSetupContext) => void \| Promise<void>` | Sync/async session function deduplicated by generation; a new generation invalidates the old signal, and failures can retry. |
|
|
218
218
|
| `globalComponents` | yes | `Record<string, unknown>` | Static components retain their identity. Zero-argument functions with displayName/props/emits metadata are components; unmarked zero-argument functions are lazy loaders. See the setup API for installation and retry semantics. |
|
|
219
219
|
| `pageProviders` | yes | `unknown[]` | Ancestor Providers required by remote components; each item is a component or zero-argument loader. Adapters wrap the actual consumer tree without copying the provider application. |
|
|
220
220
|
|
|
@@ -226,13 +226,13 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
226
226
|
|
|
227
227
|
| Field | Optional | Type | Contract |
|
|
228
228
|
|---|---|---|---|
|
|
229
|
-
| `user` | no | `Record<string, any>` |
|
|
230
|
-
| `getToken` | yes | `() => string` |
|
|
231
|
-
| `store` | yes | `unknown` |
|
|
232
|
-
| `hostApp` | yes | `unknown` |
|
|
233
|
-
| `locale` | yes | `unknown` |
|
|
234
|
-
| `events` | yes | `Record<string, any>` |
|
|
235
|
-
| `sessionKey` | yes | `string` |
|
|
229
|
+
| `user` | no | `Record<string, any>` | User snapshot when provided by the host, not an automatically updated user subscription. |
|
|
230
|
+
| `getToken` | yes | `() => string \| undefined` | Read the latest token at call time, allowing undefined; authentication owns validity/refresh. |
|
|
231
|
+
| `store` | yes | `unknown` | Explicit host Pinia reference; not automatically installed in a child and not a substitute for provider-store ownership. |
|
|
232
|
+
| `hostApp` | yes | `unknown` | Host app reference; register child globals against the actual consumer app rather than this reference. |
|
|
233
|
+
| `locale` | yes | `unknown` | Explicit UI configuration; does not automatically install a locale Provider. |
|
|
234
|
+
| `events` | yes | `Record<string, any>` | Shared-reference callbacks/events organized by business namespace; remove owned reverse registrations on unmount. |
|
|
235
|
+
| `sessionKey` | yes | `string` | Non-sensitive login generation, distinct from user ID/token; required by onSession and stable within the session. |
|
|
236
236
|
|
|
237
237
|
## PagesOptions
|
|
238
238
|
|
|
@@ -242,10 +242,10 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
242
242
|
|
|
243
243
|
| Field | Optional | Type | Contract |
|
|
244
244
|
|---|---|---|---|
|
|
245
|
-
| `deriveSpec` | yes | `(route: string) => string` |
|
|
246
|
-
| `remotes` | yes | `Record<string, string>` |
|
|
247
|
-
| `schema` | yes | `Record<string, RemoteSchemaEntry>` |
|
|
248
|
-
| `strict` | yes | `boolean` |
|
|
245
|
+
| `deriveSpec` | yes | `(route: string) => string` | Derives an expose key when page spec is omitted; default drops the first and :param segments without adding pages/. |
|
|
246
|
+
| `remotes` | yes | `Record<string, string>` | Configured remotes; addresses must resolve in every dev/prod environment actually used. |
|
|
247
|
+
| `schema` | yes | `Record<string, RemoteSchemaEntry>` | Remote expose probe table; use public remoteSchema rather than internal virtual modules. |
|
|
248
|
+
| `strict` | yes | `boolean` | Page validation defaults true; false only logs errors instead of throwing and does not repair the contract. |
|
|
249
249
|
|
|
250
250
|
## PageViolation
|
|
251
251
|
|
|
@@ -255,9 +255,9 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
255
255
|
|
|
256
256
|
| Field | Optional | Type | Contract |
|
|
257
257
|
|---|---|---|---|
|
|
258
|
-
| `rule` | no | `"R1" \| "R2" \| "R3" \| "R4" \| "R5"` |
|
|
259
|
-
| `level` | no | `"error" \| "warn"` |
|
|
260
|
-
| `message` | no | `string` |
|
|
258
|
+
| `rule` | no | `"R1" \| "R2" \| "R3" \| "R4" \| "R5"` | Violation rule identifier R1–R5; see the per-page validation table. |
|
|
259
|
+
| `level` | no | `"error" \| "warn"` | error is a deterministic contract violation; warn flags an issue to assess. |
|
|
260
|
+
| `message` | no | `string` | Explanation of the actual problem and remedy for startup logs or CLI reports. |
|
|
261
261
|
|
|
262
262
|
## FgRemoteTypes — remote type registry
|
|
263
263
|
|
|
@@ -273,8 +273,7 @@ The **augmentable interface** shared by all three entries (`/runtime`, `/vue`, `
|
|
|
273
273
|
|
|
274
274
|
Framework-entry check types (re-exported by `/vue` and `/react`): `FgComponentEntry<S>` (remoteComponent accepts only exposes whose default export is a component), `FgBridgeEntry<S>` (bridge factories accept only a `defineBridgeApp` default export), `FgBridgeAppProps<S>` (bridge props extracted from the provider's declaration), `FgRemoteVueComponent<S>` / `FgReactRemoteProps<S>` (real remote component/props types), `FgVueBridgeWrapper<S>` (the Vue bridge wrapper component). Semantics and limits: [API reference · string-API entry checks](api.md#entry-checks-for-the-string-apis-type-registry).
|
|
275
275
|
|
|
276
|
-
##
|
|
277
|
-
Entry
|
|
276
|
+
## RemoteSchemaEntry
|
|
278
277
|
|
|
279
278
|
One remote expose declaration.
|
|
280
279
|
|
|
@@ -282,8 +281,8 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/runtime`, `@ful
|
|
|
282
281
|
|
|
283
282
|
| Field | Optional | Type | Contract |
|
|
284
283
|
|---|---|---|---|
|
|
285
|
-
| `exposes` | no | `string[]` |
|
|
286
|
-
| `exists` | yes | `boolean` |
|
|
284
|
+
| `exposes` | no | `string[]` | This remote’s public expose keys, compared without the ./ prefix. |
|
|
285
|
+
| `exists` | yes | `boolean` | Whether the remote manifest is verifiable; false skips its R3 check and is not verification success. |
|
|
287
286
|
|
|
288
287
|
## RemoteSchema
|
|
289
288
|
|
|
@@ -304,11 +303,11 @@ Import from: `@fulgurjs/federation/vue`.
|
|
|
304
303
|
|
|
305
304
|
| Field | Optional | Type | Contract |
|
|
306
305
|
|---|---|---|---|
|
|
307
|
-
| `loadingComponent` | yes | `Component` |
|
|
308
|
-
| `errorComponent` | yes | `Component` |
|
|
309
|
-
| `retries` | yes | `number` |
|
|
310
|
-
| `delay` | yes | `number` |
|
|
311
|
-
| `timeout` | yes | `number` |
|
|
306
|
+
| `loadingComponent` | yes | `Component` | Optional Vue loading component, unset by default; no business skeleton is generated automatically. |
|
|
307
|
+
| `errorComponent` | yes | `Component` | Vue load-error component; default diagnostics/recovery UI. A custom component takes full control and receives the error prop only. |
|
|
308
|
+
| `retries` | yes | `number` | Retry count after load failure, integer 0–10; omitted inherits the remote registration default of 2. |
|
|
309
|
+
| `delay` | yes | `number` | Delay in milliseconds before loading UI, default 200; not a request timeout. |
|
|
310
|
+
| `timeout` | yes | `number` | Adapter wait limit in milliseconds, unset by default; timing out does not cancel in-flight shared requests. |
|
|
312
311
|
|
|
313
312
|
## HostPagesOptions
|
|
314
313
|
|
|
@@ -318,16 +317,16 @@ Import from: `@fulgurjs/federation/vue`.
|
|
|
318
317
|
|
|
319
318
|
| Field | Optional | Type | Contract |
|
|
320
319
|
|---|---|---|---|
|
|
321
|
-
| `beforeLoad` | yes | `() => void \| Promise<void>` |
|
|
322
|
-
| `loadingComponent` | yes | `Component` |
|
|
323
|
-
| `errorComponent` | yes | `Component` |
|
|
324
|
-
| `delay` | yes | `number` |
|
|
325
|
-
| `pages` | no | `PageRouteLike[]` |
|
|
326
|
-
| `remotePrefixes` | no | `Record<string, string>` |
|
|
327
|
-
| `deriveSpec` | yes | `(route: string) => string` |
|
|
328
|
-
| `schema` | yes | `Record<string, RemoteSchemaEntry>` |
|
|
329
|
-
| `strict` | yes | `boolean` |
|
|
330
|
-
| `base` | yes | `string` |
|
|
320
|
+
| `beforeLoad` | yes | `() => void \| Promise<void>` | Called before each actual page-module loading attempt; may return a Promise, and is not run while creating the page table. |
|
|
321
|
+
| `loadingComponent` | yes | `Component` | Optional Vue loading component, unset by default; no business skeleton is generated automatically. |
|
|
322
|
+
| `errorComponent` | yes | `Component` | Vue load-error component; default diagnostics/recovery UI. A custom component takes full control and receives the error prop only. |
|
|
323
|
+
| `delay` | yes | `number` | Delay in milliseconds before loading UI, default 200; not a request timeout. |
|
|
324
|
+
| `pages` | no | `PageRouteLike[]` | Original shared page records; the host still registers routes. |
|
|
325
|
+
| `remotePrefixes` | no | `Record<string, string>` | Host-route-prefix to remote-name mapping, longest prefix first; unmatched routes fail during adapter creation. |
|
|
326
|
+
| `deriveSpec` | yes | `(route: string) => string` | Derives an expose key when page spec is omitted; default drops the first and :param segments without adding pages/. |
|
|
327
|
+
| `schema` | yes | `Record<string, RemoteSchemaEntry>` | Remote expose probe table; use public remoteSchema rather than internal virtual modules. |
|
|
328
|
+
| `strict` | yes | `boolean` | Page validation defaults true; false only logs errors instead of throwing and does not repair the contract. |
|
|
329
|
+
| `base` | yes | `string` | Host deployment prefix stripped during resolve, not the bridge business basePath. |
|
|
331
330
|
|
|
332
331
|
## HostPages
|
|
333
332
|
|
|
@@ -337,10 +336,10 @@ Import from: `@fulgurjs/federation/vue`.
|
|
|
337
336
|
|
|
338
337
|
| Field | Optional | Type | Contract |
|
|
339
338
|
|---|---|---|---|
|
|
340
|
-
| `pages` | no | `PageRouteLike[]` |
|
|
341
|
-
| `resolve` | no | `(path: string) => ResolvedHostPage` |
|
|
342
|
-
| `component` | no | `(spec: string) => Component` |
|
|
343
|
-
| `keepAliveNames` | no | `string[]` |
|
|
339
|
+
| `pages` | no | `PageRouteLike[]` | Original shared page records; the host still registers routes. |
|
|
340
|
+
| `resolve` | no | `(path: string) => ResolvedHostPage` | Match a path to a page, full spec and params; null when unmatched, without automatically supplying query/hash props. |
|
|
341
|
+
| `component` | no | `(spec: string) => Component` | Return a component for a full remote/expose spec; reusing a module does not keep component state alive. |
|
|
342
|
+
| `keepAliveNames` | no | `string[]` | Vue KeepAlive include names; the host must still render KeepAlive and choose max/key. |
|
|
344
343
|
|
|
345
344
|
## ResolvedHostPage
|
|
346
345
|
|
|
@@ -350,10 +349,10 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/vue`.
|
|
|
350
349
|
|
|
351
350
|
| Field | Optional | Type | Contract |
|
|
352
351
|
|---|---|---|---|
|
|
353
|
-
| `page` | no | `PageRouteLike` |
|
|
354
|
-
| `remote` | no | `string` |
|
|
355
|
-
| `spec` | no | `string` |
|
|
356
|
-
| `params` | no | `Record<string, string>` |
|
|
352
|
+
| `page` | no | `PageRouteLike` | Original page record matched by this resolution. |
|
|
353
|
+
| `remote` | no | `string` | Matched remotes registration name, not a page path. |
|
|
354
|
+
| `spec` | no | `string` | In a page table, an expose key without the remote name; in a resolved result, a full remote/expose spec. |
|
|
355
|
+
| `params` | no | `Record<string, string>` | Decoded :param path parameters, excluding query/hash. |
|
|
357
356
|
|
|
358
357
|
## BridgeApp
|
|
359
358
|
|
|
@@ -363,9 +362,9 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/vue`.
|
|
|
363
362
|
|
|
364
363
|
| Field | Optional | Type | Contract |
|
|
365
364
|
|---|---|---|---|
|
|
366
|
-
| `mount` | no | `(el: HTMLElement, props?: Record<string, unknown>, options?: BridgeMountOptions) => void \| Promise<void>` |
|
|
367
|
-
| `unmount` | no | `(el: HTMLElement) => void` |
|
|
368
|
-
| `routing` | yes | `BridgeRoutingProtocol` |
|
|
365
|
+
| `mount` | no | `(el: HTMLElement, props?: Record<string, unknown>, options?: BridgeMountOptions) => void \| Promise<void>` | Mount into the supplied container; Promise completion means first root commit, not all business async work. |
|
|
366
|
+
| `unmount` | no | `(el: HTMLElement) => void` | Synchronously invalidate/clean this container generation; throwing locks the container rather than allowing unsafe remount. |
|
|
367
|
+
| `routing` | yes | `BridgeRoutingProtocol` | Whether this contract declares URL-sync protocol support, not a router object or deployment base. |
|
|
369
368
|
|
|
370
369
|
## BridgeSession
|
|
371
370
|
|
|
@@ -417,11 +416,11 @@ Import from: `@fulgurjs/federation/vue`.
|
|
|
417
416
|
|
|
418
417
|
| Field | Optional | Type | Contract |
|
|
419
418
|
|---|---|---|---|
|
|
420
|
-
| `loadingComponent` | yes | `Component` |
|
|
421
|
-
| `errorComponent` | yes | `Component` |
|
|
422
|
-
| `retries` | yes | `number` |
|
|
423
|
-
| `timeout` | yes | `number` |
|
|
424
|
-
| `getContext` | yes | `() => Partial<AppContext> & Record<string, unknown>` |
|
|
419
|
+
| `loadingComponent` | yes | `Component` | Optional Vue loading component, unset by default; no business skeleton is generated automatically. |
|
|
420
|
+
| `errorComponent` | yes | `Component` | Vue load-error component; default diagnostics/recovery UI. A custom component takes full control and receives the error prop only. |
|
|
421
|
+
| `retries` | yes | `number` | Retry count after load failure, integer 0–10; omitted inherits the remote registration default of 2. |
|
|
422
|
+
| `timeout` | yes | `number` | Adapter wait limit in milliseconds, unset by default; timing out does not cancel in-flight shared requests. |
|
|
423
|
+
| `getContext` | yes | `() => Partial<AppContext> & Record<string, unknown>` | Side-effect-free synchronous snapshot getter before actual loading; do not call provide or return a Promise. |
|
|
425
424
|
| `session` | yes | `() => string \| number \| null \| undefined` | Reactive non-sensitive identity; managed generations. null=logout, undefined=restoring; do not combine with sessionKey. |
|
|
426
425
|
| `sessionStorageKey` | yes | `string` | Automatic session namespace; defaults to fulgurjs-bridge-session and is shared by one host. |
|
|
427
426
|
|
|
@@ -434,8 +433,8 @@ Import from: `@fulgurjs/federation/vue`.
|
|
|
434
433
|
|
|
435
434
|
| Field | Optional | Type | Contract |
|
|
436
435
|
|---|---|---|---|
|
|
437
|
-
| `ready` | no | `Promise<void>` |
|
|
438
|
-
| `dispose` | no | `() => void` |
|
|
436
|
+
| `ready` | no | `Promise<void>` | Promise for initial controlled navigation; await before installing the Vue router. |
|
|
437
|
+
| `dispose` | no | `() => void` | Idempotently release this routing connection/subscriptions, not unrelated application resources. |
|
|
439
438
|
|
|
440
439
|
## BridgeHostRouting
|
|
441
440
|
|
|
@@ -445,8 +444,8 @@ Import from: `@fulgurjs/federation/react`, `@fulgurjs/federation/vue`.
|
|
|
445
444
|
|
|
446
445
|
| Field | Optional | Type | Contract |
|
|
447
446
|
|---|---|---|---|
|
|
448
|
-
| `basePath` | no | `string` |
|
|
449
|
-
| `navigation` | no | `BridgeHostNavigation` |
|
|
447
|
+
| `basePath` | no | `string` | Static absolute host logical-route prefix, excluding deployment base/query/hash/wildcards; same-page prefixes cannot overlap. |
|
|
448
|
+
| `navigation` | no | `BridgeHostNavigation` | Host navigation port created by its framework adapter; the host owns browser history. |
|
|
450
449
|
|
|
451
450
|
## ReactBridgeAppOptions
|
|
452
451
|
|
|
@@ -456,11 +455,11 @@ Import from: `@fulgurjs/federation/react`.
|
|
|
456
455
|
|
|
457
456
|
| Field | Optional | Type | Contract |
|
|
458
457
|
|---|---|---|---|
|
|
459
|
-
| `fallback` | yes | `ReactNode` |
|
|
460
|
-
| `error` | yes | `ReactNode \| BridgeErrorFallback` |
|
|
461
|
-
| `retries` | yes | `number` |
|
|
462
|
-
| `timeout` | yes | `number` |
|
|
463
|
-
| `getContext` | yes | `() => Partial<AppContext> & Record<string, unknown>` |
|
|
458
|
+
| `fallback` | yes | `ReactNode` | React pending UI, default null; not a replacement business module after failure. |
|
|
459
|
+
| `error` | yes | `ReactNode \| BridgeErrorFallback` | React error UI node or render function; defaults to built-in diagnostics/recovery. |
|
|
460
|
+
| `retries` | yes | `number` | Retry count after load failure, integer 0–10; omitted inherits the remote registration default of 2. |
|
|
461
|
+
| `timeout` | yes | `number` | Adapter wait limit in milliseconds, unset by default; timing out does not cancel in-flight shared requests. |
|
|
462
|
+
| `getContext` | yes | `() => Partial<AppContext> & Record<string, unknown>` | Side-effect-free synchronous snapshot getter before actual loading; do not call provide or return a Promise. |
|
|
464
463
|
|
|
465
464
|
## BridgeErrorFallback
|
|
466
465
|
|
|
@@ -480,10 +479,10 @@ Import from: `@fulgurjs/federation/react`.
|
|
|
480
479
|
|
|
481
480
|
| Field | Optional | Type | Contract |
|
|
482
481
|
|---|---|---|---|
|
|
483
|
-
| `fallback` | yes | `ReactNode` |
|
|
484
|
-
| `error` | yes | `ReactNode \| RemoteErrorFallback` |
|
|
485
|
-
| `retries` | yes | `number` |
|
|
486
|
-
| `timeout` | yes | `number` |
|
|
482
|
+
| `fallback` | yes | `ReactNode` | React pending UI, default null; not a replacement business module after failure. |
|
|
483
|
+
| `error` | yes | `ReactNode \| RemoteErrorFallback` | React error UI node or render function; defaults to built-in diagnostics/recovery. |
|
|
484
|
+
| `retries` | yes | `number` | Retry count after load failure, integer 0–10; omitted inherits the remote registration default of 2. |
|
|
485
|
+
| `timeout` | yes | `number` | Adapter wait limit in milliseconds, unset by default; timing out does not cancel in-flight shared requests. |
|
|
487
486
|
|
|
488
487
|
## RemoteErrorFallback
|
|
489
488
|
|
|
@@ -503,9 +502,9 @@ Import from: `@fulgurjs/federation/react`.
|
|
|
503
502
|
|
|
504
503
|
| Field | Optional | Type | Contract |
|
|
505
504
|
|---|---|---|---|
|
|
506
|
-
| `shareScope` | yes | `string` |
|
|
507
|
-
| `retries` | yes | `number` |
|
|
508
|
-
| `fallbackModule` | yes | `() => any` |
|
|
505
|
+
| `shareScope` | yes | `string` | Sharing group name; scopes negotiate independently, default default. |
|
|
506
|
+
| `retries` | yes | `number` | Retry count after load failure, integer 0–10; omitted inherits the remote registration default of 2. |
|
|
507
|
+
| `fallbackModule` | yes | `() => any` | Explicit replacement module after remote module loading failure; initialization failures still reject rather than being hidden. |
|
|
509
508
|
|
|
510
509
|
## UseLoadRemoteResult
|
|
511
510
|
|
|
@@ -515,10 +514,10 @@ Import from: `@fulgurjs/federation/react`.
|
|
|
515
514
|
|
|
516
515
|
| Field | Optional | Type | Contract |
|
|
517
516
|
|---|---|---|---|
|
|
518
|
-
| `data` | no | `Module` |
|
|
519
|
-
| `error` | no | `unknown` |
|
|
520
|
-
| `loading` | no | `boolean` |
|
|
521
|
-
| `reload` | no | `() => Promise<void>` |
|
|
517
|
+
| `data` | no | `Module` | Current successfully loaded module; undefined before completion, at retry start or after failure. |
|
|
518
|
+
| `error` | no | `unknown` | Current loading error, undefined when clear; isolated per attempt rather than retaining an earlier error. |
|
|
519
|
+
| `loading` | no | `boolean` | Whether this hook attempt is pending, not global application loading state. |
|
|
520
|
+
| `reload` | no | `() => Promise<void>` | Restart the hook attempt, returning Promise<void>; successful cached modules are reused and no requests start after unmount. |
|
|
522
521
|
|
|
523
522
|
## RemoteErrorBoundaryProps
|
|
524
523
|
|
|
@@ -528,10 +527,10 @@ Import from: `@fulgurjs/federation/react`.
|
|
|
528
527
|
|
|
529
528
|
| Field | Optional | Type | Contract |
|
|
530
529
|
|---|---|---|---|
|
|
531
|
-
| `children` | yes | `ReactNode` |
|
|
532
|
-
| `fallback` | yes | `ReactNode \| ((args: { error: unknown; reset: () => void; }) => ReactNode)` |
|
|
533
|
-
| `onError` | yes | `(error: unknown, info: ErrorInfo) => void` |
|
|
534
|
-
| `resetKeys` | yes | `readonly unknown[]` |
|
|
530
|
+
| `children` | yes | `ReactNode` | React subtree protected by the boundary; excludes internal errors of a separate bridged root. |
|
|
531
|
+
| `fallback` | yes | `ReactNode \| ((args: { error: unknown; reset: () => void; }) => ReactNode)` | Render-error UI node or function receiving error/reset, not pending UI. |
|
|
532
|
+
| `onError` | yes | `(error: unknown, info: ErrorInfo) => void` | Logging callback for captured render errors, receiving error/info; does not catch event-handler exceptions. |
|
|
533
|
+
| `resetKeys` | yes | `readonly unknown[]` | Reset the React error boundary when any key changes; does not clear external React.lazy failed caches. |
|
|
535
534
|
|
|
536
535
|
## ReactHostPagesOptions
|
|
537
536
|
|
|
@@ -541,17 +540,17 @@ Import from: `@fulgurjs/federation/react`.
|
|
|
541
540
|
|
|
542
541
|
| Field | Optional | Type | Contract |
|
|
543
542
|
|---|---|---|---|
|
|
544
|
-
| `beforeLoad` | yes | `() => void \| Promise<void>` |
|
|
545
|
-
| `fallback` | yes | `ReactNode` |
|
|
546
|
-
| `error` | yes | `ReactNode \| RemoteErrorFallback` |
|
|
547
|
-
| `retries` | yes | `number` |
|
|
548
|
-
| `timeout` | yes | `number` |
|
|
549
|
-
| `pages` | no | `PageRouteLike[]` |
|
|
550
|
-
| `remotePrefixes` | no | `Record<string, string>` |
|
|
551
|
-
| `deriveSpec` | yes | `(route: string) => string` |
|
|
552
|
-
| `schema` | yes | `Record<string, RemoteSchemaEntry>` |
|
|
553
|
-
| `strict` | yes | `boolean` |
|
|
554
|
-
| `base` | yes | `string` |
|
|
543
|
+
| `beforeLoad` | yes | `() => void \| Promise<void>` | Called before each actual page-module loading attempt; may return a Promise, and is not run while creating the page table. |
|
|
544
|
+
| `fallback` | yes | `ReactNode` | React pending UI, default null; not a replacement business module after failure. |
|
|
545
|
+
| `error` | yes | `ReactNode \| RemoteErrorFallback` | React error UI node or render function; defaults to built-in diagnostics/recovery. |
|
|
546
|
+
| `retries` | yes | `number` | Retry count after load failure, integer 0–10; omitted inherits the remote registration default of 2. |
|
|
547
|
+
| `timeout` | yes | `number` | Adapter wait limit in milliseconds, unset by default; timing out does not cancel in-flight shared requests. |
|
|
548
|
+
| `pages` | no | `PageRouteLike[]` | Original shared page records; the host still registers routes. |
|
|
549
|
+
| `remotePrefixes` | no | `Record<string, string>` | Host-route-prefix to remote-name mapping, longest prefix first; unmatched routes fail during adapter creation. |
|
|
550
|
+
| `deriveSpec` | yes | `(route: string) => string` | Derives an expose key when page spec is omitted; default drops the first and :param segments without adding pages/. |
|
|
551
|
+
| `schema` | yes | `Record<string, RemoteSchemaEntry>` | Remote expose probe table; use public remoteSchema rather than internal virtual modules. |
|
|
552
|
+
| `strict` | yes | `boolean` | Page validation defaults true; false only logs errors instead of throwing and does not repair the contract. |
|
|
553
|
+
| `base` | yes | `string` | Host deployment prefix stripped during resolve, not the bridge business basePath. |
|
|
555
554
|
|
|
556
555
|
## ReactHostPages
|
|
557
556
|
|
|
@@ -561,9 +560,9 @@ Import from: `@fulgurjs/federation/react`.
|
|
|
561
560
|
|
|
562
561
|
| Field | Optional | Type | Contract |
|
|
563
562
|
|---|---|---|---|
|
|
564
|
-
| `pages` | no | `PageRouteLike[]` |
|
|
565
|
-
| `resolve` | no | `(path: string) => ResolvedHostPage` |
|
|
566
|
-
| `component` | no | `<P = Record<string, unknown>>(spec: string) => ComponentType<P>` |
|
|
563
|
+
| `pages` | no | `PageRouteLike[]` | Original shared page records; the host still registers routes. |
|
|
564
|
+
| `resolve` | no | `(path: string) => ResolvedHostPage` | Match a path to a page, full spec and params; null when unmatched, without automatically supplying query/hash props. |
|
|
565
|
+
| `component` | no | `<P = Record<string, unknown>>(spec: string) => ComponentType<P>` | Return a component for a full remote/expose spec; reusing a module does not keep component state alive. |
|
|
567
566
|
|
|
568
567
|
## ReactBridgeAppContext
|
|
569
568
|
|
|
@@ -631,4 +630,4 @@ Import Vue options from /vue and React options from /react. defineApplication an
|
|
|
631
630
|
|
|
632
631
|
| Field | Optional | Type | Default and purpose |
|
|
633
632
|
|---|---|---|---|
|
|
634
|
-
| routing | yes | boolean | false; true declares host URL synchronization. defineApplication can also install a local memory router without synchronization. |
|
|
633
|
+
| `routing` | yes | `boolean` | false; true declares host URL synchronization. defineApplication can also install a local memory router without synchronization. |
|