@module-federation/observability-plugin 2.5.6 → 2.6.1
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 +220 -3
- package/dist/CHANGELOG.md +19 -0
- package/dist/README.md +220 -3
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/chrome-devtool.d.ts +1 -1
- package/dist/chrome-devtool.js +1 -1
- package/dist/core-C0012OCG.js +4339 -0
- package/dist/esm/browser.js +1 -1
- package/dist/esm/chrome-devtool.js +1 -1
- package/dist/esm/core-t1FzL-KJ.js +4333 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/node.js +1 -1
- package/dist/index-C2QnWnLb.d.ts +618 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/package.json +6 -3
- package/dist/core--1ofIHU9.js +0 -2042
- package/dist/core-Db-z5jD3.d.ts +0 -335
- package/dist/esm/core-4ykFjWWj.js +0 -2036
package/README.md
CHANGED
|
@@ -84,6 +84,13 @@ main flow started, succeeded, or failed. This plugin listens to those hooks,
|
|
|
84
84
|
derives detailed reasons like shared version mismatch or eager boundary issues,
|
|
85
85
|
and exposes the final loading state through a small `summary` object:
|
|
86
86
|
|
|
87
|
+
Runtime Core deliberately keeps this boundary narrow. It registers and invokes
|
|
88
|
+
the lifecycle hooks with raw facts from the real execution path. Candidate
|
|
89
|
+
lists, shared selection and registration reasons, resource and Bridge timing,
|
|
90
|
+
error classification, correlation, and sanitization are all derived here in
|
|
91
|
+
the observability plugin. Applications that do not install this plugin do not
|
|
92
|
+
pay for report construction or keep observability state in Runtime Core.
|
|
93
|
+
|
|
87
94
|
- `runtime-loaded`: Module Federation finished loading the remote module.
|
|
88
95
|
- `component-loaded`: business code called `markComponentLoaded`, or a producer
|
|
89
96
|
called the injected `onMFRemoteLoaded` callback.
|
|
@@ -125,9 +132,9 @@ arrays.
|
|
|
125
132
|
|
|
126
133
|
Runtime resource hooks also receive a `resourceContext` object on manifest,
|
|
127
134
|
remoteEntry, preload JS, and preload CSS resource loads. It contains
|
|
128
|
-
`initiator`, `id`, `resourceType`,
|
|
129
|
-
the resource was requested by `loadRemote
|
|
130
|
-
the URL.
|
|
135
|
+
`initiator`, `id`, `resourceType`, `url`, and `expose` when available, so custom
|
|
136
|
+
loaders can tell whether the resource was requested by `loadRemote`,
|
|
137
|
+
`preloadRemote`, or `loadShare` without parsing the URL.
|
|
131
138
|
|
|
132
139
|
The report also keeps compact loading state under `summary`. It contains the
|
|
133
140
|
final outcome, per-phase status and duration under `summary.phases`, safe
|
|
@@ -148,6 +155,216 @@ For agent-led debugging, use the repository's single `mf` skill entry with the
|
|
|
148
155
|
`observability` sub-command. The skill is the maintained guide for reading
|
|
149
156
|
reports and deciding the next debugging step.
|
|
150
157
|
|
|
158
|
+
## Divebell targets
|
|
159
|
+
|
|
160
|
+
When `divebell` is enabled, the observability plugin syncs Module Federation
|
|
161
|
+
loading state into Divebell targets. The host application does not need to
|
|
162
|
+
import Divebell directly.
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
ObservabilityPlugin({
|
|
166
|
+
level: 'verbose',
|
|
167
|
+
divebell: {
|
|
168
|
+
source: 'module-federation',
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
`divebell: true` uses the Divebell runtime found on `window`, or creates and
|
|
174
|
+
installs one when needed. The object form also accepts `enabled`, `source`, a
|
|
175
|
+
custom `runtime`, or a custom browser `host`. Set `enabled: false` to keep a
|
|
176
|
+
shared configuration object while disabling synchronization.
|
|
177
|
+
|
|
178
|
+
Use the Divebell CLI to inspect the page:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
divebell targets --url "http://127.0.0.1:3005/observability"
|
|
182
|
+
divebell snapshot --url "http://127.0.0.1:3005/observability"
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `mf:remote:<remoteName>`
|
|
186
|
+
|
|
187
|
+
Type: `mf.remote`
|
|
188
|
+
|
|
189
|
+
This target represents the remote instance as a whole. Use it to understand
|
|
190
|
+
whether a remote is currently known, loading, ready, failed, or recovered. Do
|
|
191
|
+
not use the remote target to prove that a specific exposed module is ready; use
|
|
192
|
+
the expose target for that.
|
|
193
|
+
|
|
194
|
+
Statuses:
|
|
195
|
+
|
|
196
|
+
- `registered`: the remote is known, but no clear loading result has been
|
|
197
|
+
observed yet.
|
|
198
|
+
- `loading`: a remote lifecycle phase is currently in progress.
|
|
199
|
+
- `ready`: the latest relevant remote lifecycle phase completed successfully.
|
|
200
|
+
- `error`: a remote lifecycle phase failed and no recovery result was observed.
|
|
201
|
+
- `recovered`: loading hit an error path, but Module Federation returned a
|
|
202
|
+
recovery result.
|
|
203
|
+
|
|
204
|
+
Snapshot data:
|
|
205
|
+
|
|
206
|
+
- `instanceRef`: stable observability reference for the latest MF instance.
|
|
207
|
+
- `hostName`: array of host or consumer names observed for this remote.
|
|
208
|
+
- `runtimeVersion`: Module Federation runtime version from the latest report.
|
|
209
|
+
- `remote`: remote definition fields such as `name`, `alias`, `entry`,
|
|
210
|
+
`entryGlobalName`, and `type`.
|
|
211
|
+
- `exposes`: array of `{ targetId }` entries. Each target id points to a
|
|
212
|
+
`mf:remote:<remoteName>:expose:<exposeName>` target.
|
|
213
|
+
- `reportCount`: number of related reports used to build this remote snapshot.
|
|
214
|
+
|
|
215
|
+
The plugin does not create separate `mf:manifest:*`, `mf:remote-entry:*`, or
|
|
216
|
+
`mf:consumer:*` targets. Manifest and remoteEntry details are kept as phases on
|
|
217
|
+
the remote or expose data.
|
|
218
|
+
|
|
219
|
+
Common wait:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
divebell wait-for mf:remote:runtime_remote2 ready --url "http://127.0.0.1:3005/observability"
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### `mf:remote:<remoteName>:expose:<exposeName>`
|
|
226
|
+
|
|
227
|
+
Type: `mf.remote.expose`
|
|
228
|
+
|
|
229
|
+
This target represents one exposed module request from a remote. Use it when an
|
|
230
|
+
agent needs to wait until a specific remote module is usable.
|
|
231
|
+
|
|
232
|
+
Statuses are the same as `mf.remote`:
|
|
233
|
+
|
|
234
|
+
- `registered`
|
|
235
|
+
- `loading`
|
|
236
|
+
- `ready`
|
|
237
|
+
- `error`
|
|
238
|
+
- `recovered`
|
|
239
|
+
|
|
240
|
+
Snapshot data:
|
|
241
|
+
|
|
242
|
+
- `instanceRef`: stable observability reference for the MF instance.
|
|
243
|
+
- `traceId`: report id for the latest matching trace.
|
|
244
|
+
- `requestId`: requested remote module id, for example
|
|
245
|
+
`runtime_remote2/ButtonOldAnt`.
|
|
246
|
+
- `requestAlias`: request alias when Module Federation provides one.
|
|
247
|
+
- `hostName`: array of host or consumer names observed for this expose.
|
|
248
|
+
- `runtimeVersion`: Module Federation runtime version from the latest report.
|
|
249
|
+
- `consumers`: consumer names that loaded this expose.
|
|
250
|
+
- `lastPhase`: latest phase name from the report summary.
|
|
251
|
+
- `phases`: phase summary, including entries such as `matchRemote`,
|
|
252
|
+
`manifest`, `remoteEntry`, `remoteEntryInit`, `expose`, and `loadRemote`.
|
|
253
|
+
- `loadedBefore`: cached producer/consumer information when the runtime reports
|
|
254
|
+
that this module was already loaded.
|
|
255
|
+
|
|
256
|
+
The expose target does not repeat `remote`, `expose`, `status`, `state`,
|
|
257
|
+
`outcome`, or `currentPhase` inside `data`. The target id and outer target
|
|
258
|
+
status already carry that information.
|
|
259
|
+
|
|
260
|
+
Common wait:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
divebell wait-for mf:remote:runtime_remote2:expose:ButtonOldAnt ready --url "http://127.0.0.1:3005/observability"
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### `mf:shared:<sharedName>:<version>:<shareScope>`
|
|
267
|
+
|
|
268
|
+
Type: `mf.shared`
|
|
269
|
+
|
|
270
|
+
This target represents one observed shared dependency entry. The id includes
|
|
271
|
+
the shared package name, selected or requested version, and share scope. The
|
|
272
|
+
plugin only registers shared targets that have been observed by the runtime.
|
|
273
|
+
|
|
274
|
+
Statuses:
|
|
275
|
+
|
|
276
|
+
- `unloaded`: the shared dependency was observed, but no active loading or
|
|
277
|
+
loaded signal was seen.
|
|
278
|
+
- `loading`: shared loading has started or the shared entry is currently
|
|
279
|
+
loading.
|
|
280
|
+
- `loaded`: the shared entry was loaded or resolved successfully.
|
|
281
|
+
- `recovered`: shared loading hit a handled fallback path, such as a
|
|
282
|
+
bundler-runtime provided shared entry.
|
|
283
|
+
- `error`: shared loading failed.
|
|
284
|
+
|
|
285
|
+
Snapshot data:
|
|
286
|
+
|
|
287
|
+
- `instanceRef`: stable observability reference for the MF instance.
|
|
288
|
+
- `traceId`: report id for the latest matching trace.
|
|
289
|
+
- `requestId`: shared request id.
|
|
290
|
+
- `hostName`: Module Federation host name that resolved the shared dependency.
|
|
291
|
+
- `runtimeVersion`: Module Federation runtime version.
|
|
292
|
+
- `shared.name`: shared package name.
|
|
293
|
+
- `shared.shareScope`: share scope array.
|
|
294
|
+
- `shared.version`: version used in the target id.
|
|
295
|
+
- `shared.requiredVersion`: requested version range when available.
|
|
296
|
+
- `shared.provider`: selected provider when available.
|
|
297
|
+
- `shared.singleton`, `shared.strictVersion`, `shared.eager`,
|
|
298
|
+
`shared.strategy`: shared config details when available.
|
|
299
|
+
- `shared.loaded`: whether the shared entry is loaded.
|
|
300
|
+
- `shared.loading`: included only while the shared entry is loading. It is
|
|
301
|
+
omitted once `loaded` is true.
|
|
302
|
+
- `shared.reason`: reason such as `sync-async-boundary` or
|
|
303
|
+
`custom-share-info-unmatched`.
|
|
304
|
+
- `shared.definedBy`: `bundler-runtime` when the runtime reports a handled
|
|
305
|
+
bundler-runtime shared path.
|
|
306
|
+
- `lastPhase`: latest phase name from the report summary.
|
|
307
|
+
- `phases`: phase summary for shared loading.
|
|
308
|
+
|
|
309
|
+
The shared snapshot intentionally omits `selectedVersion`,
|
|
310
|
+
`availableVersions`, `get`, `useIn`, and `from`. If a user needs broader
|
|
311
|
+
runtime global state, use the Divebell actions below.
|
|
312
|
+
|
|
313
|
+
Common waits:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
divebell wait-for mf:shared:observability-provider-choice:2.0.0:observability-provider-scope loaded --url "http://127.0.0.1:3005/observability"
|
|
317
|
+
divebell wait-for mf:shared:observability-async-shared:1.0.0:default error --url "http://127.0.0.1:3005/observability"
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### `mf:shared-conflict:<sharedName>:<shareScope>`
|
|
321
|
+
|
|
322
|
+
Type: `mf.shared.conflict`
|
|
323
|
+
|
|
324
|
+
This target is created when the plugin observes multiple versions of a
|
|
325
|
+
singleton shared dependency. Its status is `warning`. Snapshot data includes
|
|
326
|
+
the stable `instanceRef`, `traceId`, shared name and scope, current provider and
|
|
327
|
+
version, all observed versions, and the compact shared snapshot. Use the normal
|
|
328
|
+
`mf:shared:*` target to inspect loading state; use this conflict target to
|
|
329
|
+
diagnose singleton version drift.
|
|
330
|
+
|
|
331
|
+
### Actions
|
|
332
|
+
|
|
333
|
+
The plugin also registers safe Divebell actions for deeper inspection:
|
|
334
|
+
|
|
335
|
+
- `mf:list-reports`: list report summaries. Supports filters such as `remote`,
|
|
336
|
+
`expose`, `shared`, `traceId`, `instanceRef`, `status`, and `outcome`.
|
|
337
|
+
- `mf:get-runtime-state`: read the current safe multi-instance runtime state.
|
|
338
|
+
- `mf:get-latest-report`: read the latest report.
|
|
339
|
+
- `mf:get-report`: read one report by `traceId`.
|
|
340
|
+
- `mf:export-report`: export a report, defaulting to the latest report.
|
|
341
|
+
- `mf:get-federation-global`: read a compact summary of the current
|
|
342
|
+
`__FEDERATION__` or `__VMOK__` global.
|
|
343
|
+
- `mf:get-federation-module-info`: read `moduleInfo` or one `moduleInfo` entry.
|
|
344
|
+
- `mf:list-federation-instances`: list current runtime instances.
|
|
345
|
+
- `mf:get-federation-instance-config`: read one runtime instance config.
|
|
346
|
+
|
|
347
|
+
Example:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
divebell run-action mf:list-reports --url "http://127.0.0.1:3005/observability" --payload '{"remote":"runtime_remote2"}'
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Multi-instance runtime state
|
|
354
|
+
|
|
355
|
+
The browser reader and `mf:get-runtime-state` action return the same safe state
|
|
356
|
+
model:
|
|
357
|
+
|
|
358
|
+
```ts
|
|
359
|
+
window.__FEDERATION__.__OBSERVABILITY__.host.getRuntimeState();
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
The result includes stable `instanceRef` values, instance roles and evidence,
|
|
363
|
+
known remotes and loaded producers, share-scope summaries, Bridge state,
|
|
364
|
+
consumer-to-producer relationships, deployment `moduleInfo`, and capability
|
|
365
|
+
completeness. Use `instanceRef` when filtering reports or selecting an instance;
|
|
366
|
+
array indexes are only a compatibility fallback and are not stable identifiers.
|
|
367
|
+
|
|
151
368
|
`errorLoadShare` is used only for observation. Shared dependency miss, version
|
|
152
369
|
mismatch, and eager boundary errors are not retried by the retry plugin by
|
|
153
370
|
default because they are usually configuration or availability problems instead
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @module-federation/observability-plugin
|
|
2
2
|
|
|
3
|
+
## 2.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @module-federation/sdk@2.9.1
|
|
8
|
+
|
|
9
|
+
## 2.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- df8b40f: Add Divebell synchronization on `@divebell/core` 0.0.23 and safe multi-instance runtime state with stable report and relationship association.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- df8b40f: Extend the existing Bridge render and destroy hooks with semantic context, add a route synchronization hook, and keep timing, sanitization, and correlation in the observability plugin.
|
|
18
|
+
- df8b40f: Extend the semantic shared registration and resolution hooks with explicit load context, re-export the shared-version `satisfy` helper, and keep provider, candidate, and selection diagnostics in the observability plugin while ignoring legacy share-scope metadata.
|
|
19
|
+
- df8b40f: Extend the semantic manifest, remote entry, and preload hooks with resource context and results, while keeping cache, timing, timeout, failure, and recovery diagnostics in the observability plugin.
|
|
20
|
+
- @module-federation/sdk@2.9.0
|
|
21
|
+
|
|
3
22
|
## 2.5.6
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/README.md
CHANGED
|
@@ -84,6 +84,13 @@ main flow started, succeeded, or failed. This plugin listens to those hooks,
|
|
|
84
84
|
derives detailed reasons like shared version mismatch or eager boundary issues,
|
|
85
85
|
and exposes the final loading state through a small `summary` object:
|
|
86
86
|
|
|
87
|
+
Runtime Core deliberately keeps this boundary narrow. It registers and invokes
|
|
88
|
+
the lifecycle hooks with raw facts from the real execution path. Candidate
|
|
89
|
+
lists, shared selection and registration reasons, resource and Bridge timing,
|
|
90
|
+
error classification, correlation, and sanitization are all derived here in
|
|
91
|
+
the observability plugin. Applications that do not install this plugin do not
|
|
92
|
+
pay for report construction or keep observability state in Runtime Core.
|
|
93
|
+
|
|
87
94
|
- `runtime-loaded`: Module Federation finished loading the remote module.
|
|
88
95
|
- `component-loaded`: business code called `markComponentLoaded`, or a producer
|
|
89
96
|
called the injected `onMFRemoteLoaded` callback.
|
|
@@ -125,9 +132,9 @@ arrays.
|
|
|
125
132
|
|
|
126
133
|
Runtime resource hooks also receive a `resourceContext` object on manifest,
|
|
127
134
|
remoteEntry, preload JS, and preload CSS resource loads. It contains
|
|
128
|
-
`initiator`, `id`, `resourceType`,
|
|
129
|
-
the resource was requested by `loadRemote
|
|
130
|
-
the URL.
|
|
135
|
+
`initiator`, `id`, `resourceType`, `url`, and `expose` when available, so custom
|
|
136
|
+
loaders can tell whether the resource was requested by `loadRemote`,
|
|
137
|
+
`preloadRemote`, or `loadShare` without parsing the URL.
|
|
131
138
|
|
|
132
139
|
The report also keeps compact loading state under `summary`. It contains the
|
|
133
140
|
final outcome, per-phase status and duration under `summary.phases`, safe
|
|
@@ -148,6 +155,216 @@ For agent-led debugging, use the repository's single `mf` skill entry with the
|
|
|
148
155
|
`observability` sub-command. The skill is the maintained guide for reading
|
|
149
156
|
reports and deciding the next debugging step.
|
|
150
157
|
|
|
158
|
+
## Divebell targets
|
|
159
|
+
|
|
160
|
+
When `divebell` is enabled, the observability plugin syncs Module Federation
|
|
161
|
+
loading state into Divebell targets. The host application does not need to
|
|
162
|
+
import Divebell directly.
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
ObservabilityPlugin({
|
|
166
|
+
level: 'verbose',
|
|
167
|
+
divebell: {
|
|
168
|
+
source: 'module-federation',
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
`divebell: true` uses the Divebell runtime found on `window`, or creates and
|
|
174
|
+
installs one when needed. The object form also accepts `enabled`, `source`, a
|
|
175
|
+
custom `runtime`, or a custom browser `host`. Set `enabled: false` to keep a
|
|
176
|
+
shared configuration object while disabling synchronization.
|
|
177
|
+
|
|
178
|
+
Use the Divebell CLI to inspect the page:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
divebell targets --url "http://127.0.0.1:3005/observability"
|
|
182
|
+
divebell snapshot --url "http://127.0.0.1:3005/observability"
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `mf:remote:<remoteName>`
|
|
186
|
+
|
|
187
|
+
Type: `mf.remote`
|
|
188
|
+
|
|
189
|
+
This target represents the remote instance as a whole. Use it to understand
|
|
190
|
+
whether a remote is currently known, loading, ready, failed, or recovered. Do
|
|
191
|
+
not use the remote target to prove that a specific exposed module is ready; use
|
|
192
|
+
the expose target for that.
|
|
193
|
+
|
|
194
|
+
Statuses:
|
|
195
|
+
|
|
196
|
+
- `registered`: the remote is known, but no clear loading result has been
|
|
197
|
+
observed yet.
|
|
198
|
+
- `loading`: a remote lifecycle phase is currently in progress.
|
|
199
|
+
- `ready`: the latest relevant remote lifecycle phase completed successfully.
|
|
200
|
+
- `error`: a remote lifecycle phase failed and no recovery result was observed.
|
|
201
|
+
- `recovered`: loading hit an error path, but Module Federation returned a
|
|
202
|
+
recovery result.
|
|
203
|
+
|
|
204
|
+
Snapshot data:
|
|
205
|
+
|
|
206
|
+
- `instanceRef`: stable observability reference for the latest MF instance.
|
|
207
|
+
- `hostName`: array of host or consumer names observed for this remote.
|
|
208
|
+
- `runtimeVersion`: Module Federation runtime version from the latest report.
|
|
209
|
+
- `remote`: remote definition fields such as `name`, `alias`, `entry`,
|
|
210
|
+
`entryGlobalName`, and `type`.
|
|
211
|
+
- `exposes`: array of `{ targetId }` entries. Each target id points to a
|
|
212
|
+
`mf:remote:<remoteName>:expose:<exposeName>` target.
|
|
213
|
+
- `reportCount`: number of related reports used to build this remote snapshot.
|
|
214
|
+
|
|
215
|
+
The plugin does not create separate `mf:manifest:*`, `mf:remote-entry:*`, or
|
|
216
|
+
`mf:consumer:*` targets. Manifest and remoteEntry details are kept as phases on
|
|
217
|
+
the remote or expose data.
|
|
218
|
+
|
|
219
|
+
Common wait:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
divebell wait-for mf:remote:runtime_remote2 ready --url "http://127.0.0.1:3005/observability"
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### `mf:remote:<remoteName>:expose:<exposeName>`
|
|
226
|
+
|
|
227
|
+
Type: `mf.remote.expose`
|
|
228
|
+
|
|
229
|
+
This target represents one exposed module request from a remote. Use it when an
|
|
230
|
+
agent needs to wait until a specific remote module is usable.
|
|
231
|
+
|
|
232
|
+
Statuses are the same as `mf.remote`:
|
|
233
|
+
|
|
234
|
+
- `registered`
|
|
235
|
+
- `loading`
|
|
236
|
+
- `ready`
|
|
237
|
+
- `error`
|
|
238
|
+
- `recovered`
|
|
239
|
+
|
|
240
|
+
Snapshot data:
|
|
241
|
+
|
|
242
|
+
- `instanceRef`: stable observability reference for the MF instance.
|
|
243
|
+
- `traceId`: report id for the latest matching trace.
|
|
244
|
+
- `requestId`: requested remote module id, for example
|
|
245
|
+
`runtime_remote2/ButtonOldAnt`.
|
|
246
|
+
- `requestAlias`: request alias when Module Federation provides one.
|
|
247
|
+
- `hostName`: array of host or consumer names observed for this expose.
|
|
248
|
+
- `runtimeVersion`: Module Federation runtime version from the latest report.
|
|
249
|
+
- `consumers`: consumer names that loaded this expose.
|
|
250
|
+
- `lastPhase`: latest phase name from the report summary.
|
|
251
|
+
- `phases`: phase summary, including entries such as `matchRemote`,
|
|
252
|
+
`manifest`, `remoteEntry`, `remoteEntryInit`, `expose`, and `loadRemote`.
|
|
253
|
+
- `loadedBefore`: cached producer/consumer information when the runtime reports
|
|
254
|
+
that this module was already loaded.
|
|
255
|
+
|
|
256
|
+
The expose target does not repeat `remote`, `expose`, `status`, `state`,
|
|
257
|
+
`outcome`, or `currentPhase` inside `data`. The target id and outer target
|
|
258
|
+
status already carry that information.
|
|
259
|
+
|
|
260
|
+
Common wait:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
divebell wait-for mf:remote:runtime_remote2:expose:ButtonOldAnt ready --url "http://127.0.0.1:3005/observability"
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### `mf:shared:<sharedName>:<version>:<shareScope>`
|
|
267
|
+
|
|
268
|
+
Type: `mf.shared`
|
|
269
|
+
|
|
270
|
+
This target represents one observed shared dependency entry. The id includes
|
|
271
|
+
the shared package name, selected or requested version, and share scope. The
|
|
272
|
+
plugin only registers shared targets that have been observed by the runtime.
|
|
273
|
+
|
|
274
|
+
Statuses:
|
|
275
|
+
|
|
276
|
+
- `unloaded`: the shared dependency was observed, but no active loading or
|
|
277
|
+
loaded signal was seen.
|
|
278
|
+
- `loading`: shared loading has started or the shared entry is currently
|
|
279
|
+
loading.
|
|
280
|
+
- `loaded`: the shared entry was loaded or resolved successfully.
|
|
281
|
+
- `recovered`: shared loading hit a handled fallback path, such as a
|
|
282
|
+
bundler-runtime provided shared entry.
|
|
283
|
+
- `error`: shared loading failed.
|
|
284
|
+
|
|
285
|
+
Snapshot data:
|
|
286
|
+
|
|
287
|
+
- `instanceRef`: stable observability reference for the MF instance.
|
|
288
|
+
- `traceId`: report id for the latest matching trace.
|
|
289
|
+
- `requestId`: shared request id.
|
|
290
|
+
- `hostName`: Module Federation host name that resolved the shared dependency.
|
|
291
|
+
- `runtimeVersion`: Module Federation runtime version.
|
|
292
|
+
- `shared.name`: shared package name.
|
|
293
|
+
- `shared.shareScope`: share scope array.
|
|
294
|
+
- `shared.version`: version used in the target id.
|
|
295
|
+
- `shared.requiredVersion`: requested version range when available.
|
|
296
|
+
- `shared.provider`: selected provider when available.
|
|
297
|
+
- `shared.singleton`, `shared.strictVersion`, `shared.eager`,
|
|
298
|
+
`shared.strategy`: shared config details when available.
|
|
299
|
+
- `shared.loaded`: whether the shared entry is loaded.
|
|
300
|
+
- `shared.loading`: included only while the shared entry is loading. It is
|
|
301
|
+
omitted once `loaded` is true.
|
|
302
|
+
- `shared.reason`: reason such as `sync-async-boundary` or
|
|
303
|
+
`custom-share-info-unmatched`.
|
|
304
|
+
- `shared.definedBy`: `bundler-runtime` when the runtime reports a handled
|
|
305
|
+
bundler-runtime shared path.
|
|
306
|
+
- `lastPhase`: latest phase name from the report summary.
|
|
307
|
+
- `phases`: phase summary for shared loading.
|
|
308
|
+
|
|
309
|
+
The shared snapshot intentionally omits `selectedVersion`,
|
|
310
|
+
`availableVersions`, `get`, `useIn`, and `from`. If a user needs broader
|
|
311
|
+
runtime global state, use the Divebell actions below.
|
|
312
|
+
|
|
313
|
+
Common waits:
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
divebell wait-for mf:shared:observability-provider-choice:2.0.0:observability-provider-scope loaded --url "http://127.0.0.1:3005/observability"
|
|
317
|
+
divebell wait-for mf:shared:observability-async-shared:1.0.0:default error --url "http://127.0.0.1:3005/observability"
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### `mf:shared-conflict:<sharedName>:<shareScope>`
|
|
321
|
+
|
|
322
|
+
Type: `mf.shared.conflict`
|
|
323
|
+
|
|
324
|
+
This target is created when the plugin observes multiple versions of a
|
|
325
|
+
singleton shared dependency. Its status is `warning`. Snapshot data includes
|
|
326
|
+
the stable `instanceRef`, `traceId`, shared name and scope, current provider and
|
|
327
|
+
version, all observed versions, and the compact shared snapshot. Use the normal
|
|
328
|
+
`mf:shared:*` target to inspect loading state; use this conflict target to
|
|
329
|
+
diagnose singleton version drift.
|
|
330
|
+
|
|
331
|
+
### Actions
|
|
332
|
+
|
|
333
|
+
The plugin also registers safe Divebell actions for deeper inspection:
|
|
334
|
+
|
|
335
|
+
- `mf:list-reports`: list report summaries. Supports filters such as `remote`,
|
|
336
|
+
`expose`, `shared`, `traceId`, `instanceRef`, `status`, and `outcome`.
|
|
337
|
+
- `mf:get-runtime-state`: read the current safe multi-instance runtime state.
|
|
338
|
+
- `mf:get-latest-report`: read the latest report.
|
|
339
|
+
- `mf:get-report`: read one report by `traceId`.
|
|
340
|
+
- `mf:export-report`: export a report, defaulting to the latest report.
|
|
341
|
+
- `mf:get-federation-global`: read a compact summary of the current
|
|
342
|
+
`__FEDERATION__` or `__VMOK__` global.
|
|
343
|
+
- `mf:get-federation-module-info`: read `moduleInfo` or one `moduleInfo` entry.
|
|
344
|
+
- `mf:list-federation-instances`: list current runtime instances.
|
|
345
|
+
- `mf:get-federation-instance-config`: read one runtime instance config.
|
|
346
|
+
|
|
347
|
+
Example:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
divebell run-action mf:list-reports --url "http://127.0.0.1:3005/observability" --payload '{"remote":"runtime_remote2"}'
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Multi-instance runtime state
|
|
354
|
+
|
|
355
|
+
The browser reader and `mf:get-runtime-state` action return the same safe state
|
|
356
|
+
model:
|
|
357
|
+
|
|
358
|
+
```ts
|
|
359
|
+
window.__FEDERATION__.__OBSERVABILITY__.host.getRuntimeState();
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
The result includes stable `instanceRef` values, instance roles and evidence,
|
|
363
|
+
known remotes and loaded producers, share-scope summaries, Bridge state,
|
|
364
|
+
consumer-to-producer relationships, deployment `moduleInfo`, and capability
|
|
365
|
+
completeness. Use `instanceRef` when filtering reports or selecting an instance;
|
|
366
|
+
array indexes are only a compatibility fallback and are not stable identifiers.
|
|
367
|
+
|
|
151
368
|
`errorLoadShare` is used only for observation. Shared dependency miss, version
|
|
152
369
|
mismatch, and eager boundary errors are not retried by the retry plugin by
|
|
153
370
|
default because they are usually configuration or availability problems instead
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as ObservabilityRuntimePlugin, N as ObservabilityPluginOptions } from "./index-C2QnWnLb.js";
|
|
2
2
|
|
|
3
3
|
//#region src/browser.d.ts
|
|
4
4
|
declare function ObservabilityPlugin(options?: ObservabilityPluginOptions): ObservabilityRuntimePlugin;
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const require_core = require('./core
|
|
2
|
+
const require_core = require('./core-C0012OCG.js');
|
|
3
3
|
|
|
4
4
|
//#region src/browser.ts
|
|
5
5
|
function ObservabilityPlugin(options = {}) {
|
package/dist/chrome-devtool.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { J as ObservabilityRuntimePlugin, N as ObservabilityPluginOptions } from "./index-C2QnWnLb.js";
|
|
2
2
|
|
|
3
3
|
//#region src/chrome-devtool.d.ts
|
|
4
4
|
declare function ChromeObservabilityPlugin(options?: ObservabilityPluginOptions): ObservabilityRuntimePlugin;
|
package/dist/chrome-devtool.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
const require_core = require('./core
|
|
2
|
+
const require_core = require('./core-C0012OCG.js');
|
|
3
3
|
|
|
4
4
|
//#region src/chrome-devtool.ts
|
|
5
5
|
function ChromeObservabilityPlugin(options = {}) {
|