@rsc-kit/core 0.7.2 → 0.9.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsc-kit/core",
3
- "version": "0.7.2",
3
+ "version": "0.9.0",
4
4
  "description": "React Server Components on any JavaScript server: a Vite plugin that discovers the route tree, and a host adapter that serves it.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,6 +25,18 @@
25
25
  "types": "./dist/runtime.d.ts",
26
26
  "default": "./dist/runtime.js"
27
27
  },
28
+ "./metadata": {
29
+ "types": "./dist/metadata.d.ts",
30
+ "default": "./dist/metadata.js"
31
+ },
32
+ "./query": {
33
+ "types": "./dist/query.d.ts",
34
+ "default": "./dist/query.js"
35
+ },
36
+ "./queryClient": {
37
+ "types": "./dist/js/queryClient.d.ts",
38
+ "default": "./dist/js/queryClient.js"
39
+ },
28
40
  "./errors": {
29
41
  "types": "./dist/js/errors.d.ts",
30
42
  "default": "./dist/js/errors.js"
@@ -61,10 +73,6 @@
61
73
  "types": "./dist/js/createViteRscApp.d.ts",
62
74
  "default": "./dist/js/createViteRscApp.js"
63
75
  },
64
- "./types": {
65
- "types": "./dist/types.d.ts",
66
- "default": "./dist/types.d.ts"
67
- },
68
76
  "./useOnline": {
69
77
  "types": "./dist/js/useOnline.d.ts",
70
78
  "default": "./dist/js/useOnline.js"
@@ -171,13 +179,14 @@
171
179
  "devDependencies": {
172
180
  "@happy-dom/global-registrator": "^20.12.0",
173
181
  "@tailwindcss/vite": "^4.3.3",
182
+ "@tanstack/react-query": "^5.102.8",
174
183
  "@types/bun": "^1.4.0",
175
184
  "@types/node": "^24.0.0",
176
- "@types/react": "^19.2.18",
177
- "@types/react-dom": "^19.2.7",
185
+ "@types/react": "^19.3.0",
186
+ "@types/react-dom": "^19.3.0",
178
187
  "@vitejs/plugin-rsc": "^0.5.34",
179
- "react": "^19.2.7",
180
- "react-dom": "^19.2.7",
188
+ "react": "^19.3.0",
189
+ "react-dom": "^19.3.0",
181
190
  "react-server-dom-webpack": "^19.2.7",
182
191
  "tailwindcss": "^4.3.3",
183
192
  "typescript": "^7.0.2",
@@ -187,7 +196,7 @@
187
196
  "scripts": {
188
197
  "test": "bun test tests/js",
189
198
  "typecheck": "tsc --noEmit && tsc --noEmit -p tests/js/routeTypes.tsconfig.json",
190
- "build": "rm -rf dist && tsc -p tsconfig.build.json && cp src/types.d.ts dist/types.d.ts",
199
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
191
200
  "prepack": "bun run build"
192
201
  },
193
202
  "repository": {
package/dist/types.d.ts DELETED
@@ -1,82 +0,0 @@
1
- // Ambient types for an RSC app. Copied into the project's source directory by
2
- // the host's build, so a page can annotate its metadata without importing
3
- // anything.
4
- //
5
- // The host global (rpc) is NOT declared here: its name is configurable, so the
6
- // host generates that declaration with the name it actually installed. Two
7
- // ambient declarations of the same function would conflict.
8
-
9
- /**
10
- * Page metadata for RSC pages.
11
- *
12
- * @example
13
- * ```tsx
14
- * export const metadata: Metadata = {
15
- * title: 'My Page',
16
- * description: 'Page description',
17
- * keywords: ['react', 'laravel'],
18
- * };
19
- * ```
20
- */
21
- interface IconDescriptor {
22
- url: string | URL;
23
- type?: string;
24
- sizes?: string;
25
- color?: string;
26
- rel?: string;
27
- media?: string;
28
- fetchPriority?: 'high' | 'low' | 'auto';
29
- }
30
-
31
- type IconURL = string | URL;
32
-
33
- interface Icons {
34
- icon?: IconURL | IconDescriptor | (IconURL | IconDescriptor)[];
35
- apple?: IconURL | IconDescriptor | (IconURL | IconDescriptor)[];
36
- shortcut?: IconURL | IconDescriptor | (IconURL | IconDescriptor)[];
37
- other?: IconDescriptor | IconDescriptor[];
38
- }
39
-
40
- /** A layout's title, wrapping the titles of the pages beneath it. */
41
- interface TitleTemplate {
42
- /** `%s` stands in for the page's own title. */
43
- template?: string;
44
- /** Used by a page that exports no title of its own. */
45
- default?: string;
46
- }
47
-
48
- interface Metadata {
49
- /** A string on a page; a template on a layout, applied to the pages below it. */
50
- title?: string | TitleTemplate;
51
- description?: string;
52
- keywords?: string | string[];
53
- author?: string;
54
- robots?: string;
55
- icons?: IconURL | (IconURL | IconDescriptor)[] | Icons | null;
56
- 'og:title'?: string;
57
- 'og:description'?: string;
58
- 'og:image'?: string;
59
- 'og:url'?: string;
60
- 'og:type'?: string;
61
- 'og:site_name'?: string;
62
- 'twitter:card'?: string;
63
- 'twitter:title'?: string;
64
- 'twitter:description'?: string;
65
- 'twitter:image'?: string;
66
- 'twitter:site'?: string;
67
- [key: string]: string | string[] | TitleTemplate | Icons | IconURL | (IconURL | IconDescriptor)[] | null | undefined;
68
- }
69
-
70
- /**
71
- * Metadata that depends on the request.
72
- *
73
- * Receives the same awaitables a page does, so one shape is learned rather
74
- * than two:
75
- *
76
- * export const generateMetadata: GenerateMetadata<{ slug: string }> =
77
- * async ({ params }) => ({ title: (await params).slug })
78
- */
79
- type GenerateMetadata<P = Record<string, string>> = (args: {
80
- params: Promise<P>;
81
- searchParams: Promise<URLSearchParams>;
82
- }) => Metadata | Promise<Metadata>;