@revojs/vue 0.1.51 → 0.1.53
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/client/index.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ declare function useFetch<T, TError = Error>(input: MaybeRefOrGetter<string>, op
|
|
|
27
27
|
}>;
|
|
28
28
|
declare function refreshAsync(input?: string | Array<string>): Promise<void[] | undefined>;
|
|
29
29
|
declare const isServerSideRendering: any;
|
|
30
|
-
declare const REFRESH_ASYNC_HOOK: _$revojs.Descriptor<(names?: Array<string>) => Promise<void>>;
|
|
31
30
|
declare const NAVIGATE_HOOK: _$revojs.Descriptor<_$revojs.Invoke>;
|
|
31
|
+
declare const REFRESH_ASYNC_HOOK: _$revojs.Descriptor<(names?: Array<string>) => Promise<void>>;
|
|
32
32
|
declare const CLIENT_ERROR_CONTEXT: _$revojs.Descriptor<ShallowRef<Error>>;
|
|
33
33
|
declare const CLIENT_ROUTER_CONTEXT: _$revojs.Descriptor<ShallowRef<RouterContext<Component>>>;
|
|
34
34
|
//#endregion
|
package/dist/client/index.js
CHANGED
|
@@ -87,8 +87,8 @@ async function refreshAsync(input) {
|
|
|
87
87
|
if (isClient) return await scope.dispatchHook(REFRESH_ASYNC_HOOK, input === void 0 ? void 0 : Array.isArray(input) ? input : [input]);
|
|
88
88
|
}
|
|
89
89
|
const isServerSideRendering = import.meta.SERVER_SIDE_RENDERING ?? globalThis?.import?.meta?.SERVER_SIDE_RENDERING;
|
|
90
|
-
const REFRESH_ASYNC_HOOK = defineHook("REFRESH_ASYNC_HOOK");
|
|
91
90
|
const NAVIGATE_HOOK = defineHook("NAVIGATE_HOOK");
|
|
91
|
+
const REFRESH_ASYNC_HOOK = defineHook("REFRESH_ASYNC_HOOK");
|
|
92
92
|
const CLIENT_ERROR_CONTEXT = defineContext("CLIENT_ERROR_CONTEXT");
|
|
93
93
|
const CLIENT_ROUTER_CONTEXT = defineContext("CLIENT_ROUTER_CONTEXT");
|
|
94
94
|
//#endregion
|
package/dist/runtime/main.vue
CHANGED
|
@@ -28,12 +28,14 @@ for (const path in pages) {
|
|
|
28
28
|
segments.push(attribute);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
for (const page of pages[path]) {
|
|
32
|
+
router.use(segments, page);
|
|
33
|
+
}
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
const route = computed(() => {
|
|
35
|
-
if (context.value?.route
|
|
36
|
-
const route = h(context.value.route
|
|
37
|
+
if (context.value?.route) {
|
|
38
|
+
const route = h(context.value.route);
|
|
37
39
|
|
|
38
40
|
return context.value.hooks.reduceRight(
|
|
39
41
|
(previous, hook) =>
|
|
@@ -48,7 +50,7 @@ const route = computed(() => {
|
|
|
48
50
|
const fetch = () => {
|
|
49
51
|
const next = useUrl(scope);
|
|
50
52
|
|
|
51
|
-
context.value = router.match(next.pathname.slice(1).split("/"));
|
|
53
|
+
context.value = router.match(next.pathname === "/" ? [] : next.pathname.slice(1).split("/"));
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
scope.registerHook(NAVIGATE_HOOK, fetch);
|
|
@@ -64,8 +66,6 @@ scope.setContext(CLIENT_ERROR_CONTEXT, error);
|
|
|
64
66
|
scope.setContext(CLIENT_ROUTER_CONTEXT, context);
|
|
65
67
|
|
|
66
68
|
onErrorCaptured((value) => {
|
|
67
|
-
|
|
68
|
-
error.value = value;
|
|
69
|
-
}
|
|
69
|
+
error.value ??= value;
|
|
70
70
|
});
|
|
71
71
|
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare module "#vue/app" {
|
|
2
|
+
import type { Scope } from "revojs";
|
|
3
|
+
import type { App } from "vue";
|
|
4
|
+
|
|
5
|
+
export default function createApp(scope: Scope): Promise<App>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module "#vue/main" {
|
|
9
|
+
import type { Component } from "vue";
|
|
10
|
+
|
|
11
|
+
const main: Component;
|
|
12
|
+
|
|
13
|
+
export default app;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module "*.vue" {
|
|
17
|
+
import type { DefineComponent } from "vue";
|
|
18
|
+
|
|
19
|
+
const component: DefineComponent<Record<string, never>, Record<string, never>, any>;
|
|
20
|
+
export default component;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface ImportMeta {
|
|
24
|
+
readonly SERVER_SIDE_RENDERING: boolean;
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revojs/vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "tellua/revojs",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"build": "revojs module build"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
30
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
31
31
|
"revojs": "*",
|
|
32
32
|
"vue": "^3.5.32"
|
|
33
33
|
},
|