@fulgurjs/federation 5.9.2 → 6.0.0
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 +56 -0
- package/README.en.md +57 -416
- package/README.md +56 -446
- package/dist/bridge-app-vue.d.cts +1 -1
- package/dist/bridge-app-vue.d.ts +1 -1
- package/dist/bridge-core.cjs +1 -1
- package/dist/bridge-core.js +2 -2
- package/dist/bridge-errors.cjs +1 -1
- package/dist/bridge-errors.js +1 -1
- package/dist/bridge-host-react.cjs +1 -1
- package/dist/bridge-host-react.js +3 -3
- package/dist/bridge-host-vue.cjs +1 -1
- package/dist/bridge-host-vue.js +3 -3
- package/dist/bridge-router-react.d.ts +4 -2
- package/dist/bridge-router-react.js +95 -9
- package/dist/bridge-router-vue.d.ts +24 -5
- package/dist/bridge-router-vue.js +4 -5
- package/dist/{chunk-YKIFZIBH.js → chunk-77JZ6U6V.js} +1 -1
- package/dist/{chunk-Q6V5O5Y6.js → chunk-ENT3BOTX.js} +1 -1
- package/dist/{chunk-WRJG2YG6.js → chunk-ZAYNS7YQ.js} +1 -1
- package/dist/cli.js +460 -109
- package/dist/index.cjs +25 -38
- package/dist/index.js +25 -38
- package/dist/react.d.ts +194 -101
- package/dist/react.js +4 -0
- package/dist/runtime-entry.d.ts +9 -174
- package/dist/runtime-entry.js +0 -1
- package/dist/runtime.js +1 -1
- package/dist/vue-adapter.cjs +5 -1
- package/dist/vue-adapter.js +5 -1
- package/dist/vue.d.ts +576 -0
- package/dist/vue.js +8 -0
- package/docs/en/migration.md +210 -0
- package/docs/en/reference/api.md +534 -0
- package/docs/en/reference/errors.md +86 -0
- package/docs/{P5-vite7-8 → maintainers/P5-vite7-8}/345/205/274/345/256/271/347/237/251/351/230/265.md +7 -9
- package/docs/{webpack-mf- → maintainers/webpack-mf-}/345/257/271/347/205/247/344/270/216/347/274/272/345/217/243.md +10 -10
- package/docs/maintainers//346/262/231/347/256/261/350/276/271/347/225/214/345/256/241/350/256/241.md +43 -0
- package/docs/zh/migration.md +210 -0
- package/docs/zh/reference/api.md +533 -0
- package/docs/zh/reference/errors.md +86 -0
- package/examples/templates/README.md +1 -1
- package/examples/templates/react-host-vue-remote/pnpm-lock.yaml +7 -7
- package/examples/templates/react-host-vue-remote/pnpm-workspace.yaml +1 -1
- package/examples/templates/react-host-vue-remote/react-host/README.md +2 -2
- package/examples/templates/react-host-vue-remote/react-host/package.json +1 -1
- package/examples/templates/react-host-vue-remote/react-host/src/main.tsx +2 -2
- package/examples/templates/react-host-vue-remote/scripts/dev.config.json +11 -2
- package/examples/templates/react-host-vue-remote/vue-remote/package.json +1 -1
- package/examples/templates/react-host-vue-remote/vue-remote/src/bridge.ts +1 -1
- package/examples/templates/react-react/host/package.json +1 -1
- package/examples/templates/react-react/pnpm-lock.yaml +7 -7
- package/examples/templates/react-react/pnpm-workspace.yaml +1 -1
- package/examples/templates/react-react/remote/package.json +1 -1
- package/examples/templates/react-react/scripts/dev.config.json +11 -2
- package/examples/templates/showcase/README.md +6 -6
- package/examples/templates/showcase/pnpm-lock.yaml +11 -11
- package/examples/templates/showcase/pnpm-workspace.yaml +1 -1
- package/examples/templates/showcase/react-host/package.json +1 -1
- package/examples/templates/showcase/react-host/src/pages/BridgeVuePage.tsx +1 -1
- package/examples/templates/showcase/react-host/src/routing.ts +1 -1
- package/examples/templates/showcase/react-remote/package.json +1 -1
- package/examples/templates/showcase/react-remote/src/bridge.tsx +1 -1
- package/examples/templates/showcase/scripts/dev.config.json +22 -4
- package/examples/templates/showcase/vue-host/package.json +1 -1
- package/examples/templates/showcase/vue-host/src/pages/BridgeReactPage.vue +1 -1
- package/examples/templates/showcase/vue-host/src/routing.ts +3 -13
- package/examples/templates/showcase/vue-remote/package.json +1 -1
- package/examples/templates/showcase/vue-remote/src/bridge.ts +2 -2
- package/examples/templates/vue-host-react-remote/pnpm-lock.yaml +7 -7
- package/examples/templates/vue-host-react-remote/pnpm-workspace.yaml +1 -1
- package/examples/templates/vue-host-react-remote/react-remote/package.json +1 -1
- package/examples/templates/vue-host-react-remote/scripts/dev.config.json +11 -2
- package/examples/templates/vue-host-react-remote/vue-host/README.md +2 -2
- package/examples/templates/vue-host-react-remote/vue-host/package.json +1 -1
- package/examples/templates/vue-host-react-remote/vue-host/src/App.vue +2 -2
- package/examples/templates/vue-vue/host/package.json +1 -1
- package/examples/templates/vue-vue/host/src/main.ts +28 -21
- package/examples/templates/vue-vue/host/src/pages/HomePage.vue +1 -1
- package/examples/templates/vue-vue/pnpm-lock.yaml +7 -7
- package/examples/templates/vue-vue/pnpm-workspace.yaml +1 -1
- package/examples/templates/vue-vue/remote/package.json +1 -1
- package/examples/templates/vue-vue/scripts/dev.config.json +11 -2
- package/package.json +24 -37
- package/dist/bridge-core-D37VanBl.d.ts +0 -99
- package/dist/bridge-host-react-CGymCzD2.d.ts +0 -35
- package/dist/bridge-host-vue-B3GHaQAC.d.ts +0 -32
- package/dist/bridge-react.d.ts +0 -14
- package/dist/bridge-react.js +0 -3
- package/dist/bridge-vue.d.ts +0 -8
- package/dist/bridge-vue.js +0 -3
- package/dist/bridge.d.ts +0 -18
- package/dist/bridge.js +0 -5
- package/dist/chunk-GLASM5EX.js +0 -1730
- package/dist/chunk-V6EASSCR.js +0 -249
- package/dist/chunk-X34EJB4H.js +0 -207
- package/docs/API.en.md +0 -339
- package/docs/API.md +0 -914
- package/docs//346/262/231/347/256/261/350/276/271/347/225/214/345/256/241/350/256/241.md +0 -45
- package/docs//350/277/201/347/247/273/346/214/207/345/215/227.md +0 -179
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# 6.0.0 migration guide
|
|
2
|
+
|
|
3
|
+
> 6.0.0 completes **public entry unification**: Vue apps, React apps, and framework-agnostic modules each have exactly one entry, and all bridge and route-sync APIs are merged into `/vue` and `/react`. This guide covers every breaking change from 5.x to 6.0.0, each with an old → new mapping and before/after code. For even earlier breaking changes of historical versions (≤5.9.x, the 5.0.0 removals), see the appendix at the end.
|
|
4
|
+
|
|
5
|
+
## 1. 6.0.0 breaking changes at a glance
|
|
6
|
+
|
|
7
|
+
| # | Change | Impact | Migration action |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| 1 | Entry `/bridge` (aggregate) removed | Code importing `createVueBridgeApp`/`createReactBridgeApp` from `/bridge` fails with an exports resolution error | Import from `/vue` and `/react` respectively (see the mapping below) |
|
|
10
|
+
| 2 | Entries `/bridge/vue`, `/bridge/react` removed | Vue/React bridge host factory imports fail | `createVueBridgeApp` → `@fulgurjs/federation/vue`; `createReactBridgeApp` → `@fulgurjs/federation/react` |
|
|
11
|
+
| 3 | Entries `/bridge/router/vue`, `/bridge/router/react` removed | URL sync API imports fail | All four route-sync APIs merged into `/vue` and `/react` |
|
|
12
|
+
| 4 | `/runtime` no longer exports Vue's `remoteComponent`, `createHostPages`, `defineBridgeApp` | Code importing these three Vue APIs from `/runtime` gets undefined/errors | Import from `@fulgurjs/federation/vue`; `/runtime` stays framework-agnostic (full runtime + context + pages + remoteSchema, zero Vue/React/router dependency) |
|
|
13
|
+
| 5 | `fulgurjs init` flag consolidated: `--template` renamed to `--out` | The old flag is still accepted but interpreted as the output path, with a rename hint (removed in a later version) | Use `fulgurjs init --out <path>` |
|
|
14
|
+
|
|
15
|
+
The aggregate `/bridge` could be tree-shaken in production builds, but **dev native ESM has no tree-shaking guarantee** (it would execute both host adapters) — after entry unification this problem disappears: `/vue` has zero React, `/react` has zero Vue.
|
|
16
|
+
|
|
17
|
+
## 2. Import mapping table (old → new)
|
|
18
|
+
|
|
19
|
+
| API | Old import (≤5.9) | New import (6.0.0) |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `federation` / `FederationOptions` | `@fulgurjs/federation` | `@fulgurjs/federation` (unchanged) |
|
|
22
|
+
| `loadRemote`/`loadShare`/`preloadRemote`/`getContainer`/`registerRemote(s)`/`registerShare`/`initSharing`/`registerPlugins`/`getRuntime`/`shareScopeMap`/`unwrapDefault`/`version`/`clearSessionState`/`parseSpec`/`getLoadedShare`/`pinLoadedShare` | `@fulgurjs/federation/runtime` (or the same names from `/vue`, `/react`) | Unchanged; React apps may also uniformly import from `/react` |
|
|
23
|
+
| `provideAppContext`/`getAppContext`/`requireAppContext`/`clearAppContext` | `/runtime` (or `/vue`, `/react`) | Unchanged; framework-agnostic |
|
|
24
|
+
| `definePages`/`validatePages`/`remoteSchema` | `/runtime` (or `/vue`, `/react`) | Unchanged |
|
|
25
|
+
| `remoteComponent` (Vue form) | `@fulgurjs/federation/runtime` | **`@fulgurjs/federation/vue`** |
|
|
26
|
+
| `createHostPages` (Vue form) | `@fulgurjs/federation/runtime` | **`@fulgurjs/federation/vue`** |
|
|
27
|
+
| `remoteComponent`/`useLoadRemote`/`RemoteErrorBoundary`/`createReactHostPages` (React) | `@fulgurjs/federation/react` | Unchanged |
|
|
28
|
+
| `defineBridgeApp` (Vue child app) | Old entry `/runtime` or aggregate `/bridge` | **`@fulgurjs/federation/vue`** |
|
|
29
|
+
| `defineBridgeApp` (React child app) | Old entry `/react` or aggregate `/bridge` | Unchanged (`/react`) |
|
|
30
|
+
| `createVueBridgeApp` | Old entry `bridge/vue` (or aggregate `/bridge`) | **`@fulgurjs/federation/vue`** |
|
|
31
|
+
| `createReactBridgeApp` | Old entry `bridge/react` (or aggregate `/bridge`) | **`@fulgurjs/federation/react`** |
|
|
32
|
+
| `createVueBridgeNavigation`/`connectVueBridgeRouter` | Old entry `bridge/router/vue` | **`@fulgurjs/federation/vue`** |
|
|
33
|
+
| `createReactBridgeNavigation`/`createReactBridgeRouter` | Old entry `bridge/router/react` | **`@fulgurjs/federation/react`** |
|
|
34
|
+
| `RuntimePlugin`/`RemoteConfig`/`SharedHint` and other types | `/runtime`, package root | Unchanged |
|
|
35
|
+
|
|
36
|
+
Mnemonic: **"whatever framework the app runs, import from that framework's entry"** — everything Vue from `/vue`, everything React from `/react`, pure TS modules used by both from `/runtime`, Vite config from the package root.
|
|
37
|
+
|
|
38
|
+
## 3. Before/after code examples
|
|
39
|
+
|
|
40
|
+
### 3.1 Vue child app bridge contract
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// ── Old (5.x) ──
|
|
44
|
+
import { defineBridgeApp } from '@fulgurjs/federation/runtime'
|
|
45
|
+
|
|
46
|
+
export default defineBridgeApp((props) => {
|
|
47
|
+
const app = createApp(App, props)
|
|
48
|
+
return app
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
// ── New (6.0.0) ──
|
|
54
|
+
import { defineBridgeApp } from '@fulgurjs/federation/vue'
|
|
55
|
+
|
|
56
|
+
export default defineBridgeApp((props) => {
|
|
57
|
+
const app = createApp(App, props)
|
|
58
|
+
return app
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3.2 Vue host mounting a React child app
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// ── Old (5.x): imported from the old entry bridge/vue (under the @fulgurjs/federation package root, removed in 6.0.0) ──
|
|
66
|
+
import { createVueBridgeApp } from '…/bridge/vue'
|
|
67
|
+
const RemoteReactApp = createVueBridgeApp('react-remote/bridge', { retries: 1 })
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// ── New (6.0.0) ──
|
|
72
|
+
import { createVueBridgeApp } from '@fulgurjs/federation/vue'
|
|
73
|
+
const RemoteReactApp = createVueBridgeApp('react-remote/bridge', { retries: 1 })
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3.3 URL sync (Vue host + Vue child app, both ends)
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
// ── Old (5.x) ── (old entry bridge/router/vue, removed in 6.0.0)
|
|
80
|
+
// Host
|
|
81
|
+
import { createVueBridgeNavigation, type BridgeHostRouting } from '…/bridge/router/vue'
|
|
82
|
+
const navigation = createVueBridgeNavigation(router)
|
|
83
|
+
const routing: BridgeHostRouting = { basePath: '/approval', navigation }
|
|
84
|
+
// Child app
|
|
85
|
+
import { connectVueBridgeRouter } from '…/bridge/router/vue'
|
|
86
|
+
await connectVueBridgeRouter(ctx.routing!, router, { signal: ctx.signal }).ready
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
// ── New (6.0.0) ──
|
|
91
|
+
// Host (same entry as createVueBridgeApp)
|
|
92
|
+
import { createVueBridgeApp, createVueBridgeNavigation, type BridgeHostRouting } from '@fulgurjs/federation/vue'
|
|
93
|
+
const navigation = createVueBridgeNavigation(router)
|
|
94
|
+
const routing: BridgeHostRouting = { basePath: '/approval', navigation }
|
|
95
|
+
// Child app (same entry as defineBridgeApp)
|
|
96
|
+
import { defineBridgeApp, connectVueBridgeRouter } from '@fulgurjs/federation/vue'
|
|
97
|
+
await connectVueBridgeRouter(ctx.routing!, router, { signal: ctx.signal }).ready
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 3.4 React host URL sync
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
// ── Old (5.x) ── (old entries bridge/react and bridge/router/react, removed in 6.0.0)
|
|
104
|
+
import { createReactBridgeApp } from '…/bridge/react'
|
|
105
|
+
import { createReactBridgeNavigation, createReactBridgeRouter } from '…/bridge/router/react'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
// ── New (6.0.0) ──
|
|
110
|
+
import {
|
|
111
|
+
createReactBridgeApp,
|
|
112
|
+
createReactBridgeNavigation,
|
|
113
|
+
createReactBridgeRouter,
|
|
114
|
+
defineBridgeApp,
|
|
115
|
+
} from '@fulgurjs/federation/react'
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 3.5 Vue host per-page pages (Vue APIs moved out of `/runtime`)
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
// ── Old (5.x) ──
|
|
122
|
+
import { createHostPages, remoteComponent } from '@fulgurjs/federation/runtime'
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
// ── New (6.0.0) ──
|
|
127
|
+
import { createHostPages, remoteComponent } from '@fulgurjs/federation/vue'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 3.6 Pure TS modules (no migration)
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
// Old and new are identical: framework-agnostic code always imports from /runtime
|
|
134
|
+
import { loadRemote, loadShare } from '@fulgurjs/federation/runtime'
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## 4. Migration steps (mechanical replacement suffices)
|
|
138
|
+
|
|
139
|
+
1. **Globally search for the old subpaths**: search your source for `bridge/vue`, `bridge/react`, `bridge/router/vue`, `bridge/router/react`, `/bridge'` and other old entry references — the 6.0.0 package no longer has those exports, and the build error points at every occurrence;
|
|
140
|
+
2. **Rewrite imports per the mapping table in section 2**: the contents of `/bridge/vue`, `/bridge/react`, `/bridge/router/vue`, `/bridge/router/react` merged into `/vue` and `/react` respectively; multiple bridge APIs in one file collapse into a single import statement;
|
|
141
|
+
3. **Audit the `/runtime` import surface**: anything importing `remoteComponent`/`createHostPages`/`defineBridgeApp` (Vue-only APIs) from `/runtime` moves to `/vue`; all other `/runtime` exports are unchanged;
|
|
142
|
+
4. **Finish with TS diagnostics**: run `vue-tsc --noEmit`/`tsc --noEmit` on changed files, confirming no `Failed to resolve import`/ts(2307); if the IDE reports ts(2307), `Restart TS Server` first to clear the TS service cache;
|
|
143
|
+
5. **Verify the dev request graph**: the bridge host's dev first paint no longer loads the other framework's adapter (`/vue` host executes zero React, and vice versa);
|
|
144
|
+
6. **`fulgurjs init --template` callers**: switch to `--out` (the old name still works but prints a rename hint).
|
|
145
|
+
|
|
146
|
+
## 5. Migrating from other micro-frontend solutions (concept mapping)
|
|
147
|
+
|
|
148
|
+
API-level concept mapping when moving in from qiankun-style solutions (generic technical conclusions, not business-specific):
|
|
149
|
+
|
|
150
|
+
| Old solution concept | @fulgurjs/federation equivalent |
|
|
151
|
+
|---|---|
|
|
152
|
+
| Main app registerMicroApps | Host `federation({ remotes })` |
|
|
153
|
+
| Child app entry (HTML) | Remote entry (dev: `@fulgurjs-entry.js` middleware / prod: `fulgurjs-remoteEntry.js`) |
|
|
154
|
+
| Child app lifecycle mount/unmount | Page-level exposes (the component is the entry, no lifecycle boilerplate); startup-time initialization = remote `federation({ setup })` (setup/onSession); whole-app embedding = the bridge contract's `mount`/`unmount` (`defineBridgeApp`) |
|
|
155
|
+
| Window isolation/sandbox | No sandbox: same-realm direct rendering (conclusions and boundaries in the [sandbox boundary audit (Chinese)](../maintainers/沙箱边界审计.md)) |
|
|
156
|
+
| Props passing | Component props (component level); `appProps` (bridge level, mount snapshot semantics); AppContext (cross-app context) |
|
|
157
|
+
| Common-dependency externals | `shared` (singleton negotiation, "already-loaded first") |
|
|
158
|
+
| qiankun runtime + single-spa | `@fulgurjs/federation/runtime` (~20KB runtime kernel, no single-spa) |
|
|
159
|
+
|
|
160
|
+
## 6. Page unmount cleanup checklist
|
|
161
|
+
|
|
162
|
+
The qiankun-style `unmount` forces child apps to clean window-level resources; federation **component-level** unmount does not clean automatically — the following resources must be removed by the page component itself in `onUnmounted` (effect cleanup in React), otherwise navigating away and back re-registers/re-fires:
|
|
163
|
+
|
|
164
|
+
| Resource | How to clean up |
|
|
165
|
+
|---|---|
|
|
166
|
+
| Back-registrations like `getAppContext().events.<prefix>.xxx = fn` | Delete the property on unmount (compare the function reference, then delete) |
|
|
167
|
+
| `window.addEventListener(...)` | Keep the function reference and `removeEventListener` on unmount |
|
|
168
|
+
| `setInterval` / `setTimeout` | `clearInterval` / `clearTimeout` on unmount |
|
|
169
|
+
| Other global keys you attached | Explicitly delete likewise |
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
import { onUnmounted } from 'vue'
|
|
173
|
+
import { getAppContext } from '@fulgurjs/federation/vue'
|
|
174
|
+
|
|
175
|
+
const onHostEvent = (e: unknown) => { /* ... */ }
|
|
176
|
+
getAppContext().events!.bpm = { onHostEvent }
|
|
177
|
+
onUnmounted(() => {
|
|
178
|
+
const events = getAppContext().events
|
|
179
|
+
if (events?.bpm?.onHostEvent === onHostEvent) delete events.bpm.onHostEvent
|
|
180
|
+
})
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
> A lightweight reminder, not a plugin mechanism: the vast majority of pages only make data requests (which end naturally when the component is destroyed) and need no cleanup; pages with global side effects should walk through this checklist item by item. Full sub apps mounted via the bridge are cleaned at container level by the contract's `unmount`; an unmount that throws persistently locks out the container (only a full page refresh recovers), so the child app's cleanup logic must be robust.
|
|
184
|
+
|
|
185
|
+
## 7. First-use pitfall checklist (general engineering issues)
|
|
186
|
+
|
|
187
|
+
| # | Pitfall | Symptom | Fix |
|
|
188
|
+
|---|-----|------|------|
|
|
189
|
+
| 1 | Not clearing `.vite` after a plugin upgrade | Pages render with old logic / facade signature drift 404 (DEV-009) | `rm -rf node_modules/.vite` + restart dev + switch browser profile |
|
|
190
|
+
| 2 | pnpm tarball install leaves broken symlinks | `Cannot find module '@fulgurjs/federation'` | Reinstall and verify the directory resolves |
|
|
191
|
+
| 3 | UMD/CJS dependency moved out of pre-bundling | Bare CJS white screen in dev, `Cannot destructure property 'node'` (DEV-004) | Put it back into `optimizeDeps.include` (the plugin externalizes shared keys automatically) |
|
|
192
|
+
| 4 | Adding an ESM alias for a shared dependency | Build-time `xxx.default.extend is not a function` | **Must be removed for build** (prod rollup double interop); in dev, if the dependency was moved out of pre-bundling, its CJS subpaths need a dev-only alias (injected only when `command==='serve'`) |
|
|
193
|
+
| 5 | Asserting before the async login chain completes | e2e intermittently bounced back to the login page | Wait for "the login form to disappear" rather than a fixed number of seconds; leave generous timeouts for slow chains |
|
|
194
|
+
| 6 | Multi-version component library CSS | Later-loaded overrides clobber `:root` variables | Harmless if mainstream versions share the same variables; watch it during upgrades |
|
|
195
|
+
| 7 | Backend missing an endpoint | 404/401 resource errors | Add an honest empty-response shim at the proxy/NGINX layer (never fabricate business data) |
|
|
196
|
+
| 8 | Remote pages (expose target files) statically importing the runtime | Worrying about double instances | Just import statically — the plugin rewrites it into a lazy singleton proxy, identical to host code |
|
|
197
|
+
|
|
198
|
+
## Appendix: legacy APIs removed in 5.0.0 (for cross-version upgraders)
|
|
199
|
+
|
|
200
|
+
5.0.0 was a deliberate breaking cleanup. Passing a legacy API always fails with a "current value → reason → migration" error; it is never silently accepted:
|
|
201
|
+
|
|
202
|
+
| Removed (5.0.0) | Replacement |
|
|
203
|
+
|---|---|
|
|
204
|
+
| The `@fulgurjs/federation/config` subpath (`defineRepoConfig` / `loadRepoConfig` / `federationOptionsForApp` / `RepoConfig` and other aggregate types) | One `fulgurjs.config.ts` per app root whose default export directly `satisfies FederationOptions`; `host.pages`/`remotePrefixes`/`deriveSpec` become the `hostPages` named export |
|
|
205
|
+
| CLI `--app <app name>` (aggregate config selector) | Run `fulgurjs explain` / `fulgurjs check-pages` directly in each app root; passing `--app` errors with a migration message |
|
|
206
|
+
| check-pages' old aggregate form's local dist fallback | `--manifest <remote>=<path\|URL>` or `--site <URL>` (an explicit source failing honestly reports "cannot verify" — it never pretends to pass) |
|
|
207
|
+
| `federation()` options: `remoteType`, `library`, `automaticAsyncBoundary`, `dataPrefetch`, `usedExports`, `ignoreUnusedSharedExports` | Delete the field outright: remoteEntry is always ESM, the TLA async boundary is always on, and tree-shaking is native to the bundler; for preloading call `preloadRemote()` at runtime (a `/runtime` export). Passing any value (including historically valid ones) reports `CFG-011` |
|
|
208
|
+
| The old "expose a bootstrap module + host calls it manually" initialization pattern | `federation({ setup })`: default-export `setup(context)` runs once per app + named export `onSession(context)` deduplicated per session |
|
|
209
|
+
|
|
210
|
+
For the complete version history see the [CHANGELOG](../../CHANGELOG.md).
|