@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
package/dist/vue.d.ts
ADDED
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { Component, App } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 跨应用上下文标准字段表(§4.3,0.8.2 精简后)。
|
|
6
|
+
*
|
|
7
|
+
* 读写约定:宿主桥先写标准字段;远程 boot 只增不改宿主键;
|
|
8
|
+
* 嵌套对象(如 events)是引用共享,子应用挂属性即时可见(同 realm 直引用)。
|
|
9
|
+
*
|
|
10
|
+
* 精简记录(0.8.2):`token` 快照与 `formUrl`/`baseUrl` 从默认 provide 集合移除——
|
|
11
|
+
* token 快照与 getToken 函数引用重复(快照会过期),formUrl/baseUrl 自 0.7.0
|
|
12
|
+
* remoteComponent 直渲染后无消费点;项目如需可经扩展位自行提供。
|
|
13
|
+
*/
|
|
14
|
+
interface AppContext {
|
|
15
|
+
/** 宿主登录用户原始形态(只读约定) */
|
|
16
|
+
user: Record<string, any>;
|
|
17
|
+
/** 取最新 token(拉取式防过期;0.8.2 起 bridge 不再传一次性 token 快照,用本函数取值) */
|
|
18
|
+
getToken?: () => string | undefined;
|
|
19
|
+
/** 宿主 pinia 实例:子应用 useUserStore(ctx.store) 拿共享响应式状态 */
|
|
20
|
+
store?: unknown;
|
|
21
|
+
/** 宿主 Vue App 实例(同 realm 直引用):全局组件/指令注册目标 */
|
|
22
|
+
hostApp?: unknown;
|
|
23
|
+
/** EP locale 等 UI 配置(原 W4 字段) */
|
|
24
|
+
locale?: unknown;
|
|
25
|
+
/** 事件/方法池:events.main.* 宿主提供、events.bpm.* / events.lowcode.* 子应用反向注册 */
|
|
26
|
+
events?: Record<string, any>;
|
|
27
|
+
/**
|
|
28
|
+
* 非敏感登录代次 ID:宿主每次成功登录/重新登录生成新值,token 刷新但会话未变时沿用。
|
|
29
|
+
* 远程 onSession 按它去重(同一代次只执行一次)。不是用户 ID、不是 token、不作为授权凭证。
|
|
30
|
+
* 远程声明了 onSession 时必填(缺省即 MFU-013)。
|
|
31
|
+
*/
|
|
32
|
+
sessionKey?: string;
|
|
33
|
+
/** 项目扩展位(formUrl/baseUrl 等自定义键,按需自行提供) */
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 宿主写入跨应用上下文(merge 语义,幂等可多次调用,后写覆盖同键)。
|
|
38
|
+
*
|
|
39
|
+
* 宿主桥(host/src/fulgurjs/host/bridge.ts)在登录完成后调用:
|
|
40
|
+
* provideAppContext({ user, getToken, store, hostApp, locale, sessionKey, events: { main: mainEvents }, ... })
|
|
41
|
+
* 登录态变化(换账号/token 刷新)时再次调用即以最新值覆盖同键——不要用布尔闩锁把桥封成只跑一次。
|
|
42
|
+
*/
|
|
43
|
+
declare function provideAppContext(config: Partial<AppContext> & Record<string, unknown>): void;
|
|
44
|
+
/**
|
|
45
|
+
* 宿主退出登录时清理:删除整个 context 对象(旧 user/getToken 引用一并失效),并通知
|
|
46
|
+
* 运行时单例作废全部远程的会话信号与 onSession 去重状态(下次登录必须重新执行 onSession)。
|
|
47
|
+
*
|
|
48
|
+
* 边界(契约):只清 AppContext 与会话初始化状态;不重置远程模块缓存、共享模块图与
|
|
49
|
+
* 应用级 setup 注册(同一页面内组件与共享实例继续复用)。页面无运行时单例时静默幂等
|
|
50
|
+
* (退出动作不依赖联邦形态,不得因缺运行时而打断登出流程)。
|
|
51
|
+
*/
|
|
52
|
+
declare function clearAppContext(): void;
|
|
53
|
+
/**
|
|
54
|
+
* 读上下文快照(传输层快照:顶层 merge 结果 + 嵌套对象引用共享)。
|
|
55
|
+
* 页面无运行时单例(独立直开远程页)→ CC-002 显式抛错,不静默回空。
|
|
56
|
+
*/
|
|
57
|
+
declare function getAppContext(): AppContext;
|
|
58
|
+
/**
|
|
59
|
+
* 显式校验读取(远程 setup/boot 消费入口):任一键缺失 → CC-001 三段式。
|
|
60
|
+
*
|
|
61
|
+
* 用法:const { store, user, hostApp } = requireAppContext('store', 'user', 'hostApp')
|
|
62
|
+
* 时序契约:宿主桥先 provide,远程 setup/onSession 后 require——违反即在初始化处显式失败。
|
|
63
|
+
*/
|
|
64
|
+
declare function requireAppContext(...keys: string[]): AppContext;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Vue 宿主桥接工厂(/bridge、/bridge/vue 导出 createVueBridgeApp;任务书 §3.4)。
|
|
68
|
+
*
|
|
69
|
+
* 定位:接收注入的 loadRemote(不静态引用运行时内核,dist 壳绑定),返回一个
|
|
70
|
+
* 包装组件 `{ appProps: P; sessionKey?: string | null }`,负责:
|
|
71
|
+
* - DOM 所有权(§4.5):只创建并保持稳定的空挂载 el(多根 fragment 的固定子节点);
|
|
72
|
+
* pending/error 占位是它的兄弟节点,宿主重渲染不 patch 子应用 root 内部;
|
|
73
|
+
* - 会话代次(§4.3):受控 sessionKey 驱动 挂载/换会话/登出;同会话重渲染不重挂;
|
|
74
|
+
* - 错误诊断:契约非法 MFU-015、生命周期失败 MFU-016(phase 区分)、会话矛盾 MFU-017;
|
|
75
|
+
* 默认占位含「重试加载 / 刷新页面重试」两条恢复操作(§4.4)。
|
|
76
|
+
*
|
|
77
|
+
* appProps 是挂载时浅拷贝快照(顶层替换不追踪、不重渲染子应用,重挂由 :key 重建);
|
|
78
|
+
* sessionKey 是桥接控制参数,不混入业务 props。
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
interface VueBridgeAppOptions {
|
|
82
|
+
/** 加载 pending 占位组件(默认无占位节点) */
|
|
83
|
+
loadingComponent?: Component;
|
|
84
|
+
/** 加载/挂载失败占位(完全接管,契约不变:只接收 error prop;默认内置中文诊断 + 两条恢复操作) */
|
|
85
|
+
errorComponent?: Component;
|
|
86
|
+
/** 透传现行 loadRemote 的重试选项(0-10 整数),不另叠自动重试 */
|
|
87
|
+
retries?: number;
|
|
88
|
+
/** 本次桥接加载等待上限 ms;不取消已发出的共享请求,迟到结果一律丢弃 */
|
|
89
|
+
timeout?: number;
|
|
90
|
+
/** 无副作用的同步 getter:首次、重试及换会话的实际加载前返回本次所需上下文快照 */
|
|
91
|
+
getContext?: () => Partial<AppContext> & Record<string, unknown>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* D.2 宿主路由表校验器(definePages)
|
|
96
|
+
*
|
|
97
|
+
* 背景:带参路由缺省推导 spec 时会剥离 :参数 段,可能与其它条目(如列表页)的
|
|
98
|
+
* expose 键收敛相同 → 静默加载错误组件(真实事故:复制流程误走更新语义)。
|
|
99
|
+
*
|
|
100
|
+
* 定位:纯同步纯函数,dev(宿主浏览器模块求值)与 build(node)行为一致;
|
|
101
|
+
* 只校验不改写入参;ERROR 级聚合一次 throw(strict:false 降级 console.error),
|
|
102
|
+
* WARN 级聚合 console.warn。
|
|
103
|
+
*
|
|
104
|
+
* 规则:
|
|
105
|
+
* - R1 [ERROR] 带参路由(无显式 spec)的推导 spec 与任一其它条目的有效 spec 相同
|
|
106
|
+
* - R2 [WARN] 多条目的有效 spec 完全相同(可能是刻意的菜单别名,要求有意识)
|
|
107
|
+
* - R3 [ERROR] schema 提供时:有效 spec 的 exposes 键不在对应 remote 清单中
|
|
108
|
+
* (把运行时 MFU-006 提前到启动期;schema 缺失/remote 不可达则跳过)
|
|
109
|
+
* - R4 [ERROR] 静态路由被数组中更靠前的带参路由遮蔽(先到先得 → 静态路由成死路由);
|
|
110
|
+
* 含路由完全重复
|
|
111
|
+
* - R5 [WARN] name 字段重复(vue-router 命名跳转歧义)
|
|
112
|
+
*/
|
|
113
|
+
interface PageRouteLike {
|
|
114
|
+
/** 宿主路由路径(:param 段) */
|
|
115
|
+
route: string;
|
|
116
|
+
/** 显式 spec(缺省走推导) */
|
|
117
|
+
spec?: string;
|
|
118
|
+
/** 其余字段(name/title/...)由宿主自由扩展,校验器按需读取 */
|
|
119
|
+
name?: string;
|
|
120
|
+
[key: string]: unknown;
|
|
121
|
+
}
|
|
122
|
+
interface RemoteSchemaEntry {
|
|
123
|
+
/** 该 remote 的 exposes 键清单(与 spec 同口径,剥 ./ 前缀比较) */
|
|
124
|
+
exposes: string[];
|
|
125
|
+
/** manifest 是否成功拉取(false 时跳过该 remote 的 R3,诚实降级) */
|
|
126
|
+
exists?: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface PagesOptions {
|
|
129
|
+
/**
|
|
130
|
+
* 带参路由的缺省 spec 推导规则(宿主私有约定,如
|
|
131
|
+
* (route) => `pages/${route 去前缀去 :参}`)。
|
|
132
|
+
* 缺省 = 去掉首段(远程前缀)+ 剥 :参 段(无 pages/ 前缀)——
|
|
133
|
+
* 推导只需在全部条目间自洽即可保持冲突判定成立。
|
|
134
|
+
*/
|
|
135
|
+
deriveSpec?: (route: string) => string;
|
|
136
|
+
/** 路由前缀 → remote 名(R3 用:{'/remote-a/': 'remote-a'});缺省跳过 R3 */
|
|
137
|
+
remotes?: Record<string, string>;
|
|
138
|
+
/** remote exposes 清单(dev 由 virtual:fulgurjs-remote-schema 提供);缺省跳过 R3 */
|
|
139
|
+
schema?: Record<string, RemoteSchemaEntry>;
|
|
140
|
+
/** false = ERROR 降级 console.error(默认 true = throw) */
|
|
141
|
+
strict?: boolean;
|
|
142
|
+
}
|
|
143
|
+
interface PageViolation {
|
|
144
|
+
rule: 'R1' | 'R2' | 'R3' | 'R4' | 'R5';
|
|
145
|
+
level: 'error' | 'warn';
|
|
146
|
+
message: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 校验路由表(独立导出便于单测):返回违例清单(不抛错)。
|
|
150
|
+
*/
|
|
151
|
+
declare function validatePages(pages: PageRouteLike[], options?: PagesOptions): PageViolation[];
|
|
152
|
+
/**
|
|
153
|
+
* 宿主路由表定义入口:校验(聚合报错)后原样返回入参,不改写任何字段。
|
|
154
|
+
* 违反 ERROR 级规则时默认 throw(dev overlay / build 失败直接可见);
|
|
155
|
+
* strict: false 时降级 console.error。WARN 级始终 console.warn。
|
|
156
|
+
*/
|
|
157
|
+
declare function definePages<P extends PageRouteLike[]>(pages: P, options?: PagesOptions): P;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 宿主页面表纯解析核心(框架无关)。
|
|
161
|
+
*
|
|
162
|
+
* 5.1.0 从 vue-adapter 提取:definePages 校验接入、最长前缀远程归属、缺省 spec 推导、
|
|
163
|
+
* base 剥离、段式参数匹配——Vue 与 React 适配器共用同一份解析,组件缓存/错误边界/
|
|
164
|
+
* 保活策略由各框架适配器自行负责(不把 Vue 的卸载策略强加给 React,反之亦然)。
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
/** 页面表数据项(两个框架适配器共用;展示项 fallback/error 等在各适配器定义) */
|
|
168
|
+
interface HostPagesCoreOptions {
|
|
169
|
+
/** 页面表(宿主路由与布局共用的唯一数据源;definePages R1–R5 校验照常执行) */
|
|
170
|
+
pages: PageRouteLike[];
|
|
171
|
+
/** 路由前缀 → remote 名(最长前缀匹配;页面路由无匹配前缀时创建期即报错) */
|
|
172
|
+
remotePrefixes: Record<string, string>;
|
|
173
|
+
/** 缺省 spec 推导(缺省 = 去首段前缀 + 剥 :参数 段,同 definePages 默认) */
|
|
174
|
+
deriveSpec?: (route: string) => string;
|
|
175
|
+
/** 远程 exposes 清单(dev 由 remoteSchema 提供;build 为空表时按语义诚实降级) */
|
|
176
|
+
schema?: Record<string, RemoteSchemaEntry>;
|
|
177
|
+
/** ERROR 级校验失败是否 throw(默认 true) */
|
|
178
|
+
strict?: boolean;
|
|
179
|
+
/** 站点 base 前缀(如 '/main'):resolve 时先剥离再匹配路由空间 */
|
|
180
|
+
base?: string;
|
|
181
|
+
}
|
|
182
|
+
interface ResolvedHostPage {
|
|
183
|
+
/** 原页面记录(含宿主自由扩展字段 name/title/keepAlive/...) */
|
|
184
|
+
page: PageRouteLike;
|
|
185
|
+
/** 命中的 remote 名 */
|
|
186
|
+
remote: string;
|
|
187
|
+
/** 完整加载 spec(`<remote>/<exposes 键>`,loadRemote 直用) */
|
|
188
|
+
spec: string;
|
|
189
|
+
/** 路径参数(解码失败只让该次匹配失败,不让页面初始化崩溃) */
|
|
190
|
+
params: Record<string, string>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Vue 适配层只接收加载函数,不静态引用运行时内核。 */
|
|
194
|
+
|
|
195
|
+
interface RemoteComponentOptions {
|
|
196
|
+
loadingComponent?: Component;
|
|
197
|
+
errorComponent?: Component;
|
|
198
|
+
retries?: number;
|
|
199
|
+
delay?: number;
|
|
200
|
+
timeout?: number;
|
|
201
|
+
}
|
|
202
|
+
interface HostPagesOptions extends HostPagesCoreOptions {
|
|
203
|
+
/** 每次页面模块实际加载前执行(同步或异步);宿主在此提供最新 context */
|
|
204
|
+
beforeLoad?: () => void | Promise<void>;
|
|
205
|
+
/** 加载期占位组件(骨架屏) */
|
|
206
|
+
loadingComponent?: Component;
|
|
207
|
+
/** 错误占位组件(缺省 = 内置错误占位:错误码+根因+修法+重试加载/刷新页面重试;自定义时完全接管) */
|
|
208
|
+
errorComponent?: Component;
|
|
209
|
+
/** 骨架屏延迟 ms(默认 200,防闪) */
|
|
210
|
+
delay?: number;
|
|
211
|
+
}
|
|
212
|
+
interface HostPages {
|
|
213
|
+
/** 原页面记录 */
|
|
214
|
+
pages: PageRouteLike[];
|
|
215
|
+
/** 路径 → 页面解析(兼容 base 前缀与深链;无匹配返回 null) */
|
|
216
|
+
resolve(path: string): ResolvedHostPage | null;
|
|
217
|
+
/** 按 spec 取异步页面组件(同 spec 复用;换登录代次后重建以触发会话同步) */
|
|
218
|
+
component(spec: string): Component;
|
|
219
|
+
/** 保活白名单:keepAlive 页面的组件 name(与实际被 KeepAlive 缓存的包装组件一致) */
|
|
220
|
+
keepAliveNames: string[];
|
|
221
|
+
}
|
|
222
|
+
declare function createHostPages$1(options: HostPagesOptions, load: (spec: string, opts?: {
|
|
223
|
+
retries?: number;
|
|
224
|
+
}) => Promise<any>): HostPages;
|
|
225
|
+
|
|
226
|
+
/** 统一错误码体系(对齐 webpack ScriptExternalLoadError 等运行时错误的可诊断性) */
|
|
227
|
+
declare class FgError extends Error {
|
|
228
|
+
code: string;
|
|
229
|
+
details?: Record<string, unknown>;
|
|
230
|
+
constructor(code: string, message: string, details?: Record<string, unknown>, options?: ErrorOptions);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface ShareEntry {
|
|
234
|
+
version: string;
|
|
235
|
+
get: () => Promise<any>;
|
|
236
|
+
from: string;
|
|
237
|
+
eager: boolean;
|
|
238
|
+
loaded?: boolean;
|
|
239
|
+
/** 首次 loadShare 成功后缓存的实例值;getLoadedShare 同步查询与 CJS 垫片依赖它 */
|
|
240
|
+
value?: any;
|
|
241
|
+
/** 进行中的 get():并发 loadShare 共享同一次加载,落定后清除(失败后允许重新加载) */
|
|
242
|
+
pendingGet?: Promise<any>;
|
|
243
|
+
}
|
|
244
|
+
type ShareScope = Record<string, Record<string, ShareEntry>>;
|
|
245
|
+
type ShareScopeMap = Record<string, ShareScope>;
|
|
246
|
+
interface RemoteConfig {
|
|
247
|
+
name: string;
|
|
248
|
+
entry: string;
|
|
249
|
+
shareScope?: string;
|
|
250
|
+
/**
|
|
251
|
+
* 加载超时 ms,默认 15000。注意:超时只代表"调用方不再等待",浏览器不会取消已发出的
|
|
252
|
+
* 动态 import——下一次调用复用同一条 in-flight 记录,不会重复初始化同一容器。
|
|
253
|
+
*/
|
|
254
|
+
timeout?: number;
|
|
255
|
+
/** 失败重试次数,默认 2(上限 10;配置期与运行时注册均校验,非法当场抛错) */
|
|
256
|
+
retries?: number;
|
|
257
|
+
/** 备用 remoteEntry 地址(首个失败后依次尝试) */
|
|
258
|
+
fallback?: string[];
|
|
259
|
+
breaker?: {
|
|
260
|
+
threshold?: number;
|
|
261
|
+
resetMs?: number;
|
|
262
|
+
};
|
|
263
|
+
/** promise-based remote:运行时解析出容器或容器地址(其解析同样受 timeout 约束) */
|
|
264
|
+
promise?: () => Promise<any>;
|
|
265
|
+
/** 内部:远程自报的发布路径(preload 用) */
|
|
266
|
+
manifestUrl?: string;
|
|
267
|
+
}
|
|
268
|
+
/** @deprecated 兼容旧版公开类型;新代码使用 RemoteConfig。 */
|
|
269
|
+
interface RemoteInput extends RemoteConfig {
|
|
270
|
+
container?: unknown;
|
|
271
|
+
containerPromise?: Promise<unknown>;
|
|
272
|
+
}
|
|
273
|
+
interface LoadRemoteOptions {
|
|
274
|
+
shareScope?: string;
|
|
275
|
+
retries?: number;
|
|
276
|
+
fallbackModule?: () => any;
|
|
277
|
+
}
|
|
278
|
+
interface PreloadRemoteOptions {
|
|
279
|
+
mode?: 'preload' | 'prefetch';
|
|
280
|
+
}
|
|
281
|
+
interface LoadShareOptions {
|
|
282
|
+
requiredVersion?: string | false;
|
|
283
|
+
singleton?: boolean;
|
|
284
|
+
strictVersion?: boolean;
|
|
285
|
+
shareKey?: string;
|
|
286
|
+
shareScope?: string;
|
|
287
|
+
/** 本地副本兜底(webpack shared.import) */
|
|
288
|
+
fallback?: () => Promise<any>;
|
|
289
|
+
/** 内部:本地副本的版本号(fallback 回写共享作用域与 CJS 垫片 pin 使用;不参与快照键) */
|
|
290
|
+
localVersion?: string;
|
|
291
|
+
}
|
|
292
|
+
interface RuntimePlugin {
|
|
293
|
+
name?: string;
|
|
294
|
+
init?: (hooks: RuntimeHooks) => void;
|
|
295
|
+
}
|
|
296
|
+
interface RuntimeHooks {
|
|
297
|
+
/** 覆写共享版本裁决结果:返回 ShareEntry 即生效 */
|
|
298
|
+
resolveShare?: (shareInfo: {
|
|
299
|
+
shareKey: string;
|
|
300
|
+
shareScope: string;
|
|
301
|
+
requiredVersion?: string | false;
|
|
302
|
+
picked?: ShareEntry;
|
|
303
|
+
available: ShareEntry[];
|
|
304
|
+
}) => Promise<ShareEntry | void> | ShareEntry | void;
|
|
305
|
+
beforeLoadRemote?: (info: {
|
|
306
|
+
remote: string;
|
|
307
|
+
module: string;
|
|
308
|
+
}) => void;
|
|
309
|
+
afterLoadRemote?: (info: {
|
|
310
|
+
remote: string;
|
|
311
|
+
module: string;
|
|
312
|
+
module_ns?: any;
|
|
313
|
+
}) => void;
|
|
314
|
+
onRemoteError?: (info: {
|
|
315
|
+
remote: string;
|
|
316
|
+
error: FgError;
|
|
317
|
+
}) => void;
|
|
318
|
+
}
|
|
319
|
+
interface RemoteDebugInfo {
|
|
320
|
+
entry: string;
|
|
321
|
+
status: 'idle' | 'loading' | 'loaded' | 'failed';
|
|
322
|
+
lastLoadMs?: number;
|
|
323
|
+
error?: string;
|
|
324
|
+
/** setup 生命周期状态(§3.3.1):none=未配置 / pending=执行中 / ready=应用级已完成 / failed=失败可重试 */
|
|
325
|
+
setup?: 'none' | 'pending' | 'ready' | 'failed';
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* 远程初始化上下文(federation({ setup }) 模块的默认导出与具名 onSession 收到的参数)。
|
|
329
|
+
* appContext 是调用时从页面级 AppContext 取得的当前快照(不缓存旧引用);
|
|
330
|
+
* signal 在登录代次变化或退出清理时失效,业务异步写回前必须检查 aborted。
|
|
331
|
+
*/
|
|
332
|
+
interface RemoteSetupContext {
|
|
333
|
+
appContext: Readonly<Record<string, any>>;
|
|
334
|
+
sessionKey?: string;
|
|
335
|
+
signal: AbortSignal;
|
|
336
|
+
}
|
|
337
|
+
/** setup 模块的固定导出契约:默认导出必为函数;onSession 可选且必须是函数 */
|
|
338
|
+
interface RemoteSetupModule {
|
|
339
|
+
default: (ctx: RemoteSetupContext) => void | Promise<void>;
|
|
340
|
+
onSession?: (ctx: RemoteSetupContext) => void | Promise<void>;
|
|
341
|
+
}
|
|
342
|
+
declare function createRuntime(): {
|
|
343
|
+
shareScopeMap: ShareScopeMap;
|
|
344
|
+
initSharing: (scopeName?: string) => ShareScopeMap;
|
|
345
|
+
registerShare: (scopeName: string, name: string, version: string, get: () => Promise<any>, opts?: {
|
|
346
|
+
from?: string;
|
|
347
|
+
eager?: boolean;
|
|
348
|
+
loaded?: boolean;
|
|
349
|
+
}) => void;
|
|
350
|
+
registerRemotes: (list: RemoteConfig[]) => void;
|
|
351
|
+
registerRemote: (remote: RemoteConfig) => void;
|
|
352
|
+
registerPlugins: (list: RuntimePlugin[]) => void;
|
|
353
|
+
loadShare: (name: string, opts?: LoadShareOptions) => Promise<any>;
|
|
354
|
+
loadShareSync: (name: string, opts: LoadShareOptions) => {
|
|
355
|
+
kind: "ready" | "local";
|
|
356
|
+
value?: any;
|
|
357
|
+
};
|
|
358
|
+
prepareShares: (requests: Array<{
|
|
359
|
+
name: string;
|
|
360
|
+
opts: LoadShareOptions;
|
|
361
|
+
}>) => Promise<void>;
|
|
362
|
+
getLoadedShare: (name: string, opts?: LoadShareOptions) => any;
|
|
363
|
+
pinLoadedShare: (name: string, opts: LoadShareOptions, localVersion: string, instance: unknown) => void;
|
|
364
|
+
loadRemote: <T = Record<string, any>>(spec: string, opts?: LoadRemoteOptions) => Promise<T>;
|
|
365
|
+
getContainer: (name: string) => Promise<any>;
|
|
366
|
+
preloadRemote: (spec: string, opts?: PreloadRemoteOptions) => Promise<void>;
|
|
367
|
+
parseSpec: (spec: string) => {
|
|
368
|
+
remote: string;
|
|
369
|
+
module: string;
|
|
370
|
+
};
|
|
371
|
+
clearSessionState: () => void;
|
|
372
|
+
};
|
|
373
|
+
type FgRuntime = ReturnType<typeof createRuntime>;
|
|
374
|
+
/** 插件版本(与 package.json 同步维护于 src/version.ts,测试拦截漂移;用于跨源副本一致性诊断) */
|
|
375
|
+
declare const version: string;
|
|
376
|
+
/**
|
|
377
|
+
* 取当前页面生效的运行时单例(与 globalThis.__FULGURJS_RUNTIME__ 同一实例)。
|
|
378
|
+
*
|
|
379
|
+
* 远程页面禁止静态 import 'virtual:fulgurjs-runtime'——该虚拟模块由远程 dev server
|
|
380
|
+
* 求值,会在远程模块图内实例化独立的运行时副本,破坏渲染上下文
|
|
381
|
+
* (resolveComponent / withDirectives / ref owner 告警、内容区空白)。
|
|
382
|
+
* 跨源取运行时一律用本入口,或直接读全局单例。
|
|
383
|
+
*/
|
|
384
|
+
declare function getRuntime(): FgRuntime;
|
|
385
|
+
declare const initSharing: (scopeName?: string) => ShareScopeMap;
|
|
386
|
+
declare const registerShare: (scopeName: string, name: string, version: string, get: () => Promise<any>, opts?: {
|
|
387
|
+
from?: string;
|
|
388
|
+
eager?: boolean;
|
|
389
|
+
loaded?: boolean;
|
|
390
|
+
}) => void;
|
|
391
|
+
declare const registerRemotes: (list: RemoteConfig[]) => void;
|
|
392
|
+
declare const registerRemote: (remote: RemoteConfig) => void;
|
|
393
|
+
declare const registerPlugins: (list: RuntimePlugin[]) => void;
|
|
394
|
+
declare const loadShare: (name: string, opts?: LoadShareOptions) => Promise<any>;
|
|
395
|
+
/** CJS 垫片专用同步查询(内部使用,不进公开入口壳清单) */
|
|
396
|
+
declare const getLoadedShare: (name: string, opts?: LoadShareOptions) => any;
|
|
397
|
+
declare const pinLoadedShare: (name: string, opts: LoadShareOptions, localVersion: string, instance: unknown) => void;
|
|
398
|
+
declare const loadRemote: <T = Record<string, any>>(spec: string, opts?: LoadRemoteOptions) => Promise<T>;
|
|
399
|
+
declare const getContainer: (name: string) => Promise<any>;
|
|
400
|
+
declare const preloadRemote: (spec: string, opts?: PreloadRemoteOptions) => Promise<void>;
|
|
401
|
+
declare const parseSpec: (spec: string) => {
|
|
402
|
+
remote: string;
|
|
403
|
+
module: string;
|
|
404
|
+
};
|
|
405
|
+
/** 退出清理的运行时侧:作废全部远程的会话信号与 onSession 去重状态(clearAppContext 调用) */
|
|
406
|
+
declare const clearSessionState: () => void;
|
|
407
|
+
declare const shareScopeMap: ShareScopeMap;
|
|
408
|
+
/** default 导出 interop:ESM 取 .default;CJS 命名空间回退整体 */
|
|
409
|
+
declare function unwrapDefault(ns: any): any;
|
|
410
|
+
|
|
411
|
+
/** 统一逻辑位置:pathname 以 / 开头;search 空串或 ? 开头;hash 空串或 # 开头 */
|
|
412
|
+
interface BridgeLocation {
|
|
413
|
+
pathname: string;
|
|
414
|
+
search: string;
|
|
415
|
+
hash: string;
|
|
416
|
+
}
|
|
417
|
+
type BridgeNavigationResult = {
|
|
418
|
+
status: 'committed';
|
|
419
|
+
location: BridgeLocation;
|
|
420
|
+
} | {
|
|
421
|
+
status: 'cancelled';
|
|
422
|
+
location: BridgeLocation;
|
|
423
|
+
};
|
|
424
|
+
/** 宿主导航端口(宿主适配器把 Router 包装成本接口;逻辑路径不含部署 base) */
|
|
425
|
+
interface BridgeHostNavigation {
|
|
426
|
+
getLocation(): BridgeLocation;
|
|
427
|
+
subscribe(listener: (location: BridgeLocation) => void): () => void;
|
|
428
|
+
navigate(target: BridgeLocation, action: 'push' | 'replace', options?: {
|
|
429
|
+
signal?: AbortSignal;
|
|
430
|
+
}): Promise<BridgeNavigationResult>;
|
|
431
|
+
go(delta: number): void;
|
|
432
|
+
}
|
|
433
|
+
/** 子应用路由通道(桥接宿主按挂载代次创建,随 mount 第三参数交给子应用) */
|
|
434
|
+
interface BridgeChildRoute {
|
|
435
|
+
/**
|
|
436
|
+
* 远程 spec(宿主创建通道时标注,如 "remote-b/bridge");子应用路由接线
|
|
437
|
+
* (connectVueBridgeRouter/createReactBridgeRouter)的诊断错误用它定位真实远程,
|
|
438
|
+
* 缺省(纯 memory 小部件自建通道)回退 'child-router'。
|
|
439
|
+
*/
|
|
440
|
+
readonly spec?: string;
|
|
441
|
+
getLocation(): BridgeLocation;
|
|
442
|
+
subscribe(listener: (location: BridgeLocation) => void): () => void;
|
|
443
|
+
navigate(target: BridgeLocation, action: 'push' | 'replace'): Promise<BridgeNavigationResult>;
|
|
444
|
+
go(delta: number): void;
|
|
445
|
+
}
|
|
446
|
+
/** 挂载控制参数(mount 第三参数;不混入业务 props) */
|
|
447
|
+
interface BridgeMountOptions {
|
|
448
|
+
signal?: AbortSignal;
|
|
449
|
+
routing?: BridgeChildRoute;
|
|
450
|
+
}
|
|
451
|
+
/** 子应用路由协议声明(defineBridgeApp(工厂, { routing: true }) 时写入) */
|
|
452
|
+
interface BridgeRoutingProtocol {
|
|
453
|
+
protocol: 1;
|
|
454
|
+
}
|
|
455
|
+
/** 宿主组件 routing prop(独立控制通道,不进 appProps/Context) */
|
|
456
|
+
interface BridgeHostRouting {
|
|
457
|
+
/** 宿主路由视角的静态绝对路径,如 "/approval";同页各同步实例不得相同或重叠 */
|
|
458
|
+
basePath: string;
|
|
459
|
+
navigation: BridgeHostNavigation;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* vue-router 实例的最小结构面(/vue 路由同步端口参数;真实 vue-router Router 结构兼容可赋值)。
|
|
463
|
+
* 6.0.0 可选依赖边界:/vue 的 d.ts 不得 import vue-router 类型——未安装 vue-router 的
|
|
464
|
+
* 纯组件工程在 skipLibCheck:false 下也必须能通过类型检查;结构类型的宽化只影响
|
|
465
|
+
* 路由同步端口处的精确提示,业务代码自己的 Router 类型不受影响。
|
|
466
|
+
*/
|
|
467
|
+
interface VueRouterLike {
|
|
468
|
+
currentRoute: {
|
|
469
|
+
value: {
|
|
470
|
+
fullPath: string;
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
push(to: string): Promise<unknown>;
|
|
474
|
+
replace(to: string): Promise<unknown>;
|
|
475
|
+
go(delta: number): void;
|
|
476
|
+
back(): void;
|
|
477
|
+
forward(): void;
|
|
478
|
+
afterEach(handler: (to: unknown, from: unknown, failure?: unknown) => void): () => void;
|
|
479
|
+
beforeResolve(handler: () => unknown): () => void;
|
|
480
|
+
beforeEach(handler: () => unknown): () => void;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/** 子应用桥接契约(远程 ./bridge 模块的默认导出;任务书 §3.2) */
|
|
484
|
+
interface BridgeApp {
|
|
485
|
+
/** 首次根提交完成时才算挂载成功;同一容器未卸载前重复 mount 是契约违例 */
|
|
486
|
+
mount(el: HTMLElement, props?: Record<string, unknown>, options?: BridgeMountOptions): void | Promise<void>;
|
|
487
|
+
/** 同步使当前挂载代次失效并清理已创建的 root;未知容器为 no-op */
|
|
488
|
+
unmount(el: HTMLElement): void;
|
|
489
|
+
/**
|
|
490
|
+
* 路由协议声明(URL 同步):defineBridgeApp(工厂, { routing: true }) 时写入
|
|
491
|
+
* { protocol: 1 }。宿主启用 routing 时必须存在且 protocol === 1(MFU-031),
|
|
492
|
+
* 不允许静默退回 memory 假装深链成功。
|
|
493
|
+
*/
|
|
494
|
+
routing?: BridgeRoutingProtocol;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Vue 子应用桥接适配(/runtime 导出 defineBridgeApp;任务书 §3.3 D1/D2)。
|
|
499
|
+
*
|
|
500
|
+
* 工厂形态:接收 props 快照,返回已装配完整的 VueApp(router/pinia 等由子应用自行装配);
|
|
501
|
+
* helper 负责 app.mount(el) / app.unmount() 与按容器 el 的实例跟踪。
|
|
502
|
+
*
|
|
503
|
+
* 契约语义(§3.2):
|
|
504
|
+
* - 契约实例按容器 el 分键(WeakMap):同一契约多处挂载互不干扰;
|
|
505
|
+
* - 同一容器未卸载再次 mount → 拒绝(容器占用,原始错误原样抛出)且不覆盖原实例;
|
|
506
|
+
* - Vue 的 app.mount 同步完成首次渲染,mount 成功即返回 void(首次根提交语义由 Vue 保证);
|
|
507
|
+
* - mount 抛错时清理已创建的 app(best-effort unmount),不留半挂状态;
|
|
508
|
+
* - unmount 未知容器为 no-op;mount/unmount 的原始错误**原样抛出**——MFU-016 包装
|
|
509
|
+
* (真实 spec + phase + cause)由宿主适配器在生命周期边界统一完成(见 bridgeHostError)。
|
|
510
|
+
*
|
|
511
|
+
* 本文件零 React:/runtime 导入图隔离由 tests/runtime-entry-graph.test.ts 守护。
|
|
512
|
+
*/
|
|
513
|
+
|
|
514
|
+
/** 工厂第二参数:挂载生命周期与路由通道(URL 同步;不混入业务 props) */
|
|
515
|
+
interface VueBridgeAppContext {
|
|
516
|
+
/** 会话代次信号(登出/换代即 aborted;异步写回前必须检查) */
|
|
517
|
+
signal?: AbortSignal;
|
|
518
|
+
/** 路由通道(宿主启用 URL 同步时存在);配 connectVueBridgeRouter 使用 */
|
|
519
|
+
routing?: BridgeChildRoute;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Vue 子应用工厂:接收挂载时 props 快照与生命周期上下文,返回装配完成的 VueApp。
|
|
523
|
+
* 允许返回 Promise<VueApp>(URL 同步子应用的初始 memory 路由准备是异步的——
|
|
524
|
+
* 必须等初始 push 落定再 app.use(router),否则 install 的初始导航会覆盖深链位置;
|
|
525
|
+
* 见 /bridge/router/vue 的 connectVueBridgeRouter 与任务书 §1 原型结论 1)。
|
|
526
|
+
* Promise 被作废(signal aborted / 容器已换代)时结果丢弃,不落挂。
|
|
527
|
+
*/
|
|
528
|
+
type VueBridgeAppFactory = (props: Record<string, unknown>, ctx?: VueBridgeAppContext) => App | Promise<App>;
|
|
529
|
+
interface DefineVueBridgeAppOptions {
|
|
530
|
+
/**
|
|
531
|
+
* 声明路由协议(URL 同步):契约写入 routing: { protocol: 1 },宿主启用 routing 时
|
|
532
|
+
* 校验;未声明而宿主启用同步 → MFU-031(不静默退回 memory 假装深链成功)。
|
|
533
|
+
*/
|
|
534
|
+
routing?: boolean;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* 定义 Vue 子应用的桥接契约(远程 ./bridge 模块默认导出)。
|
|
538
|
+
*
|
|
539
|
+
* ```ts
|
|
540
|
+
* import { createApp } from 'vue'
|
|
541
|
+
* import { defineBridgeApp } from '@fulgurjs/federation/vue'
|
|
542
|
+
* export default defineBridgeApp((props) => { const app = createApp(App, props); app.use(router); return app })
|
|
543
|
+
* ```
|
|
544
|
+
*/
|
|
545
|
+
declare function defineBridgeApp$1(factory: VueBridgeAppFactory, options?: DefineVueBridgeAppOptions): BridgeApp;
|
|
546
|
+
|
|
547
|
+
/** Vue Router 4/5 的宿主导航端口与子应用 memory router 接线(统一入口 /vue 提供)。 */
|
|
548
|
+
|
|
549
|
+
interface VueBridgeNavigationOptions {
|
|
550
|
+
/** 保留配置兼容;Vue Router fullPath 已剥离 history base,不再二次剥离。 */
|
|
551
|
+
routerBase?: string;
|
|
552
|
+
}
|
|
553
|
+
declare function createVueBridgeNavigation(router: VueRouterLike, _options?: VueBridgeNavigationOptions): BridgeHostNavigation;
|
|
554
|
+
interface VueBridgeRouterConnection {
|
|
555
|
+
/** 必须 await ready 后再 app.use(router),初始错误会拒绝此 Promise。 */
|
|
556
|
+
ready: Promise<void>;
|
|
557
|
+
dispose(): void;
|
|
558
|
+
}
|
|
559
|
+
/** 接线限子应用自己的 memory router;dispose 恢复原始导航方法。 */
|
|
560
|
+
declare function connectVueBridgeRouter(routing: BridgeChildRoute, router: VueRouterLike, options?: {
|
|
561
|
+
signal?: AbortSignal;
|
|
562
|
+
}): VueBridgeRouterConnection;
|
|
563
|
+
|
|
564
|
+
declare const remoteComponent: (spec: string, opts?: RemoteComponentOptions) => vue.Component;
|
|
565
|
+
/** 宿主页面适配器(绑定本包运行时的 loadRemote;选项与返回值类型见 vue-adapter) */
|
|
566
|
+
declare function createHostPages(options: Parameters<typeof createHostPages$1>[0]): HostPages;
|
|
567
|
+
/** Vue 子应用桥接契约(远程 ./bridge 模块默认导出) */
|
|
568
|
+
declare const defineBridgeApp: typeof defineBridgeApp$1;
|
|
569
|
+
/** Vue 宿主桥接工厂:返回 `{ appProps: P; sessionKey?: string | null }` 形态的包装组件 */
|
|
570
|
+
declare const createVueBridgeApp: <P = Record<string, unknown>>(spec: string, options?: VueBridgeAppOptions) => vue.Component;
|
|
571
|
+
|
|
572
|
+
type RemoteSchema = Record<string, RemoteSchemaEntry>;
|
|
573
|
+
/** 无插件转换的场景(构建、Node 导入)如实返回空清单。 */
|
|
574
|
+
declare const remoteSchema: RemoteSchema;
|
|
575
|
+
|
|
576
|
+
export { type AppContext, type BridgeApp, type BridgeHostRouting, type FgRuntime, type HostPages, type HostPagesOptions, type LoadRemoteOptions, type LoadShareOptions, type PageRouteLike, type PageViolation, type PagesOptions, type PreloadRemoteOptions, type RemoteComponentOptions, type RemoteConfig, type RemoteDebugInfo, type RemoteInput, type RemoteSchema, type RemoteSchemaEntry, type RemoteSetupContext, type RemoteSetupModule, type ResolvedHostPage, type RuntimeHooks, type RuntimePlugin, type ShareEntry, type ShareScope, type ShareScopeMap, type VueBridgeAppFactory, type VueBridgeAppOptions, type VueBridgeNavigationOptions, type VueBridgeRouterConnection, clearAppContext, clearSessionState, connectVueBridgeRouter, createHostPages, createVueBridgeApp, createVueBridgeNavigation, defineBridgeApp, definePages, getAppContext, getContainer, getLoadedShare, getRuntime, initSharing, loadRemote, loadShare, parseSpec, pinLoadedShare, preloadRemote, provideAppContext, registerPlugins, registerRemote, registerRemotes, registerShare, remoteComponent, remoteSchema, requireAppContext, shareScopeMap, unwrapDefault, validatePages, version };
|
package/dist/vue.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
export { initSharing, registerShare, registerRemotes, registerRemote, registerPlugins, loadShare, loadRemote, getLoadedShare, pinLoadedShare, getContainer, preloadRemote, parseSpec, getRuntime, shareScopeMap, unwrapDefault, version, clearSessionState } from "./runtime.js";
|
|
2
|
+
export { provideAppContext, getAppContext, requireAppContext, clearAppContext } from "./context.js";
|
|
3
|
+
export { definePages, validatePages } from "./pages.js";
|
|
1
4
|
import { loadRemote } from "./runtime.js";
|
|
2
5
|
import { createRemoteComponent, createHostPages as createHostPagesWithLoader } from "./vue-adapter.js";
|
|
3
6
|
import { defineBridgeApp as defineVueBridgeApp } from "./bridge-app-vue.js";
|
|
7
|
+
import { createVueBridgeAppWithLoader } from "./bridge-host-vue.js";
|
|
8
|
+
import { createVueBridgeNavigation, connectVueBridgeRouter } from "./bridge-router-vue.js";
|
|
4
9
|
export const remoteComponent = createRemoteComponent(loadRemote);
|
|
5
10
|
export const createHostPages = (options) => createHostPagesWithLoader(options, loadRemote);
|
|
6
11
|
export const defineBridgeApp = defineVueBridgeApp;
|
|
12
|
+
export const createVueBridgeApp = createVueBridgeAppWithLoader(loadRemote);
|
|
13
|
+
export { createVueBridgeNavigation, connectVueBridgeRouter };
|
|
14
|
+
export const remoteSchema = {};
|