houdini-react 0.0.0-20240402043110 → 0.0.0-20240402060051
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.
|
@@ -22,6 +22,7 @@ export declare function Router({ manifest, initialURL, assetPrefix, injectToStre
|
|
|
22
22
|
export declare const useLocation: () => {
|
|
23
23
|
pathname: string;
|
|
24
24
|
params: Record<string, any>;
|
|
25
|
+
goto: (url: string) => void;
|
|
25
26
|
};
|
|
26
27
|
export declare function RouterContextProvider({ children, client, cache, artifact_cache, component_cache, data_cache, ssr_signals, last_variables, session: ssrSession, }: {
|
|
27
28
|
children: React.ReactElement;
|
|
@@ -22,6 +22,7 @@ export declare function Router({ manifest, initialURL, assetPrefix, injectToStre
|
|
|
22
22
|
export declare const useLocation: () => {
|
|
23
23
|
pathname: string;
|
|
24
24
|
params: Record<string, any>;
|
|
25
|
+
goto: (url: string) => void;
|
|
25
26
|
};
|
|
26
27
|
export declare function RouterContextProvider({ children, client, cache, artifact_cache, component_cache, data_cache, ssr_signals, last_variables, session: ssrSession, }: {
|
|
27
28
|
children: React.ReactElement;
|
|
@@ -109,7 +109,17 @@ function Router({
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VariableContext.Provider, { value: variables, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VariableContext.Provider, { value: variables, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
113
|
+
LocationContext.Provider,
|
|
114
|
+
{
|
|
115
|
+
value: {
|
|
116
|
+
pathname: currentURL,
|
|
117
|
+
goto: setCurrentURL,
|
|
118
|
+
params: variables ?? {}
|
|
119
|
+
},
|
|
120
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageComponent, { url: currentURL }, page.id)
|
|
121
|
+
}
|
|
122
|
+
) });
|
|
113
123
|
}
|
|
114
124
|
const useLocation = () => (0, import_react2.useContext)(LocationContext);
|
|
115
125
|
function usePageData({
|
|
@@ -400,7 +410,9 @@ function useCurrentVariables() {
|
|
|
400
410
|
const VariableContext = import_react.default.createContext(null);
|
|
401
411
|
const LocationContext = import_react.default.createContext({
|
|
402
412
|
pathname: "",
|
|
403
|
-
params: {}
|
|
413
|
+
params: {},
|
|
414
|
+
goto: () => {
|
|
415
|
+
}
|
|
404
416
|
});
|
|
405
417
|
function useQueryResult(name) {
|
|
406
418
|
const { data_cache, artifact_cache } = useRouterContext();
|
|
@@ -22,6 +22,7 @@ export declare function Router({ manifest, initialURL, assetPrefix, injectToStre
|
|
|
22
22
|
export declare const useLocation: () => {
|
|
23
23
|
pathname: string;
|
|
24
24
|
params: Record<string, any>;
|
|
25
|
+
goto: (url: string) => void;
|
|
25
26
|
};
|
|
26
27
|
export declare function RouterContextProvider({ children, client, cache, artifact_cache, component_cache, data_cache, ssr_signals, last_variables, session: ssrSession, }: {
|
|
27
28
|
children: React.ReactElement;
|
|
@@ -68,7 +68,17 @@ function Router({
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
-
return /* @__PURE__ */ jsx(VariableContext.Provider, { value: variables, children: /* @__PURE__ */ jsx(
|
|
71
|
+
return /* @__PURE__ */ jsx(VariableContext.Provider, { value: variables, children: /* @__PURE__ */ jsx(
|
|
72
|
+
LocationContext.Provider,
|
|
73
|
+
{
|
|
74
|
+
value: {
|
|
75
|
+
pathname: currentURL,
|
|
76
|
+
goto: setCurrentURL,
|
|
77
|
+
params: variables ?? {}
|
|
78
|
+
},
|
|
79
|
+
children: /* @__PURE__ */ jsx(PageComponent, { url: currentURL }, page.id)
|
|
80
|
+
}
|
|
81
|
+
) });
|
|
72
82
|
}
|
|
73
83
|
const useLocation = () => useContext(LocationContext);
|
|
74
84
|
function usePageData({
|
|
@@ -359,7 +369,9 @@ function useCurrentVariables() {
|
|
|
359
369
|
const VariableContext = React.createContext(null);
|
|
360
370
|
const LocationContext = React.createContext({
|
|
361
371
|
pathname: "",
|
|
362
|
-
params: {}
|
|
372
|
+
params: {},
|
|
373
|
+
goto: () => {
|
|
374
|
+
}
|
|
363
375
|
});
|
|
364
376
|
function useQueryResult(name) {
|
|
365
377
|
const { data_cache, artifact_cache } = useRouterContext();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20240402060051",
|
|
4
4
|
"description": "The React plugin for houdini",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"recast": "^0.23.1",
|
|
44
44
|
"rollup": "^3.7.4",
|
|
45
45
|
"use-deep-compare-effect": "^1.8.1",
|
|
46
|
-
"houdini": "^0.0.0-
|
|
46
|
+
"houdini": "^0.0.0-20240402060051"
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
49
|
"build"
|