houdini-react 1.2.0-react.1 → 1.2.6
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/README.md +1 -1
- package/build/plugin/codegen/entries.d.ts +6 -0
- package/build/plugin/codegen/index.d.ts +14 -0
- package/build/plugin/codegen/manifest.d.ts +42 -0
- package/build/plugin/codegen/render.d.ts +2 -0
- package/build/plugin/codegen/router.d.ts +8 -0
- package/build/plugin/codegen/typeRoot.d.ts +6 -0
- package/build/plugin/config.d.ts +1 -0
- package/build/plugin/conventions.d.ts +24 -0
- package/build/plugin/dedent.d.ts +1 -0
- package/build/plugin/extract.d.ts +1 -1
- package/build/plugin/index.d.ts +4 -2
- package/build/plugin/vite.d.ts +19 -0
- package/build/plugin-cjs/index.js +32672 -1115
- package/build/plugin-esm/index.js +32666 -1111
- package/build/runtime/client.d.ts +3 -0
- package/build/runtime/clientPlugin.d.ts +3 -0
- package/build/runtime/hooks/useDocumentHandle.d.ts +4 -4
- package/build/runtime/hooks/useDocumentStore.d.ts +6 -5
- package/build/runtime/hooks/useDocumentSubscription.d.ts +4 -3
- package/build/runtime/hooks/useFragment.d.ts +3 -2
- package/build/runtime/hooks/useFragmentHandle.d.ts +2 -3
- package/build/runtime/hooks/useMutation.d.ts +2 -2
- package/build/runtime/hooks/useQuery.d.ts +3 -3
- package/build/runtime/hooks/useQueryHandle.d.ts +3 -3
- package/build/runtime/hooks/useSubscription.d.ts +2 -2
- package/build/runtime/hooks/useSubscriptionHandle.d.ts +3 -3
- package/build/runtime/index.d.ts +29 -1
- package/build/runtime/manifest.d.ts +3 -0
- package/build/runtime/routing/components/Link.d.ts +5 -0
- package/build/runtime/routing/components/Router.d.ts +52 -0
- package/build/runtime/routing/components/index.d.ts +2 -0
- package/build/runtime/routing/index.d.ts +3 -0
- package/build/runtime/routing/lib/cache.d.ts +7 -0
- package/build/runtime/routing/lib/match.d.ts +38 -0
- package/build/runtime/routing/lib/types.d.ts +24 -0
- package/build/runtime-cjs/client.d.ts +3 -0
- package/build/runtime-cjs/client.js +26 -0
- package/build/runtime-cjs/clientPlugin.d.ts +3 -0
- package/build/{next-cjs/index.js → runtime-cjs/clientPlugin.js} +15 -26
- package/build/runtime-cjs/hooks/useDocumentHandle.d.ts +4 -4
- package/build/runtime-cjs/hooks/useDocumentHandle.js +0 -1
- package/build/runtime-cjs/hooks/useDocumentStore.d.ts +6 -5
- package/build/runtime-cjs/hooks/useDocumentStore.js +9 -4
- package/build/runtime-cjs/hooks/useDocumentSubscription.d.ts +4 -3
- package/build/runtime-cjs/hooks/useDocumentSubscription.js +13 -8
- package/build/runtime-cjs/hooks/useFragment.d.ts +3 -2
- package/build/runtime-cjs/hooks/useFragment.js +9 -7
- package/build/runtime-cjs/hooks/useFragmentHandle.d.ts +2 -3
- package/build/runtime-cjs/hooks/useMutation.d.ts +2 -2
- package/build/runtime-cjs/hooks/useQuery.d.ts +3 -3
- package/build/runtime-cjs/hooks/useQueryHandle.d.ts +3 -3
- package/build/runtime-cjs/hooks/useQueryHandle.js +4 -4
- package/build/runtime-cjs/hooks/useSubscription.d.ts +2 -2
- package/build/runtime-cjs/hooks/useSubscriptionHandle.d.ts +3 -3
- package/build/runtime-cjs/index.d.ts +29 -1
- package/build/runtime-cjs/index.js +87 -3
- package/build/runtime-cjs/manifest.d.ts +3 -0
- package/build/runtime-cjs/manifest.js +27 -0
- package/build/runtime-cjs/routing/components/Link.d.ts +5 -0
- package/build/runtime-cjs/{hooks/useHoudiniClient.js → routing/components/Link.js} +22 -13
- package/build/runtime-cjs/routing/components/Router.d.ts +52 -0
- package/build/runtime-cjs/routing/components/Router.js +267 -0
- package/build/runtime-cjs/routing/components/index.d.ts +2 -0
- package/build/runtime-cjs/{context.js → routing/components/index.js} +13 -19
- package/build/runtime-cjs/routing/index.d.ts +3 -0
- package/build/runtime-cjs/routing/index.js +30 -0
- package/build/runtime-cjs/routing/lib/cache.d.ts +7 -0
- package/build/runtime-cjs/{lib → routing/lib}/cache.js +23 -40
- package/build/runtime-cjs/routing/lib/match.d.ts +38 -0
- package/build/runtime-cjs/routing/lib/match.js +149 -0
- package/build/runtime-cjs/routing/lib/types.d.ts +24 -0
- package/build/runtime-cjs/routing/lib/types.js +16 -0
- package/build/runtime-esm/client.d.ts +3 -0
- package/build/runtime-esm/client.js +4 -0
- package/build/runtime-esm/clientPlugin.d.ts +3 -0
- package/build/runtime-esm/clientPlugin.js +17 -0
- package/build/runtime-esm/hooks/useDocumentHandle.d.ts +4 -4
- package/build/runtime-esm/hooks/useDocumentHandle.js +1 -4
- package/build/runtime-esm/hooks/useDocumentStore.d.ts +6 -5
- package/build/runtime-esm/hooks/useDocumentStore.js +9 -4
- package/build/runtime-esm/hooks/useDocumentSubscription.d.ts +4 -3
- package/build/runtime-esm/hooks/useDocumentSubscription.js +13 -8
- package/build/runtime-esm/hooks/useFragment.d.ts +3 -2
- package/build/runtime-esm/hooks/useFragment.js +9 -7
- package/build/runtime-esm/hooks/useFragmentHandle.d.ts +2 -3
- package/build/runtime-esm/hooks/useMutation.d.ts +2 -2
- package/build/runtime-esm/hooks/useQuery.d.ts +3 -3
- package/build/runtime-esm/hooks/useQueryHandle.d.ts +3 -3
- package/build/runtime-esm/hooks/useQueryHandle.js +4 -4
- package/build/runtime-esm/hooks/useSubscription.d.ts +2 -2
- package/build/runtime-esm/hooks/useSubscriptionHandle.d.ts +3 -3
- package/build/runtime-esm/index.d.ts +29 -1
- package/build/runtime-esm/index.js +79 -2
- package/build/runtime-esm/manifest.d.ts +3 -0
- package/build/runtime-esm/manifest.js +5 -0
- package/build/runtime-esm/routing/components/Link.d.ts +5 -0
- package/build/runtime-esm/routing/components/Link.js +21 -0
- package/build/runtime-esm/routing/components/Router.d.ts +52 -0
- package/build/runtime-esm/routing/components/Router.js +230 -0
- package/build/runtime-esm/routing/components/index.d.ts +2 -0
- package/build/runtime-esm/routing/components/index.js +8 -0
- package/build/runtime-esm/routing/index.d.ts +3 -0
- package/build/runtime-esm/routing/index.js +5 -0
- package/build/runtime-esm/routing/lib/cache.d.ts +7 -0
- package/build/runtime-esm/routing/lib/cache.js +29 -0
- package/build/runtime-esm/routing/lib/match.d.ts +38 -0
- package/build/runtime-esm/routing/lib/match.js +122 -0
- package/build/runtime-esm/routing/lib/types.d.ts +24 -0
- package/build/runtime-esm/routing/lib/types.js +0 -0
- package/package.json +7 -11
- package/build/next/index.d.ts +0 -2
- package/build/next-cjs/package.json +0 -1
- package/build/next-esm/index.js +0 -26
- package/build/next-esm/package.json +0 -1
- package/build/runtime/context.d.ts +0 -7
- package/build/runtime/hooks/useHoudiniClient.d.ts +0 -2
- package/build/runtime/lib/cache.d.ts +0 -62
- package/build/runtime-cjs/context.d.ts +0 -7
- package/build/runtime-cjs/hooks/useHoudiniClient.d.ts +0 -2
- package/build/runtime-cjs/lib/cache.d.ts +0 -62
- package/build/runtime-esm/context.d.ts +0 -7
- package/build/runtime-esm/context.js +0 -10
- package/build/runtime-esm/hooks/useHoudiniClient.d.ts +0 -2
- package/build/runtime-esm/hooks/useHoudiniClient.js +0 -12
- package/build/runtime-esm/lib/cache.d.ts +0 -62
- package/build/runtime-esm/lib/cache.js +0 -47
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assets/logo_l.svg">
|
|
4
4
|
<img height="140" alt="Houdini's logo (dark or light)" src="https://raw.githubusercontent.com/HoudiniGraphql/houdini/main/.github/assets/logo_d.svg">
|
|
5
5
|
</picture>
|
|
6
6
|
<br />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GenerateHookInput } from 'houdini';
|
|
2
|
+
import type { ProjectManifest } from './manifest';
|
|
3
|
+
/**
|
|
4
|
+
* The router is fundamentally a component that knows how to render
|
|
5
|
+
* a particular component tree for a given url. This is driven by something
|
|
6
|
+
* we call the applications "manifest".
|
|
7
|
+
*
|
|
8
|
+
* In react, the tree of route directories maps to a component hierarchy
|
|
9
|
+
* with suspense boundaries sprinkled when there is a loading directive
|
|
10
|
+
* present on a query.
|
|
11
|
+
*/
|
|
12
|
+
export default function routerCodegen({ config, manifest, }: GenerateHookInput & {
|
|
13
|
+
manifest: ProjectManifest;
|
|
14
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Config } from 'houdini';
|
|
2
|
+
/**
|
|
3
|
+
* Walk down the routes directory and build a normalized description of the project's
|
|
4
|
+
* filesystem.
|
|
5
|
+
*/
|
|
6
|
+
export declare function load_manifest(args: {
|
|
7
|
+
config: Config;
|
|
8
|
+
}): Promise<ProjectManifest>;
|
|
9
|
+
export declare function extractQueries(source: string): Promise<string[]>;
|
|
10
|
+
export type ProjectManifest = {
|
|
11
|
+
/** All of the pages in the project */
|
|
12
|
+
pages: Record<string, PageManifest>;
|
|
13
|
+
/** All of the layouts in the project */
|
|
14
|
+
layouts: Record<string, PageManifest>;
|
|
15
|
+
/** All of the page queries in the project */
|
|
16
|
+
page_queries: Record<string, QueryManifest>;
|
|
17
|
+
/** All of the layout queries in the project */
|
|
18
|
+
layout_queries: Record<string, QueryManifest>;
|
|
19
|
+
};
|
|
20
|
+
export type PageManifest = {
|
|
21
|
+
id: string;
|
|
22
|
+
/** the name of every query that the page depends on */
|
|
23
|
+
queries: string[];
|
|
24
|
+
/** the list of queries that this page could potentially ask for */
|
|
25
|
+
query_options: string[];
|
|
26
|
+
/** the full url pattern of the page */
|
|
27
|
+
url: string;
|
|
28
|
+
/** the ids of layouts that wrap this page */
|
|
29
|
+
layouts: string[];
|
|
30
|
+
/** The filepath of the unit */
|
|
31
|
+
path: string;
|
|
32
|
+
};
|
|
33
|
+
export type QueryManifest = {
|
|
34
|
+
/** the name of the query */
|
|
35
|
+
name: string;
|
|
36
|
+
/** the url tied with the query */
|
|
37
|
+
url: string;
|
|
38
|
+
/** wether the query uses the loading directive (ie, wants a fallback) */
|
|
39
|
+
loading: boolean;
|
|
40
|
+
/** The filepath of the unit */
|
|
41
|
+
path: string;
|
|
42
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Config } from 'houdini';
|
|
2
|
+
import type { ProjectManifest } from './manifest';
|
|
3
|
+
export declare function format_router_manifest({ config, manifest, exportDefaultStatement, }: {
|
|
4
|
+
config: Config;
|
|
5
|
+
manifest: ProjectManifest;
|
|
6
|
+
exportDefaultStatement: (name: string) => string;
|
|
7
|
+
importStatement: (from: string, as: string) => string;
|
|
8
|
+
}): string;
|
package/build/plugin/config.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Config } from 'houdini';
|
|
2
2
|
import type { HoudiniReactPluginConfig } from '.';
|
|
3
3
|
export declare function plugin_config(config: Config): Required<HoudiniReactPluginConfig>;
|
|
4
|
+
export declare function test_config(extraConfig?: Partial<HoudiniReactPluginConfig>): Promise<Config>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Config } from 'houdini';
|
|
2
|
+
/** The location of the project's router */
|
|
3
|
+
export declare function router_path(config: Config): string;
|
|
4
|
+
/** The location of the page component */
|
|
5
|
+
export declare function page_entry_path(config: Config, id: string, base?: string): string;
|
|
6
|
+
export declare function render_client_path(config: Config, base?: string): string;
|
|
7
|
+
export declare function render_server_path(config: Config, base?: string): string;
|
|
8
|
+
export declare function render_app_path(config: Config, base?: string): string;
|
|
9
|
+
export declare function page_unit_path(config: Config, id: string, base?: string): string;
|
|
10
|
+
export declare function layout_unit_path(config: Config, id: string, base?: string): string;
|
|
11
|
+
export declare function fallback_unit_path(config: Config, which: 'page' | 'layout', id: string, base?: string): string;
|
|
12
|
+
/** Load the page query for the given route from disk */
|
|
13
|
+
export declare function read_pageQuery(base: string): Promise<(string | null)[]>;
|
|
14
|
+
/** Load the page view for the given route from disk */
|
|
15
|
+
export declare function read_pageView(base: string): Promise<string[] | null[]>;
|
|
16
|
+
/** Load the layout query for the given route from disk */
|
|
17
|
+
export declare function read_layoutQuery(base: string): Promise<(string | null)[]>;
|
|
18
|
+
/** Load the layout view for the given route from disk */
|
|
19
|
+
export declare function read_layoutView(base: string): Promise<string[] | null[]>;
|
|
20
|
+
export declare function router_index_path(config: Config): string;
|
|
21
|
+
export declare function is_layout(path: string): boolean;
|
|
22
|
+
/** Transforms paths to ids */
|
|
23
|
+
export declare function normalize_path(path: string): string;
|
|
24
|
+
export declare function page_entries_dir(config: Config, base?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dedent(indentString: string, input?: string): string;
|
package/build/plugin/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { type Plugin } from 'houdini';
|
|
2
|
+
export declare const hooks: Plugin;
|
|
3
|
+
declare const _default: import("houdini").PluginInit;
|
|
4
|
+
export default _default;
|
|
3
5
|
export type HoudiniReactPluginConfig = {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Config } from 'houdini';
|
|
2
|
+
import type { ViteDevServer } from 'vite';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
config?: ((config: Config) => import("vite").UserConfig) | undefined;
|
|
5
|
+
resolveId?: import("rollup").ObjectHook<(this: import("rollup").PluginContext, source: string, importer: string | undefined, options: {
|
|
6
|
+
config: Config;
|
|
7
|
+
custom?: import("rollup").CustomPluginOptions | undefined;
|
|
8
|
+
ssr?: boolean | undefined;
|
|
9
|
+
isEntry: boolean;
|
|
10
|
+
}) => import("rollup").ResolveIdResult | Promise<import("rollup").ResolveIdResult>, {}> | undefined;
|
|
11
|
+
load?: import("rollup").ObjectHook<(this: import("rollup").PluginContext, id: string, options: {
|
|
12
|
+
config: Config;
|
|
13
|
+
ssr?: boolean | undefined;
|
|
14
|
+
}) => import("rollup").LoadResult | Promise<import("rollup").LoadResult>, {}> | undefined;
|
|
15
|
+
configureServer?: import("rollup").ObjectHook<(this: void, server: ViteDevServer & {
|
|
16
|
+
houdiniConfig: Config;
|
|
17
|
+
}) => void | (() => void) | Promise<void | (() => void)>, {}> | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
export default _default;
|