houdini-react 1.3.14 → 2.0.0-go.1

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.
Files changed (141) hide show
  1. package/package.json +89 -73
  2. package/shim.cjs +64 -0
  3. package/LICENSE +0 -21
  4. package/README.md +0 -36
  5. package/build/plugin/codegen/entries/documentWrappers.d.ts +0 -6
  6. package/build/plugin/codegen/entries/fallbacks.d.ts +0 -5
  7. package/build/plugin/codegen/entries/index.d.ts +0 -16
  8. package/build/plugin/codegen/entries/pages.d.ts +0 -2
  9. package/build/plugin/codegen/index.d.ts +0 -17
  10. package/build/plugin/codegen/manifest.d.ts +0 -5
  11. package/build/plugin/codegen/render.d.ts +0 -7
  12. package/build/plugin/codegen/router.d.ts +0 -7
  13. package/build/plugin/codegen/typeRoot.d.ts +0 -5
  14. package/build/plugin/config.d.ts +0 -4
  15. package/build/plugin/dedent.d.ts +0 -1
  16. package/build/plugin/extract.d.ts +0 -6
  17. package/build/plugin/index.d.ts +0 -5
  18. package/build/plugin/state.d.ts +0 -3
  19. package/build/plugin/transform.d.ts +0 -6
  20. package/build/plugin/vite.d.ts +0 -70
  21. package/build/plugin-cjs/index.js +0 -84192
  22. package/build/plugin-cjs/package.json +0 -1
  23. package/build/plugin-esm/index.js +0 -84184
  24. package/build/plugin-esm/package.json +0 -1
  25. package/build/runtime/client.d.ts +0 -3
  26. package/build/runtime/clientPlugin.d.ts +0 -3
  27. package/build/runtime/componentFields.d.ts +0 -9
  28. package/build/runtime/hooks/index.d.ts +0 -8
  29. package/build/runtime/hooks/useDeepCompareEffect.d.ts +0 -35
  30. package/build/runtime/hooks/useDocumentHandle.d.ts +0 -36
  31. package/build/runtime/hooks/useDocumentStore.d.ts +0 -11
  32. package/build/runtime/hooks/useDocumentSubscription.d.ts +0 -11
  33. package/build/runtime/hooks/useFragment.d.ts +0 -16
  34. package/build/runtime/hooks/useFragmentHandle.d.ts +0 -8
  35. package/build/runtime/hooks/useIsMounted.d.ts +0 -3
  36. package/build/runtime/hooks/useMutation.d.ts +0 -11
  37. package/build/runtime/hooks/useQuery.d.ts +0 -5
  38. package/build/runtime/hooks/useQueryHandle.d.ts +0 -10
  39. package/build/runtime/hooks/useSubscription.d.ts +0 -4
  40. package/build/runtime/hooks/useSubscriptionHandle.d.ts +0 -25
  41. package/build/runtime/index.d.ts +0 -14
  42. package/build/runtime/manifest.d.ts +0 -3
  43. package/build/runtime/routing/Router.d.ts +0 -62
  44. package/build/runtime/routing/cache.d.ts +0 -7
  45. package/build/runtime/routing/hooks.d.ts +0 -40
  46. package/build/runtime/routing/index.d.ts +0 -3
  47. package/build/runtime-cjs/client.d.ts +0 -3
  48. package/build/runtime-cjs/client.js +0 -27
  49. package/build/runtime-cjs/clientPlugin.d.ts +0 -3
  50. package/build/runtime-cjs/clientPlugin.js +0 -39
  51. package/build/runtime-cjs/componentFields.d.ts +0 -9
  52. package/build/runtime-cjs/componentFields.js +0 -83
  53. package/build/runtime-cjs/hooks/index.d.ts +0 -8
  54. package/build/runtime-cjs/hooks/index.js +0 -45
  55. package/build/runtime-cjs/hooks/useDeepCompareEffect.d.ts +0 -35
  56. package/build/runtime-cjs/hooks/useDeepCompareEffect.js +0 -72
  57. package/build/runtime-cjs/hooks/useDocumentHandle.d.ts +0 -36
  58. package/build/runtime-cjs/hooks/useDocumentHandle.js +0 -173
  59. package/build/runtime-cjs/hooks/useDocumentStore.d.ts +0 -11
  60. package/build/runtime-cjs/hooks/useDocumentStore.js +0 -72
  61. package/build/runtime-cjs/hooks/useDocumentSubscription.d.ts +0 -11
  62. package/build/runtime-cjs/hooks/useDocumentSubscription.js +0 -71
  63. package/build/runtime-cjs/hooks/useFragment.d.ts +0 -16
  64. package/build/runtime-cjs/hooks/useFragment.js +0 -97
  65. package/build/runtime-cjs/hooks/useFragmentHandle.d.ts +0 -8
  66. package/build/runtime-cjs/hooks/useFragmentHandle.js +0 -47
  67. package/build/runtime-cjs/hooks/useIsMounted.d.ts +0 -3
  68. package/build/runtime-cjs/hooks/useIsMounted.js +0 -38
  69. package/build/runtime-cjs/hooks/useMutation.d.ts +0 -11
  70. package/build/runtime-cjs/hooks/useMutation.js +0 -52
  71. package/build/runtime-cjs/hooks/useQuery.d.ts +0 -5
  72. package/build/runtime-cjs/hooks/useQuery.js +0 -32
  73. package/build/runtime-cjs/hooks/useQueryHandle.d.ts +0 -10
  74. package/build/runtime-cjs/hooks/useQueryHandle.js +0 -125
  75. package/build/runtime-cjs/hooks/useSubscription.d.ts +0 -4
  76. package/build/runtime-cjs/hooks/useSubscription.js +0 -32
  77. package/build/runtime-cjs/hooks/useSubscriptionHandle.d.ts +0 -25
  78. package/build/runtime-cjs/hooks/useSubscriptionHandle.js +0 -42
  79. package/build/runtime-cjs/index.d.ts +0 -14
  80. package/build/runtime-cjs/index.js +0 -83
  81. package/build/runtime-cjs/manifest.d.ts +0 -3
  82. package/build/runtime-cjs/manifest.js +0 -27
  83. package/build/runtime-cjs/package.json +0 -1
  84. package/build/runtime-cjs/routing/Router.d.ts +0 -62
  85. package/build/runtime-cjs/routing/Router.js +0 -532
  86. package/build/runtime-cjs/routing/cache.d.ts +0 -7
  87. package/build/runtime-cjs/routing/cache.js +0 -58
  88. package/build/runtime-cjs/routing/hooks.d.ts +0 -40
  89. package/build/runtime-cjs/routing/hooks.js +0 -89
  90. package/build/runtime-cjs/routing/index.d.ts +0 -3
  91. package/build/runtime-cjs/routing/index.js +0 -31
  92. package/build/runtime-esm/client.d.ts +0 -3
  93. package/build/runtime-esm/client.js +0 -5
  94. package/build/runtime-esm/clientPlugin.d.ts +0 -3
  95. package/build/runtime-esm/clientPlugin.js +0 -17
  96. package/build/runtime-esm/componentFields.d.ts +0 -9
  97. package/build/runtime-esm/componentFields.js +0 -59
  98. package/build/runtime-esm/hooks/index.d.ts +0 -8
  99. package/build/runtime-esm/hooks/index.js +0 -16
  100. package/build/runtime-esm/hooks/useDeepCompareEffect.d.ts +0 -35
  101. package/build/runtime-esm/hooks/useDeepCompareEffect.js +0 -41
  102. package/build/runtime-esm/hooks/useDocumentHandle.d.ts +0 -36
  103. package/build/runtime-esm/hooks/useDocumentHandle.js +0 -143
  104. package/build/runtime-esm/hooks/useDocumentStore.d.ts +0 -11
  105. package/build/runtime-esm/hooks/useDocumentStore.js +0 -42
  106. package/build/runtime-esm/hooks/useDocumentSubscription.d.ts +0 -11
  107. package/build/runtime-esm/hooks/useDocumentSubscription.js +0 -41
  108. package/build/runtime-esm/hooks/useFragment.d.ts +0 -16
  109. package/build/runtime-esm/hooks/useFragment.js +0 -66
  110. package/build/runtime-esm/hooks/useFragmentHandle.d.ts +0 -8
  111. package/build/runtime-esm/hooks/useFragmentHandle.js +0 -23
  112. package/build/runtime-esm/hooks/useIsMounted.d.ts +0 -3
  113. package/build/runtime-esm/hooks/useIsMounted.js +0 -14
  114. package/build/runtime-esm/hooks/useMutation.d.ts +0 -11
  115. package/build/runtime-esm/hooks/useMutation.js +0 -28
  116. package/build/runtime-esm/hooks/useQuery.d.ts +0 -5
  117. package/build/runtime-esm/hooks/useQuery.js +0 -8
  118. package/build/runtime-esm/hooks/useQueryHandle.d.ts +0 -10
  119. package/build/runtime-esm/hooks/useQueryHandle.js +0 -95
  120. package/build/runtime-esm/hooks/useSubscription.d.ts +0 -4
  121. package/build/runtime-esm/hooks/useSubscription.js +0 -8
  122. package/build/runtime-esm/hooks/useSubscriptionHandle.d.ts +0 -25
  123. package/build/runtime-esm/hooks/useSubscriptionHandle.js +0 -18
  124. package/build/runtime-esm/index.d.ts +0 -14
  125. package/build/runtime-esm/index.js +0 -48
  126. package/build/runtime-esm/manifest.d.ts +0 -3
  127. package/build/runtime-esm/manifest.js +0 -5
  128. package/build/runtime-esm/package.json +0 -1
  129. package/build/runtime-esm/routing/Router.d.ts +0 -62
  130. package/build/runtime-esm/routing/Router.js +0 -495
  131. package/build/runtime-esm/routing/cache.d.ts +0 -7
  132. package/build/runtime-esm/routing/cache.js +0 -33
  133. package/build/runtime-esm/routing/hooks.d.ts +0 -40
  134. package/build/runtime-esm/routing/hooks.js +0 -53
  135. package/build/runtime-esm/routing/index.d.ts +0 -3
  136. package/build/runtime-esm/routing/index.js +0 -6
  137. package/build/server/index.d.ts +0 -1
  138. package/build/server-cjs/index.js +0 -28
  139. package/build/server-cjs/package.json +0 -1
  140. package/build/server-esm/index.js +0 -4
  141. package/build/server-esm/package.json +0 -1
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var useMutation_exports = {};
20
- __export(useMutation_exports, {
21
- useMutation: () => useMutation
22
- });
23
- module.exports = __toCommonJS(useMutation_exports);
24
- var import_hooks = require("../routing/hooks");
25
- var import_useDocumentStore = require("./useDocumentStore");
26
- function useMutation({
27
- artifact
28
- }) {
29
- const [storeValue, observer] = (0, import_useDocumentStore.useDocumentStore)({ artifact });
30
- const pending = storeValue.fetching;
31
- const [session] = (0, import_hooks.useSession)();
32
- const mutate = ({
33
- metadata,
34
- fetch,
35
- variables,
36
- abortController,
37
- ...mutationConfig
38
- }) => observer.send({
39
- variables,
40
- metadata,
41
- session,
42
- abortController,
43
- stuff: {
44
- ...mutationConfig
45
- }
46
- });
47
- return [pending, mutate];
48
- }
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
51
- useMutation
52
- });
@@ -1,5 +0,0 @@
1
- import type { GraphQLVariables, GraphQLObject, QueryArtifact } from '$houdini/runtime/lib/types';
2
- import type { UseQueryConfig } from './useQueryHandle';
3
- export declare function useQuery<_Artifact extends QueryArtifact, _Data extends GraphQLObject = GraphQLObject, _Input extends GraphQLVariables = GraphQLVariables>(document: {
4
- artifact: QueryArtifact;
5
- }, variables?: any, config?: UseQueryConfig): _Data;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var useQuery_exports = {};
20
- __export(useQuery_exports, {
21
- useQuery: () => useQuery
22
- });
23
- module.exports = __toCommonJS(useQuery_exports);
24
- var import_useQueryHandle = require("./useQueryHandle");
25
- function useQuery(document, variables = null, config = {}) {
26
- const { data } = (0, import_useQueryHandle.useQueryHandle)(document, variables, config);
27
- return data;
28
- }
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- useQuery
32
- });
@@ -1,10 +0,0 @@
1
- import type { GraphQLObject, CachePolicies, QueryArtifact, GraphQLVariables } from '$houdini/runtime/lib/types';
2
- import type { DocumentHandle } from './useDocumentHandle';
3
- export declare function useQueryHandle<_Artifact extends QueryArtifact, _Data extends GraphQLObject = GraphQLObject, _Input extends GraphQLVariables = GraphQLVariables>({ artifact }: {
4
- artifact: QueryArtifact;
5
- }, variables?: any, config?: UseQueryConfig): DocumentHandle<_Artifact, _Data, _Input>;
6
- export type UseQueryConfig = {
7
- policy?: CachePolicies;
8
- metadata?: App.Metadata;
9
- fetchKey?: any;
10
- };
@@ -1,125 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
- var useQueryHandle_exports = {};
26
- __export(useQueryHandle_exports, {
27
- useQueryHandle: () => useQueryHandle
28
- });
29
- module.exports = __toCommonJS(useQueryHandle_exports);
30
- var import_lru = require("$houdini/runtime/lib/lru");
31
- var import_react = __toESM(require("react"));
32
- var import_routing = require("../routing");
33
- var import_useDocumentHandle = require("./useDocumentHandle");
34
- var import_useIsMounted = require("./useIsMounted");
35
- const promiseCache = (0, import_lru.createLRUCache)();
36
- function useQueryHandle({ artifact }, variables = null, config = {}) {
37
- const identifier = queryIdentifier({ artifact, variables, config });
38
- const suspenseValue = promiseCache.get(identifier);
39
- const client = (0, import_routing.useClient)();
40
- const isMountedRef = (0, import_useIsMounted.useIsMountedRef)();
41
- let [observer] = import_react.default.useState(
42
- client.observe({
43
- artifact,
44
- initialValue: suspenseValue?.resolved?.data ?? {}
45
- })
46
- );
47
- const suspenseTracker = import_react.default.useRef(false);
48
- const box = import_react.default.useRef(observer.state);
49
- const subscribe = import_react.default.useCallback(
50
- (fn) => {
51
- return observer.subscribe((val) => {
52
- box.current = val;
53
- if (isMountedRef.current && !suspenseTracker.current) {
54
- fn();
55
- }
56
- });
57
- },
58
- [observer]
59
- );
60
- const storeValue = import_react.default.useSyncExternalStore(subscribe, () => box.current);
61
- const handle = (0, import_useDocumentHandle.useDocumentHandle)({
62
- artifact,
63
- observer,
64
- storeValue
65
- });
66
- import_react.default.useEffect(() => {
67
- return () => {
68
- promiseCache.delete(identifier);
69
- };
70
- }, [identifier]);
71
- import_react.default.useEffect(() => {
72
- return () => {
73
- observer.cleanup();
74
- };
75
- }, [observer]);
76
- let result = storeValue.data;
77
- if (!suspenseValue) {
78
- let resolve = () => {
79
- };
80
- const loadPromise = new Promise((r) => resolve = r);
81
- const suspenseUnit = {
82
- then: loadPromise.then.bind(loadPromise),
83
- resolve,
84
- variables
85
- };
86
- promiseCache.set(identifier, suspenseUnit);
87
- handle.fetch({
88
- variables,
89
- stuff: {
90
- silenceLoading: true
91
- }
92
- }).then((value) => {
93
- suspenseUnit.resolved = {
94
- ...handle,
95
- data: value.data,
96
- partia: value.partial,
97
- artifact
98
- };
99
- suspenseUnit.resolve();
100
- });
101
- suspenseTracker.current = true;
102
- throw suspenseUnit;
103
- }
104
- if (!result && suspenseValue && !suspenseValue.resolved) {
105
- suspenseTracker.current = true;
106
- throw suspenseValue;
107
- }
108
- if (!result && suspenseValue?.resolved) {
109
- return suspenseValue.resolved;
110
- }
111
- return {
112
- ...handle,
113
- variables: storeValue.variables,
114
- data: result
115
- };
116
- }
117
- function queryIdentifier(args) {
118
- args.fetchKey ??= 0;
119
- const { artifact, variables, fetchKey } = args;
120
- return [artifact.name, JSON.stringify(variables), fetchKey].join("@@");
121
- }
122
- // Annotate the CommonJS export names for ESM import in node:
123
- 0 && (module.exports = {
124
- useQueryHandle
125
- });
@@ -1,4 +0,0 @@
1
- import type { SubscriptionArtifact, GraphQLObject, GraphQLVariables } from '$houdini/runtime/lib/types';
2
- export declare function useSubscription<_Result extends GraphQLObject, _Input extends GraphQLVariables>(document: {
3
- artifact: SubscriptionArtifact;
4
- }, variables: _Input): import("houdini").GraphQLObject | null;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var useSubscription_exports = {};
20
- __export(useSubscription_exports, {
21
- useSubscription: () => useSubscription
22
- });
23
- module.exports = __toCommonJS(useSubscription_exports);
24
- var import_useSubscriptionHandle = require("./useSubscriptionHandle");
25
- function useSubscription(document, variables) {
26
- const { data } = (0, import_useSubscriptionHandle.useSubscriptionHandle)(document, variables);
27
- return data;
28
- }
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- useSubscription
32
- });
@@ -1,25 +0,0 @@
1
- import type { SubscriptionArtifact, GraphQLObject, GraphQLVariables } from '$houdini/runtime/lib/types';
2
- export type SubscriptionHandle<_Result extends GraphQLObject, _Input extends GraphQLVariables> = {
3
- data: _Result | null;
4
- errors: {
5
- message: string;
6
- }[] | null;
7
- variables: _Input;
8
- listen: (args: {
9
- variables?: _Input;
10
- }) => void;
11
- unlisten: () => void;
12
- fetching: boolean;
13
- };
14
- export declare function useSubscriptionHandle<_Result extends GraphQLObject, _Input extends GraphQLVariables>({ artifact }: {
15
- artifact: SubscriptionArtifact;
16
- }, variables: _Input): {
17
- data: import("houdini").GraphQLObject | null;
18
- errors: {
19
- message: string;
20
- }[] | null;
21
- fetching: boolean;
22
- variables: _Input;
23
- unlisten: () => Promise<void>;
24
- listen: ({ metadata, session, fetch, variables, policy, stuff, cacheParams, setup, silenceEcho, abortController, }?: import("$houdini/lib").SendParams) => Promise<import("$houdini/runtime/lib/types").QueryResult<import("houdini").GraphQLObject, _Input>>;
25
- };
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var useSubscriptionHandle_exports = {};
20
- __export(useSubscriptionHandle_exports, {
21
- useSubscriptionHandle: () => useSubscriptionHandle
22
- });
23
- module.exports = __toCommonJS(useSubscriptionHandle_exports);
24
- var import_useDocumentSubscription = require("./useDocumentSubscription");
25
- function useSubscriptionHandle({ artifact }, variables) {
26
- const [storeValue, observer] = (0, import_useDocumentSubscription.useDocumentSubscription)({
27
- artifact,
28
- variables
29
- });
30
- return {
31
- data: storeValue.data,
32
- errors: storeValue.errors,
33
- fetching: storeValue.fetching,
34
- variables,
35
- unlisten: observer.cleanup,
36
- listen: observer.send
37
- };
38
- }
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {
41
- useSubscriptionHandle
42
- });
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import type { GraphQLObject } from '$houdini/lib/types';
3
- import type { Cache } from '$houdini/runtime/cache/cache';
4
- import { RouterCache } from './routing';
5
- export * from './hooks';
6
- export { router_cache, useSession, useLocation, useRoute } from './routing';
7
- export declare function Router({ cache, initialURL, artifact_cache, component_cache, data_cache, ssr_signals, last_variables, session, assetPrefix, injectToStream, }: {
8
- initialURL: string;
9
- initialVariables: GraphQLObject;
10
- cache: Cache;
11
- session?: App.Session;
12
- assetPrefix: string;
13
- injectToStream?: (chunk: string) => void;
14
- } & RouterCache): import("react").JSX.Element;
@@ -1,83 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
- mod
24
- ));
25
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
- var runtime_exports = {};
27
- __export(runtime_exports, {
28
- Router: () => Router,
29
- router_cache: () => import_routing2.router_cache,
30
- useLocation: () => import_routing2.useLocation,
31
- useRoute: () => import_routing2.useRoute,
32
- useSession: () => import_routing2.useSession
33
- });
34
- module.exports = __toCommonJS(runtime_exports);
35
- var import_jsx_runtime = require("react/jsx-runtime");
36
- var import_client = __toESM(require("./client"));
37
- var import_manifest = __toESM(require("./manifest"));
38
- var import_routing = require("./routing");
39
- __reExport(runtime_exports, require("./hooks"), module.exports);
40
- var import_routing2 = require("./routing");
41
- function Router({
42
- cache,
43
- initialURL,
44
- artifact_cache,
45
- component_cache,
46
- data_cache,
47
- ssr_signals,
48
- last_variables,
49
- session,
50
- assetPrefix,
51
- injectToStream
52
- }) {
53
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
- import_routing.RouterContextProvider,
55
- {
56
- client: (0, import_client.default)(),
57
- cache,
58
- artifact_cache,
59
- component_cache,
60
- data_cache,
61
- ssr_signals,
62
- last_variables,
63
- session,
64
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
- import_routing.Router,
66
- {
67
- initialURL,
68
- manifest: import_manifest.default,
69
- assetPrefix,
70
- injectToStream
71
- }
72
- )
73
- }
74
- );
75
- }
76
- // Annotate the CommonJS export names for ESM import in node:
77
- 0 && (module.exports = {
78
- Router,
79
- router_cache,
80
- useLocation,
81
- useRoute,
82
- useSession
83
- });
@@ -1,3 +0,0 @@
1
- import type { RouterManifest } from '$houdini/runtime/lib/types';
2
- declare const manifest: RouterManifest;
3
- export default manifest;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var manifest_exports = {};
20
- __export(manifest_exports, {
21
- default: () => manifest_default
22
- });
23
- module.exports = __toCommonJS(manifest_exports);
24
- const manifest = {};
25
- var manifest_default = manifest;
26
- // Annotate the CommonJS export names for ESM import in node:
27
- 0 && (module.exports = {});
@@ -1 +0,0 @@
1
- {"type":"commonjs"}
@@ -1,62 +0,0 @@
1
- import type { Cache } from '$houdini/runtime/cache/cache';
2
- import { DocumentStore, HoudiniClient } from '$houdini/runtime/client';
3
- import type { LRUCache } from '$houdini/runtime/lib/lru';
4
- import type { GraphQLObject, GraphQLVariables } from '$houdini/runtime/lib/types';
5
- import type { QueryArtifact } from '$houdini/runtime/lib/types';
6
- import type { RouterManifest } from '$houdini/runtime/router/types';
7
- import React from 'react';
8
- import { type SuspenseCache } from './cache';
9
- import { type DocumentHandle } from '../hooks/useDocumentHandle';
10
- import { type PageComponent, type PendingCache } from './hooks';
11
- type ComponentType = any;
12
- /**
13
- * Router is the top level entry point for the filesystem-based router.
14
- * It is responsible for loading various page sources (including API fetches) and
15
- * then rendering when appropriate.
16
- */
17
- export declare function Router({ manifest, initialURL, assetPrefix, injectToStream, }: {
18
- manifest: RouterManifest<ComponentType>;
19
- initialURL?: string;
20
- assetPrefix: string;
21
- injectToStream?: undefined | ((chunk: string) => void);
22
- }): React.JSX.Element;
23
- export declare function RouterContextProvider({ children, client, cache, artifact_cache, component_cache, data_cache, ssr_signals, last_variables, session: ssrSession, }: {
24
- children: React.ReactNode;
25
- client: HoudiniClient;
26
- cache: Cache;
27
- artifact_cache: SuspenseCache<QueryArtifact>;
28
- component_cache: SuspenseCache<PageComponent>;
29
- data_cache: SuspenseCache<DocumentStore<GraphQLObject, GraphQLVariables>>;
30
- ssr_signals: PendingCache;
31
- last_variables: LRUCache<GraphQLVariables>;
32
- session?: App.Session;
33
- }): React.JSX.Element;
34
- export declare function updateLocalSession(session: App.Session): void;
35
- export declare function useCurrentVariables(): GraphQLVariables;
36
- export declare function useQueryResult<_Data extends GraphQLObject, _Input extends GraphQLVariables>(name: string): [_Data | null, DocumentHandle<any, _Data, _Input>];
37
- export type RouterCache = {
38
- artifact_cache: SuspenseCache<QueryArtifact>;
39
- component_cache: SuspenseCache<PageComponent>;
40
- data_cache: SuspenseCache<DocumentStore<GraphQLObject, GraphQLVariables>>;
41
- last_variables: LRUCache<GraphQLVariables>;
42
- ssr_signals: PendingCache;
43
- };
44
- export declare function router_cache({ pending_queries, artifacts, components, initialData, initialVariables, initialArtifacts, }?: {
45
- pending_queries?: string[];
46
- artifacts?: Record<string, QueryArtifact>;
47
- components?: Record<string, PageComponent>;
48
- initialData?: Record<string, DocumentStore<GraphQLObject, GraphQLVariables>>;
49
- initialVariables?: Record<string, GraphQLVariables>;
50
- initialArtifacts?: Record<string, QueryArtifact>;
51
- }): RouterCache;
52
- export declare function PageContextProvider({ keys, children, }: {
53
- keys: string[];
54
- children: React.ReactNode;
55
- }): React.JSX.Element;
56
- export declare function useRoute<PageProps extends {
57
- Params: {};
58
- }>(): RouteProp<PageProps['Params']>;
59
- export type RouteProp<Params> = {
60
- params: Params;
61
- };
62
- export {};