@zubyjs/react 1.0.62 → 1.0.64
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/hooks/useProps.js +2 -2
- package/package.json +1 -1
- package/router.d.ts +4 -4
- package/templates/entry.js +2 -2
- package/templates/innerLayout.d.ts +2 -2
- package/templates/layout.d.ts +2 -2
package/hooks/useProps.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from './useFetch.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getGlobalContext } from 'zuby/contexts/index.js';
|
|
3
3
|
export default function useProps(path, priority = 'auto') {
|
|
4
|
-
const { buildId } =
|
|
4
|
+
const { buildId } = getGlobalContext();
|
|
5
5
|
path = `/_props${path}/?${buildId}`;
|
|
6
6
|
path = path.replace(/\/+/g, '/');
|
|
7
7
|
return useFetch(path);
|
package/package.json
CHANGED
package/router.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export { useRoute, useRouter, useParams, useLocation, Redirect, RedirectProps } from 'wouter';
|
|
2
2
|
import { LazyTemplate } from 'zuby/templates/types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { PageContext } from 'zuby/contexts/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Zuby's Router component provides support for file-system based routing.
|
|
6
6
|
*/
|
|
7
7
|
export default function Router({ context }: {
|
|
8
|
-
context:
|
|
8
|
+
context: PageContext;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export declare function Page({ page, context }: {
|
|
11
11
|
page: LazyTemplate;
|
|
12
|
-
context:
|
|
12
|
+
context: PageContext;
|
|
13
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare function Error({ error, context }: {
|
|
15
15
|
error: LazyTemplate;
|
|
16
|
-
context:
|
|
16
|
+
context: PageContext;
|
|
17
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
export declare function loadAsyncTemplates(templates?: LazyTemplate[]): any[];
|
|
19
19
|
export declare function loadSyncTemplates(templates?: LazyTemplate[]): any[];
|
package/templates/entry.js
CHANGED
|
@@ -3,9 +3,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
import { hydrateRoot, createRoot } from 'react-dom/client';
|
|
5
5
|
import Router from '@zubyjs/react/router.js';
|
|
6
|
-
import {
|
|
6
|
+
import { PageContext } from 'zuby/contexts/index.js';
|
|
7
7
|
if (typeof window !== 'undefined') {
|
|
8
|
-
const pageContext = new
|
|
8
|
+
const pageContext = new PageContext({
|
|
9
9
|
...(globalThis?.initialPageContext || {}),
|
|
10
10
|
});
|
|
11
11
|
const appElement = document.getElementById('app');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageContext } from 'zuby/contexts/index.js';
|
|
2
2
|
export default function InnerLayout({ innerHtml, context, }: {
|
|
3
3
|
innerHtml: string;
|
|
4
|
-
context:
|
|
4
|
+
context: PageContext;
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
package/templates/layout.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PageContext } from 'zuby/contexts/index.js';
|
|
3
3
|
export default function Layout({ children, context, }: PropsWithChildren<{
|
|
4
|
-
context:
|
|
4
|
+
context: PageContext;
|
|
5
5
|
}>): import("react/jsx-runtime").JSX.Element;
|