@tanstack/router-plugin 1.168.5 → 1.168.7

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 (44) hide show
  1. package/dist/cjs/core/code-splitter/compilers.cjs +32 -233
  2. package/dist/cjs/core/code-splitter/compilers.cjs.map +1 -1
  3. package/dist/cjs/core/code-splitter/compilers.d.cts +2 -57
  4. package/dist/cjs/core/code-splitter/plugins.d.cts +1 -0
  5. package/dist/cjs/core/config.cjs +1 -1
  6. package/dist/cjs/core/config.cjs.map +1 -1
  7. package/dist/cjs/core/config.d.cts +44 -163
  8. package/dist/cjs/core/hmr/handle-route-update.cjs +17 -18
  9. package/dist/cjs/core/hmr/handle-route-update.cjs.map +1 -1
  10. package/dist/cjs/core/router-code-splitter-plugin.cjs +5 -6
  11. package/dist/cjs/core/router-code-splitter-plugin.cjs.map +1 -1
  12. package/dist/cjs/esbuild.d.cts +26 -26
  13. package/dist/cjs/index.cjs +2 -0
  14. package/dist/cjs/index.d.cts +2 -0
  15. package/dist/cjs/vite.d.cts +26 -26
  16. package/dist/esm/core/code-splitter/compilers.d.ts +2 -57
  17. package/dist/esm/core/code-splitter/compilers.js +15 -216
  18. package/dist/esm/core/code-splitter/compilers.js.map +1 -1
  19. package/dist/esm/core/code-splitter/plugins.d.ts +1 -0
  20. package/dist/esm/core/config.d.ts +44 -163
  21. package/dist/esm/core/config.js +1 -1
  22. package/dist/esm/core/config.js.map +1 -1
  23. package/dist/esm/core/hmr/handle-route-update.js +17 -18
  24. package/dist/esm/core/hmr/handle-route-update.js.map +1 -1
  25. package/dist/esm/core/router-code-splitter-plugin.js +5 -6
  26. package/dist/esm/core/router-code-splitter-plugin.js.map +1 -1
  27. package/dist/esm/esbuild.d.ts +26 -26
  28. package/dist/esm/index.d.ts +2 -0
  29. package/dist/esm/index.js +2 -1
  30. package/dist/esm/vite.d.ts +26 -26
  31. package/package.json +7 -7
  32. package/src/core/code-splitter/compilers.ts +51 -411
  33. package/src/core/code-splitter/plugins.ts +3 -0
  34. package/src/core/config.ts +12 -1
  35. package/src/core/hmr/handle-route-update.ts +30 -35
  36. package/src/core/router-code-splitter-plugin.ts +11 -9
  37. package/src/index.ts +5 -0
  38. package/dist/cjs/core/code-splitter/path-ids.cjs +0 -32
  39. package/dist/cjs/core/code-splitter/path-ids.cjs.map +0 -1
  40. package/dist/cjs/core/code-splitter/path-ids.d.cts +0 -2
  41. package/dist/esm/core/code-splitter/path-ids.d.ts +0 -2
  42. package/dist/esm/core/code-splitter/path-ids.js +0 -31
  43. package/dist/esm/core/code-splitter/path-ids.js.map +0 -1
  44. package/src/core/code-splitter/path-ids.ts +0 -39
@@ -31,7 +31,7 @@ declare const TanStackRouterCodeSplitterEsbuild: (options?: RouterPluginOptions,
31
31
  * ```
32
32
  */
33
33
  declare const TanStackRouterEsbuild: (options?: Partial<{
34
- target: "react" | "solid" | "vue";
34
+ target: "vue" | "react" | "solid";
35
35
  routeFileIgnorePrefix: string;
36
36
  routesDirectory: string;
37
37
  quoteStyle: "single" | "double";
@@ -52,21 +52,11 @@ declare const TanStackRouterEsbuild: (options?: Partial<{
52
52
  enableRouteTreeFormatting: boolean;
53
53
  tmpDir: string;
54
54
  importRoutesUsingAbsolutePaths: boolean;
55
- enableRouteGeneration?: boolean | undefined;
56
- codeSplittingOptions?: CodeSplittingOptions | undefined;
57
- plugin?: {
58
- vite?: {
59
- environmentName?: string | undefined;
60
- } | undefined;
61
- hmr?: {
62
- style?: "vite" | "webpack" | undefined;
63
- } | undefined;
64
- } | undefined;
65
55
  virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
66
56
  routeFilePrefix?: string | undefined;
67
57
  routeFileIgnorePattern?: string | undefined;
68
- pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
69
- routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
58
+ pathParamsAllowedCharacters?: (":" | "$" | ";" | "@" | "&" | "=" | "+" | ",")[] | undefined;
59
+ routeTreeFileFooter?: string[] | (() => Array<string>) | undefined;
70
60
  autoCodeSplitting?: boolean | undefined;
71
61
  customScaffolding?: {
72
62
  routeTemplate?: string | undefined;
@@ -76,9 +66,19 @@ declare const TanStackRouterEsbuild: (options?: Partial<{
76
66
  enableCodeSplitting?: boolean | undefined;
77
67
  } | undefined;
78
68
  plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
69
+ enableRouteGeneration?: boolean | undefined;
70
+ codeSplittingOptions?: CodeSplittingOptions | undefined;
71
+ plugin?: {
72
+ hmr?: {
73
+ style?: "vite" | "webpack" | undefined;
74
+ } | undefined;
75
+ vite?: {
76
+ environmentName?: string | undefined;
77
+ } | undefined;
78
+ } | undefined;
79
79
  } | (() => Config)> | undefined) => import('unplugin').EsbuildPlugin;
80
80
  declare const tanstackRouter: (options?: Partial<{
81
- target: "react" | "solid" | "vue";
81
+ target: "vue" | "react" | "solid";
82
82
  routeFileIgnorePrefix: string;
83
83
  routesDirectory: string;
84
84
  quoteStyle: "single" | "double";
@@ -99,21 +99,11 @@ declare const tanstackRouter: (options?: Partial<{
99
99
  enableRouteTreeFormatting: boolean;
100
100
  tmpDir: string;
101
101
  importRoutesUsingAbsolutePaths: boolean;
102
- enableRouteGeneration?: boolean | undefined;
103
- codeSplittingOptions?: CodeSplittingOptions | undefined;
104
- plugin?: {
105
- vite?: {
106
- environmentName?: string | undefined;
107
- } | undefined;
108
- hmr?: {
109
- style?: "vite" | "webpack" | undefined;
110
- } | undefined;
111
- } | undefined;
112
102
  virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
113
103
  routeFilePrefix?: string | undefined;
114
104
  routeFileIgnorePattern?: string | undefined;
115
- pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
116
- routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
105
+ pathParamsAllowedCharacters?: (":" | "$" | ";" | "@" | "&" | "=" | "+" | ",")[] | undefined;
106
+ routeTreeFileFooter?: string[] | (() => Array<string>) | undefined;
117
107
  autoCodeSplitting?: boolean | undefined;
118
108
  customScaffolding?: {
119
109
  routeTemplate?: string | undefined;
@@ -123,6 +113,16 @@ declare const tanstackRouter: (options?: Partial<{
123
113
  enableCodeSplitting?: boolean | undefined;
124
114
  } | undefined;
125
115
  plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
116
+ enableRouteGeneration?: boolean | undefined;
117
+ codeSplittingOptions?: CodeSplittingOptions | undefined;
118
+ plugin?: {
119
+ hmr?: {
120
+ style?: "vite" | "webpack" | undefined;
121
+ } | undefined;
122
+ vite?: {
123
+ environmentName?: string | undefined;
124
+ } | undefined;
125
+ } | undefined;
126
126
  } | (() => Config)> | undefined) => import('unplugin').EsbuildPlugin;
127
127
  export default TanStackRouterEsbuild;
128
128
  export { configSchema, TanStackRouterGeneratorEsbuild, TanStackRouterCodeSplitterEsbuild, TanStackRouterEsbuild, tanstackRouter, };
@@ -4,4 +4,6 @@ export { unpluginRouterGeneratorFactory } from './core/router-generator-plugin.j
4
4
  export { createRouterPluginContext } from './core/router-plugin-context.js';
5
5
  export type { Config, ConfigInput, ConfigOutput, CodeSplittingOptions, DeletableNodes, HmrOptions, } from './core/config.js';
6
6
  export type { RouterPluginContext } from './core/router-plugin-context.js';
7
+ export { getObjectPropertyKeyName } from './core/utils.js';
8
+ export type { ReferenceRouteCompilerPlugin, ReferenceRouteCompilerPluginContext, } from './core/code-splitter/plugins.js';
7
9
  export { tsrSplit, splitRouteIdentNodes, defaultCodeSplitGroupings, } from './core/constants.js';
package/dist/esm/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { configSchema, getConfig } from "./core/config.js";
2
2
  import { defaultCodeSplitGroupings, splitRouteIdentNodes, tsrSplit } from "./core/constants.js";
3
+ import { getObjectPropertyKeyName } from "./core/utils.js";
3
4
  import { createRouterPluginContext } from "./core/router-plugin-context.js";
4
5
  import { unpluginRouterCodeSplitterFactory } from "./core/router-code-splitter-plugin.js";
5
6
  import { unpluginRouterGeneratorFactory } from "./core/router-generator-plugin.js";
6
- export { configSchema, createRouterPluginContext, defaultCodeSplitGroupings, getConfig, splitRouteIdentNodes, tsrSplit, unpluginRouterCodeSplitterFactory, unpluginRouterGeneratorFactory };
7
+ export { configSchema, createRouterPluginContext, defaultCodeSplitGroupings, getConfig, getObjectPropertyKeyName, splitRouteIdentNodes, tsrSplit, unpluginRouterCodeSplitterFactory, unpluginRouterGeneratorFactory };
@@ -31,7 +31,7 @@ declare const tanStackRouterCodeSplitter: (options?: RouterPluginOptions, router
31
31
  * ```
32
32
  */
33
33
  declare const tanstackRouter: (options?: Partial<{
34
- target: "react" | "solid" | "vue";
34
+ target: "vue" | "react" | "solid";
35
35
  routeFileIgnorePrefix: string;
36
36
  routesDirectory: string;
37
37
  quoteStyle: "single" | "double";
@@ -52,21 +52,11 @@ declare const tanstackRouter: (options?: Partial<{
52
52
  enableRouteTreeFormatting: boolean;
53
53
  tmpDir: string;
54
54
  importRoutesUsingAbsolutePaths: boolean;
55
- enableRouteGeneration?: boolean | undefined;
56
- codeSplittingOptions?: CodeSplittingOptions | undefined;
57
- plugin?: {
58
- vite?: {
59
- environmentName?: string | undefined;
60
- } | undefined;
61
- hmr?: {
62
- style?: "vite" | "webpack" | undefined;
63
- } | undefined;
64
- } | undefined;
65
55
  virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
66
56
  routeFilePrefix?: string | undefined;
67
57
  routeFileIgnorePattern?: string | undefined;
68
- pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
69
- routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
58
+ pathParamsAllowedCharacters?: (":" | "$" | ";" | "@" | "&" | "=" | "+" | ",")[] | undefined;
59
+ routeTreeFileFooter?: string[] | (() => Array<string>) | undefined;
70
60
  autoCodeSplitting?: boolean | undefined;
71
61
  customScaffolding?: {
72
62
  routeTemplate?: string | undefined;
@@ -76,12 +66,22 @@ declare const tanstackRouter: (options?: Partial<{
76
66
  enableCodeSplitting?: boolean | undefined;
77
67
  } | undefined;
78
68
  plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
69
+ enableRouteGeneration?: boolean | undefined;
70
+ codeSplittingOptions?: CodeSplittingOptions | undefined;
71
+ plugin?: {
72
+ hmr?: {
73
+ style?: "vite" | "webpack" | undefined;
74
+ } | undefined;
75
+ vite?: {
76
+ environmentName?: string | undefined;
77
+ } | undefined;
78
+ } | undefined;
79
79
  } | (() => Config)> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
80
80
  /**
81
81
  * @deprecated Use `tanstackRouter` instead.
82
82
  */
83
83
  declare const TanStackRouterVite: (options?: Partial<{
84
- target: "react" | "solid" | "vue";
84
+ target: "vue" | "react" | "solid";
85
85
  routeFileIgnorePrefix: string;
86
86
  routesDirectory: string;
87
87
  quoteStyle: "single" | "double";
@@ -102,21 +102,11 @@ declare const TanStackRouterVite: (options?: Partial<{
102
102
  enableRouteTreeFormatting: boolean;
103
103
  tmpDir: string;
104
104
  importRoutesUsingAbsolutePaths: boolean;
105
- enableRouteGeneration?: boolean | undefined;
106
- codeSplittingOptions?: CodeSplittingOptions | undefined;
107
- plugin?: {
108
- vite?: {
109
- environmentName?: string | undefined;
110
- } | undefined;
111
- hmr?: {
112
- style?: "vite" | "webpack" | undefined;
113
- } | undefined;
114
- } | undefined;
115
105
  virtualRouteConfig?: string | import('@tanstack/virtual-file-routes').VirtualRootRoute | undefined;
116
106
  routeFilePrefix?: string | undefined;
117
107
  routeFileIgnorePattern?: string | undefined;
118
- pathParamsAllowedCharacters?: (";" | ":" | "@" | "&" | "=" | "+" | "$" | ",")[] | undefined;
119
- routeTreeFileFooter?: string[] | ((...args: unknown[]) => string[]) | undefined;
108
+ pathParamsAllowedCharacters?: (":" | "$" | ";" | "@" | "&" | "=" | "+" | ",")[] | undefined;
109
+ routeTreeFileFooter?: string[] | (() => Array<string>) | undefined;
120
110
  autoCodeSplitting?: boolean | undefined;
121
111
  customScaffolding?: {
122
112
  routeTemplate?: string | undefined;
@@ -126,6 +116,16 @@ declare const TanStackRouterVite: (options?: Partial<{
126
116
  enableCodeSplitting?: boolean | undefined;
127
117
  } | undefined;
128
118
  plugins?: import('@tanstack/router-generator').GeneratorPlugin[] | undefined;
119
+ enableRouteGeneration?: boolean | undefined;
120
+ codeSplittingOptions?: CodeSplittingOptions | undefined;
121
+ plugin?: {
122
+ hmr?: {
123
+ style?: "vite" | "webpack" | undefined;
124
+ } | undefined;
125
+ vite?: {
126
+ environmentName?: string | undefined;
127
+ } | undefined;
128
+ } | undefined;
129
129
  } | (() => Config)> | undefined) => import('vite').Plugin<any> | import('vite').Plugin<any>[];
130
130
  export default tanstackRouter;
131
131
  export { configSchema, getConfig, tanStackRouterCodeSplitter, tanstackRouterGenerator, TanStackRouterVite, tanstackRouter, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/router-plugin",
3
- "version": "1.168.5",
3
+ "version": "1.168.7",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -106,12 +106,12 @@
106
106
  "@babel/template": "^7.27.2",
107
107
  "@babel/traverse": "^7.28.5",
108
108
  "@babel/types": "^7.28.5",
109
- "chokidar": "^3.6.0",
109
+ "chokidar": "^5.0.0",
110
110
  "unplugin": "^3.0.0",
111
- "zod": "^3.24.2",
112
- "@tanstack/router-core": "1.171.1",
113
- "@tanstack/router-generator": "1.167.4",
114
- "@tanstack/router-utils": "1.162.0",
111
+ "zod": "^4.4.3",
112
+ "@tanstack/router-core": "1.171.3",
113
+ "@tanstack/router-generator": "1.167.6",
114
+ "@tanstack/router-utils": "1.162.1",
115
115
  "@tanstack/virtual-file-routes": "1.162.0"
116
116
  },
117
117
  "devDependencies": {
@@ -125,7 +125,7 @@
125
125
  "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0",
126
126
  "vite-plugin-solid": "^2.11.10 || ^3.0.0-0",
127
127
  "webpack": ">=5.92.0",
128
- "@tanstack/react-router": "^1.170.3"
128
+ "@tanstack/react-router": "^1.170.5"
129
129
  },
130
130
  "peerDependenciesMeta": {
131
131
  "@rsbuild/core": {