@tanstack/react-start-client 1.166.29 → 1.166.31

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.
@@ -1,3 +1,2 @@
1
1
  export { StartClient } from './StartClient.js';
2
- export { renderRsc } from './renderRSC.js';
3
2
  export { hydrateStart } from './hydrateStart.js';
package/dist/esm/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  import { hydrateStart } from "./hydrateStart.js";
2
2
  import { StartClient } from "./StartClient.js";
3
- import { renderRsc } from "./renderRSC.js";
4
- export { StartClient, hydrateStart, renderRsc };
3
+ export { StartClient, hydrateStart };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-start-client",
3
- "version": "1.166.29",
3
+ "version": "1.166.31",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -43,9 +43,9 @@
43
43
  "node": ">=22.12.0"
44
44
  },
45
45
  "dependencies": {
46
- "@tanstack/react-router": "1.168.13",
47
- "@tanstack/router-core": "1.168.9",
48
- "@tanstack/start-client-core": "1.167.10"
46
+ "@tanstack/react-router": "1.168.14",
47
+ "@tanstack/router-core": "1.168.10",
48
+ "@tanstack/start-client-core": "1.167.12"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@testing-library/react": "^16.2.0",
package/src/index.tsx CHANGED
@@ -1,3 +1,2 @@
1
1
  export { StartClient } from './StartClient'
2
- export { renderRsc } from './renderRSC'
3
2
  export { hydrateStart } from './hydrateStart'
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function renderRsc(input: any): React.JSX.Element;
@@ -1,25 +0,0 @@
1
- import { isValidElement } from "react";
2
- import { invariant } from "@tanstack/router-core";
3
- //#region src/renderRSC.tsx
4
- function renderRsc(input) {
5
- if (isValidElement(input)) return input;
6
- if (typeof input === "object" && !input.state) input.state = {
7
- status: "pending",
8
- promise: Promise.resolve().then(() => {
9
- if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: renderRSC() is coming soon!");
10
- invariant();
11
- }).then((element) => {
12
- input.state.value = element;
13
- input.state.status = "success";
14
- }).catch((err) => {
15
- input.state.status = "error";
16
- input.state.error = err;
17
- })
18
- };
19
- if (input.state.status === "pending") throw input.state.promise;
20
- return input.state.value;
21
- }
22
- //#endregion
23
- export { renderRsc };
24
-
25
- //# sourceMappingURL=renderRSC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderRSC.js","names":[],"sources":["../../src/renderRSC.tsx"],"sourcesContent":["// TODO: RSCs\nimport { isValidElement } from 'react'\nimport { invariant } from '@tanstack/router-core'\nimport type React from 'react'\n\nexport function renderRsc(input: any): React.JSX.Element {\n if (isValidElement(input)) {\n return input\n }\n\n if (typeof input === 'object' && !input.state) {\n input.state = {\n status: 'pending',\n promise: Promise.resolve()\n .then(() => {\n let element\n\n // We're in node\n // TODO: RSCs\n // if (reactDom.createFromNodeStream) {\n // const stream = await import('node:stream')\n\n // let body: any = input\n\n // // Unwrap the response\n // if (input instanceof Response) {\n // body = input.body\n // }\n\n // // Convert ReadableStream to NodeJS stream.Readable\n // if (body instanceof ReadableStream) {\n // body = stream.Readable.fromWeb(body as any)\n // }\n\n // if (stream.Readable.isReadable(body)) {\n // // body = copyStreamToRaw(body)\n // } else if (input.text) {\n // // create a readable stream by awaiting the text method\n // body = new stream.Readable({\n // async read() {\n // input.text().then((value: any) => {\n // this.push(value)\n // this.push(null)\n // })\n // },\n // })\n // } else {\n // console.error('input', input)\n // throw new Error('Unexpected rsc input type 👆')\n // }\n\n // element = await reactDom.createFromNodeStream(body)\n // } else {\n // // We're in the browser\n // if (input.body instanceof ReadableStream) {\n // input = input.body\n // }\n\n // if (input instanceof ReadableStream) {\n // element = await reactDom.createFromReadableStream(input)\n // }\n\n // if (input instanceof Response) {\n // // copy to the response body to cache the raw data\n // element = await reactDom.createFromFetch(input)\n // }\n // }\n\n // return element\n\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Invariant failed: renderRSC() is coming soon!')\n }\n\n invariant()\n })\n .then((element) => {\n input.state.value = element\n input.state.status = 'success'\n })\n .catch((err) => {\n input.state.status = 'error'\n input.state.error = err\n }),\n }\n }\n\n if (input.state.status === 'pending') {\n throw input.state.promise\n }\n\n return input.state.value\n}\n"],"mappings":";;;AAKA,SAAgB,UAAU,OAA+B;AACvD,KAAI,eAAe,MAAM,CACvB,QAAO;AAGT,KAAI,OAAO,UAAU,YAAY,CAAC,MAAM,MACtC,OAAM,QAAQ;EACZ,QAAQ;EACR,SAAS,QAAQ,SAAS,CACvB,WAAW;AAwDV,OAAA,QAAA,IAAA,aAA6B,aAC3B,OAAM,IAAI,MAAM,gDAAgD;AAGlE,cAAW;IACX,CACD,MAAM,YAAY;AACjB,SAAM,MAAM,QAAQ;AACpB,SAAM,MAAM,SAAS;IACrB,CACD,OAAO,QAAQ;AACd,SAAM,MAAM,SAAS;AACrB,SAAM,MAAM,QAAQ;IACpB;EACL;AAGH,KAAI,MAAM,MAAM,WAAW,UACzB,OAAM,MAAM,MAAM;AAGpB,QAAO,MAAM,MAAM"}
package/src/renderRSC.tsx DELETED
@@ -1,93 +0,0 @@
1
- // TODO: RSCs
2
- import { isValidElement } from 'react'
3
- import { invariant } from '@tanstack/router-core'
4
- import type React from 'react'
5
-
6
- export function renderRsc(input: any): React.JSX.Element {
7
- if (isValidElement(input)) {
8
- return input
9
- }
10
-
11
- if (typeof input === 'object' && !input.state) {
12
- input.state = {
13
- status: 'pending',
14
- promise: Promise.resolve()
15
- .then(() => {
16
- let element
17
-
18
- // We're in node
19
- // TODO: RSCs
20
- // if (reactDom.createFromNodeStream) {
21
- // const stream = await import('node:stream')
22
-
23
- // let body: any = input
24
-
25
- // // Unwrap the response
26
- // if (input instanceof Response) {
27
- // body = input.body
28
- // }
29
-
30
- // // Convert ReadableStream to NodeJS stream.Readable
31
- // if (body instanceof ReadableStream) {
32
- // body = stream.Readable.fromWeb(body as any)
33
- // }
34
-
35
- // if (stream.Readable.isReadable(body)) {
36
- // // body = copyStreamToRaw(body)
37
- // } else if (input.text) {
38
- // // create a readable stream by awaiting the text method
39
- // body = new stream.Readable({
40
- // async read() {
41
- // input.text().then((value: any) => {
42
- // this.push(value)
43
- // this.push(null)
44
- // })
45
- // },
46
- // })
47
- // } else {
48
- // console.error('input', input)
49
- // throw new Error('Unexpected rsc input type 👆')
50
- // }
51
-
52
- // element = await reactDom.createFromNodeStream(body)
53
- // } else {
54
- // // We're in the browser
55
- // if (input.body instanceof ReadableStream) {
56
- // input = input.body
57
- // }
58
-
59
- // if (input instanceof ReadableStream) {
60
- // element = await reactDom.createFromReadableStream(input)
61
- // }
62
-
63
- // if (input instanceof Response) {
64
- // // copy to the response body to cache the raw data
65
- // element = await reactDom.createFromFetch(input)
66
- // }
67
- // }
68
-
69
- // return element
70
-
71
- if (process.env.NODE_ENV !== 'production') {
72
- throw new Error('Invariant failed: renderRSC() is coming soon!')
73
- }
74
-
75
- invariant()
76
- })
77
- .then((element) => {
78
- input.state.value = element
79
- input.state.status = 'success'
80
- })
81
- .catch((err) => {
82
- input.state.status = 'error'
83
- input.state.error = err
84
- }),
85
- }
86
- }
87
-
88
- if (input.state.status === 'pending') {
89
- throw input.state.promise
90
- }
91
-
92
- return input.state.value
93
- }