xpe 1.0.5 → 1.0.7
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/dist/kernel/iframe.js +11 -1
- package/dist/kernel/index.js +5 -2
- package/package.json +17 -19
package/dist/kernel/iframe.js
CHANGED
|
@@ -1001,9 +1001,19 @@ export function insertScriptToIframe(scriptResult, iframeWindow, rawElement) {
|
|
|
1001
1001
|
scriptElement.onerror = afterExecScript;
|
|
1002
1002
|
}
|
|
1003
1003
|
container.appendChild(scriptElement);
|
|
1004
|
-
|
|
1004
|
+
// Vite injects an HMR client module before the actual application entry in
|
|
1005
|
+
// development HTML. That client keeps a long-lived websocket and may not
|
|
1006
|
+
// dispatch the module load event in the sandbox, so waiting for it would
|
|
1007
|
+
// prevent the real entry module from ever being inserted. It is not an
|
|
1008
|
+
// application lifecycle module and must not participate in the serial
|
|
1009
|
+
// entry gate.
|
|
1010
|
+
const isViteClientModule = module && /(?:^|\/)@vite\/client(?:$|\?)/.test(src);
|
|
1011
|
+
if (isOutlineScript && module && isEntry && !isViteClientModule) {
|
|
1005
1012
|
waitForModuleLifecycleReady(iframeWindow, afterExecScript);
|
|
1006
1013
|
}
|
|
1014
|
+
if (isOutlineScript && isViteClientModule) {
|
|
1015
|
+
afterExecScript();
|
|
1016
|
+
}
|
|
1007
1017
|
// 调用回调
|
|
1008
1018
|
callback?.(iframeWindow);
|
|
1009
1019
|
// 执行 hooks
|
package/dist/kernel/index.js
CHANGED
|
@@ -26,8 +26,11 @@ function loadRuntimeEngine() {
|
|
|
26
26
|
if (runtimeEngineModule)
|
|
27
27
|
return Promise.resolve(runtimeEngineModule);
|
|
28
28
|
if (!runtimeEngineModulePromise) {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// Keep a literal dynamic import so Vite/Rollup bundles the runtime engine
|
|
30
|
+
// into a deployable child chunk instead of leaving a missing relative URL
|
|
31
|
+
// in the host's optimized dependency directory.
|
|
32
|
+
// @ts-expect-error Vite/Rollup resolves the query-suffixed runtime chunk at build time.
|
|
33
|
+
runtimeEngineModulePromise = import("./runtime-engine.js?xpe-runtime").then((module) => {
|
|
31
34
|
runtimeEngineModule = module;
|
|
32
35
|
return runtimeEngineModule;
|
|
33
36
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xpe",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "下一代微前端应用运行底座",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,6 +37,21 @@
|
|
|
37
37
|
},
|
|
38
38
|
"./package.json": "./package.json"
|
|
39
39
|
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"micro-frontend",
|
|
42
|
+
"xpe"
|
|
43
|
+
],
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@playwright/test": "^1.60.0",
|
|
46
|
+
"@types/node": "^25.9.3",
|
|
47
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
48
|
+
"jsdom": "^29.1.1",
|
|
49
|
+
"typescript": "^5.8.3",
|
|
50
|
+
"vite": "^8.0.16",
|
|
51
|
+
"vitest": "^4.1.8",
|
|
52
|
+
"vue": "^3.5.38",
|
|
53
|
+
"vue-router": "^5.1.0"
|
|
54
|
+
},
|
|
40
55
|
"scripts": {
|
|
41
56
|
"clean": "node scripts/clean-dist.mjs",
|
|
42
57
|
"build": "node scripts/clean-dist.mjs && tsc -p tsconfig.build.json && node scripts/fix-dist-imports.mjs && node scripts/check-dist-surface.mjs",
|
|
@@ -51,8 +66,6 @@
|
|
|
51
66
|
"check:public-surface": "node scripts/check-public-surface.mjs",
|
|
52
67
|
"check:release-metadata": "node scripts/check-release-metadata.mjs",
|
|
53
68
|
"verify": "pnpm run check:release-metadata && pnpm run typecheck && pnpm test && pnpm run build && pnpm run check:pack",
|
|
54
|
-
"prepack": "pnpm run build",
|
|
55
|
-
"prepublishOnly": "pnpm run verify",
|
|
56
69
|
"test": "vitest run",
|
|
57
70
|
"test:watch": "vitest",
|
|
58
71
|
"typecheck": "pnpm run typecheck:public && pnpm run typecheck:kernel && pnpm run check:host-child-smoke",
|
|
@@ -61,20 +74,5 @@
|
|
|
61
74
|
"typecheck:kernel": "node scripts/check-kernel-typecheck.mjs",
|
|
62
75
|
"typecheck:public": "tsc -p tsconfig.json --noEmit",
|
|
63
76
|
"upstream:status": "node scripts/upstream-status.mjs"
|
|
64
|
-
},
|
|
65
|
-
"keywords": [
|
|
66
|
-
"micro-frontend",
|
|
67
|
-
"xpe"
|
|
68
|
-
],
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"@playwright/test": "^1.60.0",
|
|
71
|
-
"@types/node": "^25.9.3",
|
|
72
|
-
"@vitejs/plugin-vue": "^6.0.7",
|
|
73
|
-
"jsdom": "^29.1.1",
|
|
74
|
-
"typescript": "^5.8.3",
|
|
75
|
-
"vite": "^8.0.16",
|
|
76
|
-
"vitest": "^4.1.8",
|
|
77
|
-
"vue": "^3.5.38",
|
|
78
|
-
"vue-router": "^5.1.0"
|
|
79
77
|
}
|
|
80
|
-
}
|
|
78
|
+
}
|