vite-react-ssg 0.8.1 → 0.8.2
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 +23 -0
- package/dist/client/single-page.d.cts +2 -2
- package/dist/client/single-page.d.mts +2 -2
- package/dist/client/single-page.d.ts +2 -2
- package/dist/index.cjs +6 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +6 -2
- package/dist/node/cli.cjs +1 -1
- package/dist/node/cli.mjs +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.mjs +1 -1
- package/dist/shared/{vite-react-ssg.U7W0lHXm.cjs → vite-react-ssg.BEenhaUp.cjs} +7 -5
- package/dist/shared/{vite-react-ssg.BdRX-qCI.mjs → vite-react-ssg.CCvTYWeJ.mjs} +6 -4
- package/dist/shared/{vite-react-ssg.MPbH7GTN.d.cts → vite-react-ssg.WtHsP9dD.d.cts} +10 -3
- package/dist/shared/{vite-react-ssg.MPbH7GTN.d.mts → vite-react-ssg.WtHsP9dD.d.mts} +10 -3
- package/dist/shared/{vite-react-ssg.MPbH7GTN.d.ts → vite-react-ssg.WtHsP9dD.d.ts} +10 -3
- package/dist/tanstack.d.cts +2 -2
- package/dist/tanstack.d.mts +2 -2
- package/dist/tanstack.d.ts +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -374,6 +374,29 @@ See: [react-router's create-browser-router](https://reactrouter.com/en/main/rout
|
|
|
374
374
|
|
|
375
375
|
[Example](./examples/lazy-pages/vite.config.ts)
|
|
376
376
|
|
|
377
|
+
## Future config
|
|
378
|
+
|
|
379
|
+
```tsx
|
|
380
|
+
export const createRoot = ViteReactSSG(
|
|
381
|
+
{
|
|
382
|
+
routes,
|
|
383
|
+
basename: import.meta.env.BASE_URL,
|
|
384
|
+
future: {
|
|
385
|
+
v7_normalizeFormMethod: true,
|
|
386
|
+
v7_startTransition: true,
|
|
387
|
+
v7_fetcherPersist: true,
|
|
388
|
+
v7_relativeSplatPath: true,
|
|
389
|
+
v7_skipActionErrorRevalidation: true,
|
|
390
|
+
v7_partialHydration: true,
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
)
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
See: [react-router's optsfuture](https://reactrouter.com/6.28.0/routers/create-browser-router#optsfuture)
|
|
397
|
+
|
|
398
|
+
[Example](./examples/lazy-pages/src/main.tsx)
|
|
399
|
+
|
|
377
400
|
## CSS in JS
|
|
378
401
|
|
|
379
402
|
Use the `getStyleCollector` option to specify an SSR/SSG style collector. Currently only supports `styled-components`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from '../shared/vite-react-ssg.
|
|
3
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterOptions, S as StyleCollector, b as ViteReactSSGOptions } from '../shared/vite-react-ssg.
|
|
2
|
+
import { V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from '../shared/vite-react-ssg.WtHsP9dD.cjs';
|
|
3
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, d as RouterOptions, S as StyleCollector, b as ViteReactSSGOptions } from '../shared/vite-react-ssg.WtHsP9dD.cjs';
|
|
4
4
|
export { C as ClientOnly, H as Head } from '../shared/vite-react-ssg.Cm9gBlfg.cjs';
|
|
5
5
|
import 'react-router-dom';
|
|
6
6
|
import 'beasties';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from '../shared/vite-react-ssg.
|
|
3
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterOptions, S as StyleCollector, b as ViteReactSSGOptions } from '../shared/vite-react-ssg.
|
|
2
|
+
import { V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from '../shared/vite-react-ssg.WtHsP9dD.mjs';
|
|
3
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, d as RouterOptions, S as StyleCollector, b as ViteReactSSGOptions } from '../shared/vite-react-ssg.WtHsP9dD.mjs';
|
|
4
4
|
export { C as ClientOnly, H as Head } from '../shared/vite-react-ssg.Cm9gBlfg.mjs';
|
|
5
5
|
import 'react-router-dom';
|
|
6
6
|
import 'beasties';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from '../shared/vite-react-ssg.
|
|
3
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterOptions, S as StyleCollector, b as ViteReactSSGOptions } from '../shared/vite-react-ssg.
|
|
2
|
+
import { V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from '../shared/vite-react-ssg.WtHsP9dD.js';
|
|
3
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, d as RouterOptions, S as StyleCollector, b as ViteReactSSGOptions } from '../shared/vite-react-ssg.WtHsP9dD.js';
|
|
4
4
|
export { C as ClientOnly, H as Head } from '../shared/vite-react-ssg.Cm9gBlfg.js';
|
|
5
5
|
import 'react-router-dom';
|
|
6
6
|
import 'beasties';
|
package/dist/index.cjs
CHANGED
|
@@ -88,8 +88,12 @@ function ViteReactSSG(routerOptions, fn, options = {}) {
|
|
|
88
88
|
console.warn("[vite-react-ssg] `ssrWhenDev` option is no longer needed. If you want to use csr, just replace `vite-react-ssg dev` with `vite`.");
|
|
89
89
|
const isClient = typeof window !== "undefined";
|
|
90
90
|
const BASE_URL = routerOptions.basename ?? "/";
|
|
91
|
+
const { v7_startTransition, ...routerFeature } = routerOptions.future ?? {};
|
|
91
92
|
async function createRoot(client = false, routePath) {
|
|
92
|
-
const browserRouter = client ? reactRouterDom.createBrowserRouter(
|
|
93
|
+
const browserRouter = client ? reactRouterDom.createBrowserRouter(
|
|
94
|
+
remixRouter.convertRoutesToDataRoutes(routerOptions.routes, transformStaticLoaderRoute),
|
|
95
|
+
{ basename: BASE_URL, future: routerFeature }
|
|
96
|
+
) : void 0;
|
|
93
97
|
const appRenderCallbacks = [];
|
|
94
98
|
const onSSRAppRendered = client ? () => {
|
|
95
99
|
} : (cb) => appRenderCallbacks.push(cb);
|
|
@@ -141,7 +145,7 @@ function ViteReactSSG(routerOptions, fn, options = {}) {
|
|
|
141
145
|
);
|
|
142
146
|
}
|
|
143
147
|
const { router } = await createRoot(true);
|
|
144
|
-
const app = /* @__PURE__ */ jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.RouterProvider, { router }) });
|
|
148
|
+
const app = /* @__PURE__ */ jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.RouterProvider, { router, future: { v7_startTransition } }) });
|
|
145
149
|
const isSSR = document.querySelector("[data-server-rendered=true]") !== null;
|
|
146
150
|
if (!isSSR && process.env.NODE_ENV === "development") {
|
|
147
151
|
const root = client.createRoot(container);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.
|
|
1
|
+
import { d as RouterOptions, V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.WtHsP9dD.cjs';
|
|
2
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.WtHsP9dD.cjs';
|
|
3
3
|
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.Cm9gBlfg.cjs';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { LinkProps, NavLinkProps } from 'react-router-dom';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.
|
|
1
|
+
import { d as RouterOptions, V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.WtHsP9dD.mjs';
|
|
2
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.WtHsP9dD.mjs';
|
|
3
3
|
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.Cm9gBlfg.mjs';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { LinkProps, NavLinkProps } from 'react-router-dom';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.
|
|
1
|
+
import { d as RouterOptions, V as ViteReactSSGContext, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.WtHsP9dD.js';
|
|
2
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.WtHsP9dD.js';
|
|
3
3
|
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.Cm9gBlfg.js';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { LinkProps, NavLinkProps } from 'react-router-dom';
|
package/dist/index.mjs
CHANGED
|
@@ -83,8 +83,12 @@ function ViteReactSSG(routerOptions, fn, options = {}) {
|
|
|
83
83
|
console.warn("[vite-react-ssg] `ssrWhenDev` option is no longer needed. If you want to use csr, just replace `vite-react-ssg dev` with `vite`.");
|
|
84
84
|
const isClient = typeof window !== "undefined";
|
|
85
85
|
const BASE_URL = routerOptions.basename ?? "/";
|
|
86
|
+
const { v7_startTransition, ...routerFeature } = routerOptions.future ?? {};
|
|
86
87
|
async function createRoot$1(client = false, routePath) {
|
|
87
|
-
const browserRouter = client ? createBrowserRouter(
|
|
88
|
+
const browserRouter = client ? createBrowserRouter(
|
|
89
|
+
convertRoutesToDataRoutes(routerOptions.routes, transformStaticLoaderRoute),
|
|
90
|
+
{ basename: BASE_URL, future: routerFeature }
|
|
91
|
+
) : void 0;
|
|
88
92
|
const appRenderCallbacks = [];
|
|
89
93
|
const onSSRAppRendered = client ? () => {
|
|
90
94
|
} : (cb) => appRenderCallbacks.push(cb);
|
|
@@ -136,7 +140,7 @@ function ViteReactSSG(routerOptions, fn, options = {}) {
|
|
|
136
140
|
);
|
|
137
141
|
}
|
|
138
142
|
const { router } = await createRoot$1(true);
|
|
139
|
-
const app = /* @__PURE__ */ jsx(HelmetProvider, { children: /* @__PURE__ */ jsx(RouterProvider, { router }) });
|
|
143
|
+
const app = /* @__PURE__ */ jsx(HelmetProvider, { children: /* @__PURE__ */ jsx(RouterProvider, { router, future: { v7_startTransition } }) });
|
|
140
144
|
const isSSR = document.querySelector("[data-server-rendered=true]") !== null;
|
|
141
145
|
if (!isSSR && process.env.NODE_ENV === "development") {
|
|
142
146
|
const root = createRoot(container);
|
package/dist/node/cli.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const kolorist = require('kolorist');
|
|
4
4
|
const yargs = require('yargs');
|
|
5
5
|
const helpers = require('yargs/helpers');
|
|
6
|
-
const dev = require('../shared/vite-react-ssg.
|
|
6
|
+
const dev = require('../shared/vite-react-ssg.BEenhaUp.cjs');
|
|
7
7
|
const webFetch = require('@remix-run/web-fetch');
|
|
8
8
|
require('node:path');
|
|
9
9
|
require('node:module');
|
package/dist/node/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { gray, bold, red, reset, underline } from 'kolorist';
|
|
2
2
|
import yargs from 'yargs';
|
|
3
3
|
import { hideBin } from 'yargs/helpers';
|
|
4
|
-
import { b as build, d as dev } from '../shared/vite-react-ssg.
|
|
4
|
+
import { b as build, d as dev } from '../shared/vite-react-ssg.CCvTYWeJ.mjs';
|
|
5
5
|
import { Headers, Request, Response, fetch, FormData } from '@remix-run/web-fetch';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:module';
|
package/dist/node.cjs
CHANGED
package/dist/node.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InlineConfig } from 'vite';
|
|
2
|
-
import { b as ViteReactSSGOptions } from './shared/vite-react-ssg.
|
|
2
|
+
import { b as ViteReactSSGOptions } from './shared/vite-react-ssg.WtHsP9dD.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react-router-dom';
|
|
5
5
|
import 'beasties';
|
package/dist/node.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InlineConfig } from 'vite';
|
|
2
|
-
import { b as ViteReactSSGOptions } from './shared/vite-react-ssg.
|
|
2
|
+
import { b as ViteReactSSGOptions } from './shared/vite-react-ssg.WtHsP9dD.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react-router-dom';
|
|
5
5
|
import 'beasties';
|
package/dist/node.d.ts
CHANGED
package/dist/node.mjs
CHANGED
|
@@ -23,7 +23,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
23
23
|
const PQueue__default = /*#__PURE__*/_interopDefaultCompat(PQueue);
|
|
24
24
|
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
25
25
|
|
|
26
|
-
const version = "0.8.
|
|
26
|
+
const version = "0.8.2";
|
|
27
27
|
|
|
28
28
|
function buildLog(text, count) {
|
|
29
29
|
console.log(`
|
|
@@ -458,7 +458,7 @@ class RemixAdapter {
|
|
|
458
458
|
this.context = context;
|
|
459
459
|
}
|
|
460
460
|
async render(path$1) {
|
|
461
|
-
const { base, routes, getStyleCollector } = this.context;
|
|
461
|
+
const { base, routes, getStyleCollector, routerOptions } = this.context;
|
|
462
462
|
const fetchUrl = `${path.withTrailingSlash(base)}${path.removeLeadingSlash(path$1)}`;
|
|
463
463
|
const request = createRequest(fetchUrl);
|
|
464
464
|
const styleCollector = getStyleCollector ? await getStyleCollector() : null;
|
|
@@ -470,7 +470,7 @@ class RemixAdapter {
|
|
|
470
470
|
if (_context instanceof Response)
|
|
471
471
|
throw _context;
|
|
472
472
|
routerContext = _context;
|
|
473
|
-
const router = createStaticRouter(dataRoutes, routerContext);
|
|
473
|
+
const router = createStaticRouter(dataRoutes, routerContext, { future: routerOptions.future });
|
|
474
474
|
let app = /* @__PURE__ */ jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { context: helmetContext, children: /* @__PURE__ */ jsxRuntime.jsx(StaticRouterProvider, { router, context: routerContext }) });
|
|
475
475
|
if (styleCollector)
|
|
476
476
|
app = styleCollector.collect(app);
|
|
@@ -793,7 +793,7 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
793
793
|
const ext = format === "esm" ? ".mjs" : ".cjs";
|
|
794
794
|
const serverEntry = node_path.join(prefix, ssgOut, node_path.parse(ssrEntry).name + ext);
|
|
795
795
|
const serverManifest = JSON.parse(await fs__default.readFile(node_path.join(ssgOut, ...dotVitedir, "manifest.json"), "utf-8"));
|
|
796
|
-
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/vite-react-ssg.
|
|
796
|
+
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/vite-react-ssg.BEenhaUp.cjs', document.baseURI).href)));
|
|
797
797
|
const { createRoot, includedRoutes: serverEntryIncludedRoutes } = format === "esm" ? await import(serverEntry) : _require(serverEntry);
|
|
798
798
|
const includedRoutes = serverEntryIncludedRoutes || configIncludedRoutes;
|
|
799
799
|
const { routes } = await createRoot(false);
|
|
@@ -930,9 +930,11 @@ function ssrServerPlugin({
|
|
|
930
930
|
[ssrEntry, entry].map(async (entry2) => await server.moduleGraph.getModuleByUrl(entry2))
|
|
931
931
|
);
|
|
932
932
|
const assetsUrls = /* @__PURE__ */ new Set();
|
|
933
|
+
const collectedMods = /* @__PURE__ */ new Set();
|
|
933
934
|
const collectAssets = async (mod) => {
|
|
934
|
-
if (!mod || !mod?.ssrTransformResult)
|
|
935
|
+
if (!mod || !mod?.ssrTransformResult || collectedMods.has(mod))
|
|
935
936
|
return;
|
|
937
|
+
collectedMods.add(mod);
|
|
936
938
|
const { deps = [], dynamicDeps = [] } = mod?.ssrTransformResult;
|
|
937
939
|
const allDeps = [...deps, ...dynamicDeps];
|
|
938
940
|
for (const dep of allDeps) {
|
|
@@ -15,7 +15,7 @@ import { once } from 'node:events';
|
|
|
15
15
|
import { c as convertRoutesToDataRoutes } from './vite-react-ssg.C0y5wbxl.mjs';
|
|
16
16
|
import { M as META_CONTAINER_ID } from './vite-react-ssg.B-j07kW6.mjs';
|
|
17
17
|
|
|
18
|
-
const version = "0.8.
|
|
18
|
+
const version = "0.8.2";
|
|
19
19
|
|
|
20
20
|
function buildLog(text, count) {
|
|
21
21
|
console.log(`
|
|
@@ -450,7 +450,7 @@ class RemixAdapter {
|
|
|
450
450
|
this.context = context;
|
|
451
451
|
}
|
|
452
452
|
async render(path) {
|
|
453
|
-
const { base, routes, getStyleCollector } = this.context;
|
|
453
|
+
const { base, routes, getStyleCollector, routerOptions } = this.context;
|
|
454
454
|
const fetchUrl = `${withTrailingSlash(base)}${removeLeadingSlash(path)}`;
|
|
455
455
|
const request = createRequest(fetchUrl);
|
|
456
456
|
const styleCollector = getStyleCollector ? await getStyleCollector() : null;
|
|
@@ -462,7 +462,7 @@ class RemixAdapter {
|
|
|
462
462
|
if (_context instanceof Response)
|
|
463
463
|
throw _context;
|
|
464
464
|
routerContext = _context;
|
|
465
|
-
const router = createStaticRouter(dataRoutes, routerContext);
|
|
465
|
+
const router = createStaticRouter(dataRoutes, routerContext, { future: routerOptions.future });
|
|
466
466
|
let app = /* @__PURE__ */ jsx(HelmetProvider, { context: helmetContext, children: /* @__PURE__ */ jsx(StaticRouterProvider, { router, context: routerContext }) });
|
|
467
467
|
if (styleCollector)
|
|
468
468
|
app = styleCollector.collect(app);
|
|
@@ -922,9 +922,11 @@ function ssrServerPlugin({
|
|
|
922
922
|
[ssrEntry, entry].map(async (entry2) => await server.moduleGraph.getModuleByUrl(entry2))
|
|
923
923
|
);
|
|
924
924
|
const assetsUrls = /* @__PURE__ */ new Set();
|
|
925
|
+
const collectedMods = /* @__PURE__ */ new Set();
|
|
925
926
|
const collectAssets = async (mod) => {
|
|
926
|
-
if (!mod || !mod?.ssrTransformResult)
|
|
927
|
+
if (!mod || !mod?.ssrTransformResult || collectedMods.has(mod))
|
|
927
928
|
return;
|
|
929
|
+
collectedMods.add(mod);
|
|
928
930
|
const { deps = [], dynamicDeps = [] } = mod?.ssrTransformResult;
|
|
929
931
|
const allDeps = [...deps, ...dynamicDeps];
|
|
930
932
|
for (const dep of allDeps) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { NonIndexRouteObject, IndexRouteObject, createBrowserRouter } from 'react-router-dom';
|
|
2
|
+
import { NonIndexRouteObject, IndexRouteObject, FutureConfig, createBrowserRouter } from 'react-router-dom';
|
|
3
3
|
import { Options } from 'beasties';
|
|
4
4
|
|
|
5
5
|
type Router = ReturnType<typeof createBrowserRouter>;
|
|
@@ -187,10 +187,17 @@ type NonIndexRouteRecord = Omit<NonIndexRouteObject, 'children'> & {
|
|
|
187
187
|
} & CommonRouteOptions;
|
|
188
188
|
type IndexRouteRecord = IndexRouteObject & CommonRouteOptions;
|
|
189
189
|
type RouteRecord = NonIndexRouteRecord | IndexRouteRecord;
|
|
190
|
+
interface RouterFutureConfig {
|
|
191
|
+
v7_fetcherPersist?: boolean;
|
|
192
|
+
v7_normalizeFormMethod?: boolean;
|
|
193
|
+
v7_partialHydration?: boolean;
|
|
194
|
+
v7_relativeSplatPath?: boolean;
|
|
195
|
+
v7_skipActionErrorRevalidation?: boolean;
|
|
196
|
+
}
|
|
190
197
|
interface RouterOptions {
|
|
191
198
|
routes: RouteRecord[];
|
|
192
|
-
createFetchRequest?: <T>(req: T) => Request;
|
|
193
199
|
basename?: string;
|
|
200
|
+
future?: Partial<RouterFutureConfig & FutureConfig>;
|
|
194
201
|
}
|
|
195
202
|
interface StyleCollector {
|
|
196
203
|
collect: (app: ReactElement) => ReactElement;
|
|
@@ -203,4 +210,4 @@ declare module 'vite' {
|
|
|
203
210
|
}
|
|
204
211
|
}
|
|
205
212
|
|
|
206
|
-
export type { CrittersOptions as C, IndexRouteRecord as I, NonIndexRouteRecord as N, RouteRecord as R, StyleCollector as S, ViteReactSSGContext as V, ViteReactSSGClientOptions as a, ViteReactSSGOptions as b,
|
|
213
|
+
export type { CrittersOptions as C, IndexRouteRecord as I, NonIndexRouteRecord as N, RouteRecord as R, StyleCollector as S, ViteReactSSGContext as V, ViteReactSSGClientOptions as a, ViteReactSSGOptions as b, RouterFutureConfig as c, RouterOptions as d };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { NonIndexRouteObject, IndexRouteObject, createBrowserRouter } from 'react-router-dom';
|
|
2
|
+
import { NonIndexRouteObject, IndexRouteObject, FutureConfig, createBrowserRouter } from 'react-router-dom';
|
|
3
3
|
import { Options } from 'beasties';
|
|
4
4
|
|
|
5
5
|
type Router = ReturnType<typeof createBrowserRouter>;
|
|
@@ -187,10 +187,17 @@ type NonIndexRouteRecord = Omit<NonIndexRouteObject, 'children'> & {
|
|
|
187
187
|
} & CommonRouteOptions;
|
|
188
188
|
type IndexRouteRecord = IndexRouteObject & CommonRouteOptions;
|
|
189
189
|
type RouteRecord = NonIndexRouteRecord | IndexRouteRecord;
|
|
190
|
+
interface RouterFutureConfig {
|
|
191
|
+
v7_fetcherPersist?: boolean;
|
|
192
|
+
v7_normalizeFormMethod?: boolean;
|
|
193
|
+
v7_partialHydration?: boolean;
|
|
194
|
+
v7_relativeSplatPath?: boolean;
|
|
195
|
+
v7_skipActionErrorRevalidation?: boolean;
|
|
196
|
+
}
|
|
190
197
|
interface RouterOptions {
|
|
191
198
|
routes: RouteRecord[];
|
|
192
|
-
createFetchRequest?: <T>(req: T) => Request;
|
|
193
199
|
basename?: string;
|
|
200
|
+
future?: Partial<RouterFutureConfig & FutureConfig>;
|
|
194
201
|
}
|
|
195
202
|
interface StyleCollector {
|
|
196
203
|
collect: (app: ReactElement) => ReactElement;
|
|
@@ -203,4 +210,4 @@ declare module 'vite' {
|
|
|
203
210
|
}
|
|
204
211
|
}
|
|
205
212
|
|
|
206
|
-
export type { CrittersOptions as C, IndexRouteRecord as I, NonIndexRouteRecord as N, RouteRecord as R, StyleCollector as S, ViteReactSSGContext as V, ViteReactSSGClientOptions as a, ViteReactSSGOptions as b,
|
|
213
|
+
export type { CrittersOptions as C, IndexRouteRecord as I, NonIndexRouteRecord as N, RouteRecord as R, StyleCollector as S, ViteReactSSGContext as V, ViteReactSSGClientOptions as a, ViteReactSSGOptions as b, RouterFutureConfig as c, RouterOptions as d };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { NonIndexRouteObject, IndexRouteObject, createBrowserRouter } from 'react-router-dom';
|
|
2
|
+
import { NonIndexRouteObject, IndexRouteObject, FutureConfig, createBrowserRouter } from 'react-router-dom';
|
|
3
3
|
import { Options } from 'beasties';
|
|
4
4
|
|
|
5
5
|
type Router = ReturnType<typeof createBrowserRouter>;
|
|
@@ -187,10 +187,17 @@ type NonIndexRouteRecord = Omit<NonIndexRouteObject, 'children'> & {
|
|
|
187
187
|
} & CommonRouteOptions;
|
|
188
188
|
type IndexRouteRecord = IndexRouteObject & CommonRouteOptions;
|
|
189
189
|
type RouteRecord = NonIndexRouteRecord | IndexRouteRecord;
|
|
190
|
+
interface RouterFutureConfig {
|
|
191
|
+
v7_fetcherPersist?: boolean;
|
|
192
|
+
v7_normalizeFormMethod?: boolean;
|
|
193
|
+
v7_partialHydration?: boolean;
|
|
194
|
+
v7_relativeSplatPath?: boolean;
|
|
195
|
+
v7_skipActionErrorRevalidation?: boolean;
|
|
196
|
+
}
|
|
190
197
|
interface RouterOptions {
|
|
191
198
|
routes: RouteRecord[];
|
|
192
|
-
createFetchRequest?: <T>(req: T) => Request;
|
|
193
199
|
basename?: string;
|
|
200
|
+
future?: Partial<RouterFutureConfig & FutureConfig>;
|
|
194
201
|
}
|
|
195
202
|
interface StyleCollector {
|
|
196
203
|
collect: (app: ReactElement) => ReactElement;
|
|
@@ -203,4 +210,4 @@ declare module 'vite' {
|
|
|
203
210
|
}
|
|
204
211
|
}
|
|
205
212
|
|
|
206
|
-
export type { CrittersOptions as C, IndexRouteRecord as I, NonIndexRouteRecord as N, RouteRecord as R, StyleCollector as S, ViteReactSSGContext as V, ViteReactSSGClientOptions as a, ViteReactSSGOptions as b,
|
|
213
|
+
export type { CrittersOptions as C, IndexRouteRecord as I, NonIndexRouteRecord as N, RouteRecord as R, StyleCollector as S, ViteReactSSGContext as V, ViteReactSSGClientOptions as a, ViteReactSSGOptions as b, RouterFutureConfig as c, RouterOptions as d };
|
package/dist/tanstack.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyRouter } from '@tanstack/react-router';
|
|
2
|
-
import { V as ViteReactSSGContext$1, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.
|
|
3
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.
|
|
2
|
+
import { V as ViteReactSSGContext$1, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.WtHsP9dD.cjs';
|
|
3
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.WtHsP9dD.cjs';
|
|
4
4
|
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.Cm9gBlfg.cjs';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-router-dom';
|
package/dist/tanstack.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyRouter } from '@tanstack/react-router';
|
|
2
|
-
import { V as ViteReactSSGContext$1, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.
|
|
3
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.
|
|
2
|
+
import { V as ViteReactSSGContext$1, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.WtHsP9dD.mjs';
|
|
3
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.WtHsP9dD.mjs';
|
|
4
4
|
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.Cm9gBlfg.mjs';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-router-dom';
|
package/dist/tanstack.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyRouter } from '@tanstack/react-router';
|
|
2
|
-
import { V as ViteReactSSGContext$1, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.
|
|
3
|
-
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.
|
|
2
|
+
import { V as ViteReactSSGContext$1, a as ViteReactSSGClientOptions } from './shared/vite-react-ssg.WtHsP9dD.js';
|
|
3
|
+
export { C as CrittersOptions, I as IndexRouteRecord, N as NonIndexRouteRecord, R as RouteRecord, c as RouterFutureConfig, S as StyleCollector, b as ViteReactSSGOptions } from './shared/vite-react-ssg.WtHsP9dD.js';
|
|
4
4
|
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.Cm9gBlfg.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-router-dom';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-react-ssg",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.2",
|
|
5
5
|
"packageManager": "pnpm@9.12.3",
|
|
6
6
|
"description": "Static-site generation for React on Vite.",
|
|
7
7
|
"author": "Riri <Daydreamerriri@outlook.com>",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"prettier": "^3.3.3",
|
|
145
145
|
"react": "^18.2.0",
|
|
146
146
|
"react-dom": "^18.2.0",
|
|
147
|
-
"react-router-dom": "^6.
|
|
147
|
+
"react-router-dom": "^6.28.0",
|
|
148
148
|
"rimraf": "5.0.1",
|
|
149
149
|
"styled-components": "6.0.5",
|
|
150
150
|
"typescript": "^5.6.2",
|