@tanstack/react-router 1.120.16 → 1.120.18
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/dist/cjs/ClientOnly.cjs.map +1 -1
- package/dist/cjs/ClientOnly.d.cts +1 -1
- package/dist/esm/ClientOnly.d.ts +1 -1
- package/dist/esm/ClientOnly.js.map +1 -1
- package/dist/llms/cjs/index.cjs +36 -36
- package/dist/llms/cjs/index.d.cts +1 -3
- package/dist/llms/cjs/rules/{api.js → api.cjs} +2 -5
- package/dist/llms/cjs/rules/api.d.cts +0 -0
- package/dist/llms/cjs/rules/{guide.js → guide.cjs} +2 -5
- package/dist/llms/cjs/rules/guide.d.cts +0 -0
- package/dist/llms/cjs/rules/{routing.js → routing.cjs} +2 -5
- package/dist/llms/cjs/rules/routing.d.cts +0 -0
- package/dist/llms/cjs/rules/{setup-and-architecture.js → setup-and-architecture.cjs} +2 -5
- package/dist/llms/cjs/rules/setup-and-architecture.d.cts +0 -0
- package/dist/llms/esm/index.d.ts +1 -1
- package/dist/llms/esm/index.js +36 -34
- package/dist/llms/esm/rules/api.js +2 -3
- package/dist/llms/esm/rules/guide.js +2 -3
- package/dist/llms/esm/rules/routing.js +2 -3
- package/dist/llms/esm/rules/setup-and-architecture.js +2 -3
- package/package.json +3 -3
- package/src/ClientOnly.tsx +1 -1
- package/dist/llms/cjs/rules/api.d.ts +0 -2
- package/dist/llms/cjs/rules/guide.d.ts +0 -2
- package/dist/llms/cjs/rules/routing.d.ts +0 -2
- package/dist/llms/cjs/rules/setup-and-architecture.d.ts +0 -2
- package/dist/llms/esm/rules/api.d.ts +0 -2
- package/dist/llms/esm/rules/guide.d.ts +0 -2
- package/dist/llms/esm/rules/routing.d.ts +0 -2
- package/dist/llms/esm/rules/setup-and-architecture.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientOnly.cjs","sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render
|
|
1
|
+
{"version":3,"file":"ClientOnly.cjs","sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: React.ReactNode\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: React.ReactNode\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly({ children, fallback = null }: ClientOnlyProps) {\n return useHydrated() ? (\n <React.Fragment>{children}</React.Fragment>\n ) : (\n <React.Fragment>{fallback}</React.Fragment>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * let hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nfunction useHydrated(): boolean {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n )\n}\n\nfunction subscribe() {\n return () => {}\n}\n"],"names":["jsx"],"mappings":";;;;AA8BO,SAAS,WAAW,EAAE,UAAU,WAAW,QAAyB;AACzE,SAAO,YAAY,IAChBA,2BAAAA,IAAA,MAAM,UAAN,EAAgB,SAAS,CAAA,IAEzBA,2BAAAA,IAAA,MAAM,UAAN,EAAgB,UAAS,SAAA,CAAA;AAE9B;AAqBA,SAAS,cAAuB;AAC9B,SAAO,MAAM;AAAA,IACX;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;AAEA,SAAS,YAAY;AACnB,SAAO,MAAM;AAAA,EAAC;AAChB;;"}
|
package/dist/esm/ClientOnly.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientOnly.js","sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render
|
|
1
|
+
{"version":3,"file":"ClientOnly.js","sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: React.ReactNode\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: React.ReactNode\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly({ children, fallback = null }: ClientOnlyProps) {\n return useHydrated() ? (\n <React.Fragment>{children}</React.Fragment>\n ) : (\n <React.Fragment>{fallback}</React.Fragment>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * let hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nfunction useHydrated(): boolean {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n )\n}\n\nfunction subscribe() {\n return () => {}\n}\n"],"names":["React"],"mappings":";;AA8BO,SAAS,WAAW,EAAE,UAAU,WAAW,QAAyB;AACzE,SAAO,YAAY,IAChB,oBAAAA,eAAM,UAAN,EAAgB,SAAS,CAAA,IAEzB,oBAAAA,eAAM,UAAN,EAAgB,UAAS,SAAA,CAAA;AAE9B;AAqBA,SAAS,cAAuB;AAC9B,SAAOA,eAAM;AAAA,IACX;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;AAEA,SAAS,YAAY;AACnB,SAAO,MAAM;AAAA,EAAC;AAChB;"}
|
package/dist/llms/cjs/index.cjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const setup_and_architecture_js_1 = require("./rules/setup-and-architecture.js");
|
|
1
|
+
const api = require('./rules/api.cjs')
|
|
2
|
+
const guide = require('./rules/guide.cjs')
|
|
3
|
+
const routing = require('./rules/routing.cjs')
|
|
4
|
+
const setupAndArchitecture = require('./rules/setup-and-architecture.cjs')
|
|
5
|
+
|
|
7
6
|
const rules = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
]
|
|
37
|
-
|
|
7
|
+
{
|
|
8
|
+
name: 'api',
|
|
9
|
+
description: 'TanStack Router: API',
|
|
10
|
+
rule: api,
|
|
11
|
+
alwaysApply: false,
|
|
12
|
+
globs: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'guide',
|
|
16
|
+
description: 'TanStack Router: Guide',
|
|
17
|
+
rule: guide,
|
|
18
|
+
alwaysApply: false,
|
|
19
|
+
globs: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'routing',
|
|
23
|
+
description: 'TanStack Router: Routing',
|
|
24
|
+
rule: routing,
|
|
25
|
+
alwaysApply: false,
|
|
26
|
+
globs: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'setup-and-architecture',
|
|
30
|
+
description: 'TanStack Router: Setup and Architecture',
|
|
31
|
+
rule: setupAndArchitecture,
|
|
32
|
+
alwaysApply: false,
|
|
33
|
+
globs: ['package.json', 'vite.config.ts', 'tsconfig.json', 'src/**/*.ts', 'src/**/*.tsx'],
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
module.exports = rules
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const content = `# ActiveLinkOptions type
|
|
1
|
+
module.exports = `# ActiveLinkOptions type
|
|
4
2
|
|
|
5
3
|
The \`ActiveLinkOptions\` type extends the [\`LinkOptions\`](../LinkOptionsType.md) type and contains additional options that can be used to describe how a link should be styled when it is active.
|
|
6
4
|
|
|
@@ -4240,5 +4238,4 @@ function Component() {
|
|
|
4240
4238
|
}
|
|
4241
4239
|
\`\`\`
|
|
4242
4240
|
|
|
4243
|
-
`;
|
|
4244
|
-
exports.default = content;
|
|
4241
|
+
`;
|
|
File without changes
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const content = `# Authenticated Routes
|
|
1
|
+
module.exports = `# Authenticated Routes
|
|
4
2
|
|
|
5
3
|
Authentication is an extremely common requirement for web applications. In this guide, we'll walk through how to use TanStack Router to build protected routes, and how to redirect users to login if they try to access them.
|
|
6
4
|
|
|
@@ -6274,5 +6272,4 @@ const { enable, disable, navigate } = useConditionalNavigate({
|
|
|
6274
6272
|
})
|
|
6275
6273
|
\`\`\`
|
|
6276
6274
|
|
|
6277
|
-
`;
|
|
6278
|
-
exports.default = content;
|
|
6275
|
+
`;
|
|
File without changes
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const content = `# Code-Based Routing
|
|
1
|
+
module.exports = `# Code-Based Routing
|
|
4
2
|
|
|
5
3
|
> [!TIP]
|
|
6
4
|
> Code-based routing is not recommended for most applications. It is recommended to use [File-Based Routing](../file-based-routing.md) instead.
|
|
@@ -1933,5 +1931,4 @@ Or you can define the virtual routes directly in the configuration, while much l
|
|
|
1933
1931
|
}
|
|
1934
1932
|
\`\`\`
|
|
1935
1933
|
|
|
1936
|
-
`;
|
|
1937
|
-
exports.default = content;
|
|
1934
|
+
`;
|
|
File without changes
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const content = `# Overview
|
|
1
|
+
module.exports = `# Overview
|
|
4
2
|
|
|
5
3
|
**TanStack Router is a router for building React and Solid applications**. Some of its features include:
|
|
6
4
|
|
|
@@ -928,5 +926,4 @@ function PathlessLayoutRouteComponent() {
|
|
|
928
926
|
|
|
929
927
|
</details>
|
|
930
928
|
|
|
931
|
-
`;
|
|
932
|
-
exports.default = content;
|
|
929
|
+
`;
|
|
File without changes
|
package/dist/llms/esm/index.d.ts
CHANGED
package/dist/llms/esm/index.js
CHANGED
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import api from './rules/api.js'
|
|
2
|
-
import guide from './rules/guide.js'
|
|
3
|
-
import routing from './rules/routing.js'
|
|
4
|
-
import setupAndArchitecture from './rules/setup-and-architecture.js'
|
|
1
|
+
import api from './rules/api.js'
|
|
2
|
+
import guide from './rules/guide.js'
|
|
3
|
+
import routing from './rules/routing.js'
|
|
4
|
+
import setupAndArchitecture from './rules/setup-and-architecture.js'
|
|
5
|
+
|
|
5
6
|
const rules = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
]
|
|
35
|
-
|
|
7
|
+
{
|
|
8
|
+
name: 'api',
|
|
9
|
+
description: 'TanStack Router: API',
|
|
10
|
+
rule: api,
|
|
11
|
+
alwaysApply: false,
|
|
12
|
+
globs: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'guide',
|
|
16
|
+
description: 'TanStack Router: Guide',
|
|
17
|
+
rule: guide,
|
|
18
|
+
alwaysApply: false,
|
|
19
|
+
globs: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'routing',
|
|
23
|
+
description: 'TanStack Router: Routing',
|
|
24
|
+
rule: routing,
|
|
25
|
+
alwaysApply: false,
|
|
26
|
+
globs: ['src/**/*.ts', 'src/**/*.tsx'],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'setup-and-architecture',
|
|
30
|
+
description: 'TanStack Router: Setup and Architecture',
|
|
31
|
+
rule: setupAndArchitecture,
|
|
32
|
+
alwaysApply: false,
|
|
33
|
+
globs: ['package.json', 'vite.config.ts', 'tsconfig.json', 'src/**/*.ts', 'src/**/*.tsx'],
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
export default rules
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export default `# ActiveLinkOptions type
|
|
2
2
|
|
|
3
3
|
The \`ActiveLinkOptions\` type extends the [\`LinkOptions\`](../LinkOptionsType.md) type and contains additional options that can be used to describe how a link should be styled when it is active.
|
|
4
4
|
|
|
@@ -4238,5 +4238,4 @@ function Component() {
|
|
|
4238
4238
|
}
|
|
4239
4239
|
\`\`\`
|
|
4240
4240
|
|
|
4241
|
-
`;
|
|
4242
|
-
export default content;
|
|
4241
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export default `# Authenticated Routes
|
|
2
2
|
|
|
3
3
|
Authentication is an extremely common requirement for web applications. In this guide, we'll walk through how to use TanStack Router to build protected routes, and how to redirect users to login if they try to access them.
|
|
4
4
|
|
|
@@ -6272,5 +6272,4 @@ const { enable, disable, navigate } = useConditionalNavigate({
|
|
|
6272
6272
|
})
|
|
6273
6273
|
\`\`\`
|
|
6274
6274
|
|
|
6275
|
-
`;
|
|
6276
|
-
export default content;
|
|
6275
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export default `# Code-Based Routing
|
|
2
2
|
|
|
3
3
|
> [!TIP]
|
|
4
4
|
> Code-based routing is not recommended for most applications. It is recommended to use [File-Based Routing](../file-based-routing.md) instead.
|
|
@@ -1931,5 +1931,4 @@ Or you can define the virtual routes directly in the configuration, while much l
|
|
|
1931
1931
|
}
|
|
1932
1932
|
\`\`\`
|
|
1933
1933
|
|
|
1934
|
-
`;
|
|
1935
|
-
export default content;
|
|
1934
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export default `# Overview
|
|
2
2
|
|
|
3
3
|
**TanStack Router is a router for building React and Solid applications**. Some of its features include:
|
|
4
4
|
|
|
@@ -926,5 +926,4 @@ function PathlessLayoutRouteComponent() {
|
|
|
926
926
|
|
|
927
927
|
</details>
|
|
928
928
|
|
|
929
|
-
`;
|
|
930
|
-
export default content;
|
|
929
|
+
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-router",
|
|
3
|
-
"version": "1.120.
|
|
3
|
+
"version": "1.120.18",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"jsesc": "^3.1.0",
|
|
64
64
|
"tiny-invariant": "^1.3.3",
|
|
65
65
|
"tiny-warning": "^1.0.3",
|
|
66
|
-
"@tanstack/history": "1.
|
|
67
|
-
"@tanstack/router-core": "1.120.
|
|
66
|
+
"@tanstack/history": "1.120.17",
|
|
67
|
+
"@tanstack/router-core": "1.120.17"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@testing-library/jest-dom": "^6.6.3",
|