@web-widget/vue 1.54.1 → 1.56.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/error-handler.ts
|
|
2
2
|
import { cacheProviderIsLoading } from "@web-widget/helpers/cache";
|
|
3
|
-
function installErrorHandler(app, callback) {
|
|
3
|
+
function installErrorHandler(app, callback, throwUnhandledErrorInProduction = false) {
|
|
4
|
+
app.config.throwUnhandledErrorInProduction = throwUnhandledErrorInProduction;
|
|
4
5
|
app.config.errorHandler = (err, instance, info) => {
|
|
5
6
|
if (cacheProviderIsLoading(err)) {
|
|
6
7
|
return;
|
package/dist/vue.client.js
CHANGED
package/dist/vue.server.js
CHANGED
|
@@ -2,12 +2,15 @@ import {
|
|
|
2
2
|
defineWebWidget,
|
|
3
3
|
installErrorHandler,
|
|
4
4
|
toReact
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PT7NYHHF.js";
|
|
6
6
|
|
|
7
7
|
// src/server.ts
|
|
8
8
|
import { defineRender, getComponentDescriptor } from "@web-widget/helpers";
|
|
9
9
|
import { createSSRApp, h, Suspense } from "vue";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
renderToString,
|
|
12
|
+
renderToWebStream
|
|
13
|
+
} from "vue/server-renderer";
|
|
11
14
|
export * from "@web-widget/helpers";
|
|
12
15
|
import { useWidgetAsyncState } from "@web-widget/helpers/state";
|
|
13
16
|
var createVueRender = ({
|
|
@@ -19,17 +22,26 @@ var createVueRender = ({
|
|
|
19
22
|
throw new Error(`"onPrefetchData" is not supported.`);
|
|
20
23
|
}
|
|
21
24
|
return defineRender(
|
|
22
|
-
async (context, { vue:
|
|
25
|
+
async (context, { progressive, vue: options } = {}) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const ssrContext = Object.create(options != null ? options : null);
|
|
28
|
+
let error;
|
|
23
29
|
const componentDescriptor = getComponentDescriptor(context);
|
|
24
30
|
const { component, props } = componentDescriptor;
|
|
25
31
|
const WidgetSuspense = (props2) => h(Suspense, null, [h(component, props2)]);
|
|
26
32
|
const app = createSSRApp(WidgetSuspense, props);
|
|
27
|
-
let error;
|
|
28
33
|
installErrorHandler(app, (err) => {
|
|
29
34
|
error = err;
|
|
30
35
|
});
|
|
31
36
|
await onCreatedApp(app, context, component, props);
|
|
32
|
-
const html = await renderToString(app, ssrContext);
|
|
37
|
+
const html = progressive ? renderToWebStream(app, ssrContext) : await renderToString(app, ssrContext);
|
|
38
|
+
if (ssrContext == null ? void 0 : ssrContext.teleports) {
|
|
39
|
+
const file = (_a = Reflect.get(component, "__file")) != null ? _a : "unknown";
|
|
40
|
+
throw new Error(
|
|
41
|
+
`Teleports are not supported in SSR: ${JSON.stringify(ssrContext.teleports, null, 2)} in ${file}
|
|
42
|
+
Do conditionally render Teleport when mounted on the client.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
33
45
|
if (error) {
|
|
34
46
|
throw error;
|
|
35
47
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web-widget/vue",
|
|
3
3
|
"description": "Vue adapter",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.56.0",
|
|
5
5
|
"homepage": "https://github.com/web-widget/web-widget#readme",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@rollup/pluginutils": "^5.1.4",
|
|
17
|
-
"@web-widget/helpers": "1.
|
|
18
|
-
"@web-widget/vite-plugin": "1.
|
|
19
|
-
"@web-widget/web-widget": "1.
|
|
20
|
-
"@web-widget/schema": "1.
|
|
21
|
-
"@web-widget/react": "1.
|
|
17
|
+
"@web-widget/helpers": "1.56.0",
|
|
18
|
+
"@web-widget/vite-plugin": "1.56.0",
|
|
19
|
+
"@web-widget/web-widget": "1.56.0",
|
|
20
|
+
"@web-widget/schema": "1.56.0",
|
|
21
|
+
"@web-widget/react": "1.56.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"tsup": "^8.3.4",
|