lovable-ssr 0.1.10 → 0.1.12
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/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/AppRoutes.js +9 -9
- package/dist/components/BrowserRouteDataProvider.d.ts.map +1 -1
- package/dist/components/BrowserRouteDataProvider.js +8 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/router/RouteDataContext.d.ts +5 -1
- package/dist/router/RouteDataContext.d.ts.map +1 -1
- package/dist/router/RouteDataContext.js +16 -5
- package/dist/ssr/render.d.ts +4 -0
- package/dist/ssr/render.d.ts.map +1 -1
- package/dist/ssr/render.js +8 -4
- package/dist/ssr/server.d.ts.map +1 -1
- package/dist/ssr/server.js +33 -3
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../../src/components/AppRoutes.tsx"],"names":[],"mappings":"AAMA,wBAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../../src/components/AppRoutes.tsx"],"names":[],"mappings":"AAMA,wBAAgB,SAAS,4CAiDxB"}
|
|
@@ -13,27 +13,27 @@ export function AppRoutes() {
|
|
|
13
13
|
routeParams: {},
|
|
14
14
|
searchParams: {},
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
params.searchParams = RouterService.searchParams(location.search ?? '');
|
|
17
|
+
const routeKey = matchedRoute ? buildRouteKey(matchedRoute.path, params.routeParams, params.searchParams) : '';
|
|
17
18
|
const { data, setData } = useRouteData();
|
|
18
19
|
const currentData = routeKey ? data[routeKey] : undefined;
|
|
19
|
-
const
|
|
20
|
-
params.searchParams = RouterService.searchParams(location.search ?? '');
|
|
20
|
+
const getData = matchedRoute?.Component?.getData;
|
|
21
21
|
useEffect(() => {
|
|
22
|
-
if (!routeKey || !
|
|
22
|
+
if (!routeKey || !getData || currentData !== undefined)
|
|
23
23
|
return;
|
|
24
|
-
|
|
24
|
+
getData(params)
|
|
25
25
|
.then((d) => setData(routeKey, d))
|
|
26
26
|
.catch((e) => {
|
|
27
|
-
console.error('Client
|
|
27
|
+
console.error('Client getData failed:', e);
|
|
28
28
|
setData(routeKey, {});
|
|
29
29
|
});
|
|
30
|
-
}, [routeKey,
|
|
30
|
+
}, [routeKey, getData, params, currentData, setData]);
|
|
31
31
|
return (_jsx(Routes, { children: routes.map((route) => {
|
|
32
32
|
const isMatched = matchedRoute === route;
|
|
33
|
-
const
|
|
33
|
+
const getDataForRoute = route.Component.getData;
|
|
34
34
|
let element;
|
|
35
35
|
if (isMatched) {
|
|
36
|
-
if (typeof
|
|
36
|
+
if (typeof getDataForRoute === 'function') {
|
|
37
37
|
element =
|
|
38
38
|
currentData !== undefined ? (_jsx(route.Component, { ...currentData })) : null;
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserRouteDataProvider.d.ts","sourceRoot":"","sources":["../../src/components/BrowserRouteDataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"BrowserRouteDataProvider.d.ts","sourceRoot":"","sources":["../../src/components/BrowserRouteDataProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CA0B7E"}
|
|
@@ -12,12 +12,14 @@ import { RouteDataProvider } from '../router/RouteDataContext.js';
|
|
|
12
12
|
export function BrowserRouteDataProvider({ children }) {
|
|
13
13
|
const preloadedData = typeof window !== 'undefined' ? (window.__PRELOADED_DATA__ ?? {}) : {};
|
|
14
14
|
const pathname = typeof window !== 'undefined' ? window.location.pathname || '/' : '/';
|
|
15
|
+
const searchParams = typeof window !== 'undefined' ? RouterService.searchParams(window.location.search ?? '') : {};
|
|
15
16
|
const matchedRoute = RouterService.matchRoute(pathname);
|
|
16
|
-
const
|
|
17
|
+
const routeParamsResult = matchedRoute
|
|
17
18
|
? RouterService.routeParams(matchedRoute.path, pathname)
|
|
18
|
-
: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
: { routeParams: {}, searchParams: {} };
|
|
20
|
+
const initialParams = {
|
|
21
|
+
routeParams: routeParamsResult.routeParams,
|
|
22
|
+
searchParams: Object.keys(searchParams).length > 0 ? searchParams : routeParamsResult.searchParams,
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(RouteDataProvider, { initialData: preloadedData, initialRoute: matchedRoute, initialParams: initialParams, children: children }));
|
|
23
25
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './globals.js';
|
|
2
|
-
export type { RouteConfig,
|
|
2
|
+
export type { RouteConfig, ComponentWithGetData } from './types.js';
|
|
3
3
|
export { registerRoutes, getRoutes } from './registry.js';
|
|
4
4
|
export { BrowserRouteDataProvider } from './components/BrowserRouteDataProvider.js';
|
|
5
5
|
export { default as RouterService } from './router/RouterService.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,MAAM,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
export type RouteDataState = Record<string, Record<string, unknown>>;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Builds a stable cache key for route data. Includes path, route params and optionally search params
|
|
5
|
+
* so that the same path with different query strings (e.g. ?filter=FPS vs ?filter=RPG) gets different keys.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildRouteKey(path: string, routeParams: Record<string, string>, searchParams?: Record<string, string>): string;
|
|
4
8
|
interface RouteDataContextValue {
|
|
5
9
|
data: RouteDataState;
|
|
6
10
|
setData: (routeKey: string, value: Record<string, unknown>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteDataContext.d.ts","sourceRoot":"","sources":["../../src/router/RouteDataContext.tsx"],"names":[],"mappings":"AAAA,OAAc,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAErE,wBAAgB,aAAa,
|
|
1
|
+
{"version":3,"file":"RouteDataContext.d.ts","sourceRoot":"","sources":["../../src/router/RouteDataContext.tsx"],"names":[],"mappings":"AAAA,OAAc,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAErE;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,MAAM,CAYR;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACrE;AAID,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChF;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,aAGC,GACF,EAAE,sBAAsB,2CAmBxB;AAED,wBAAgB,YAAY,IAAI,qBAAqB,CAMpD"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useCallback, useContext, useMemo, useState, } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Builds a stable cache key for route data. Includes path, route params and optionally search params
|
|
5
|
+
* so that the same path with different query strings (e.g. ?filter=FPS vs ?filter=RPG) gets different keys.
|
|
6
|
+
*/
|
|
7
|
+
export function buildRouteKey(path, routeParams, searchParams) {
|
|
8
|
+
const sortedRoute = Object.keys(routeParams)
|
|
5
9
|
.sort()
|
|
6
|
-
.reduce((acc, k) => ({ ...acc, [k]:
|
|
7
|
-
|
|
10
|
+
.reduce((acc, k) => ({ ...acc, [k]: routeParams[k] }), {});
|
|
11
|
+
let key = `${path}|${JSON.stringify(sortedRoute)}`;
|
|
12
|
+
if (searchParams && Object.keys(searchParams).length > 0) {
|
|
13
|
+
const sortedSearch = Object.keys(searchParams)
|
|
14
|
+
.sort()
|
|
15
|
+
.reduce((acc, k) => ({ ...acc, [k]: searchParams[k] }), {});
|
|
16
|
+
key += `|${JSON.stringify(sortedSearch)}`;
|
|
17
|
+
}
|
|
18
|
+
return key;
|
|
8
19
|
}
|
|
9
20
|
const RouteDataContext = createContext(null);
|
|
10
21
|
export function RouteDataProvider({ children, initialData, initialRoute, initialParams = {
|
|
@@ -12,7 +23,7 @@ export function RouteDataProvider({ children, initialData, initialRoute, initial
|
|
|
12
23
|
searchParams: {},
|
|
13
24
|
}, }) {
|
|
14
25
|
const initialKey = initialRoute && Object.keys(initialData ?? {}).length > 0
|
|
15
|
-
? buildRouteKey(initialRoute.path, initialParams.routeParams)
|
|
26
|
+
? buildRouteKey(initialRoute.path, initialParams.routeParams, initialParams.searchParams)
|
|
16
27
|
: null;
|
|
17
28
|
const [data, setDataState] = useState(() => initialKey && initialData ? { [initialKey]: initialData } : {});
|
|
18
29
|
const setData = useCallback((routeKey, value) => {
|
package/dist/ssr/render.d.ts
CHANGED
|
@@ -6,5 +6,9 @@ export interface RenderResult {
|
|
|
6
6
|
export interface RenderOptions {
|
|
7
7
|
wrap?: (children: ReactNode) => ReactNode;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders the app for a single URL. Called once per request with that request's URL.
|
|
11
|
+
* getData is invoked only for the route that matches this URL (never for all routes).
|
|
12
|
+
*/
|
|
9
13
|
export declare function render(url: string, options?: RenderOptions): Promise<RenderResult>;
|
|
10
14
|
//# sourceMappingURL=render.d.ts.map
|
package/dist/ssr/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/ssr/render.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,SAAS,CAAC;CAC3C;AAED,wBAAsB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAqCxF"}
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/ssr/render.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,SAAS,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAqCxF"}
|
package/dist/ssr/render.js
CHANGED
|
@@ -4,6 +4,10 @@ import { StaticRouter } from 'react-router-dom/server';
|
|
|
4
4
|
import RouterService from '../router/RouterService.js';
|
|
5
5
|
import { RouteDataProvider } from '../router/RouteDataContext.js';
|
|
6
6
|
import { AppRoutes } from '../components/AppRoutes.js';
|
|
7
|
+
/**
|
|
8
|
+
* Renders the app for a single URL. Called once per request with that request's URL.
|
|
9
|
+
* getData is invoked only for the route that matches this URL (never for all routes).
|
|
10
|
+
*/
|
|
7
11
|
export async function render(url, options) {
|
|
8
12
|
const fullUrl = new URL(url, 'http://localhost');
|
|
9
13
|
const pathname = fullUrl.pathname || '/';
|
|
@@ -15,13 +19,13 @@ export async function render(url, options) {
|
|
|
15
19
|
const searchParams = matchedRoute ? RouterService.searchParams(fullUrl.search) : {};
|
|
16
20
|
params.searchParams = searchParams;
|
|
17
21
|
let preloadedData = { is_success: true };
|
|
18
|
-
const
|
|
19
|
-
if (typeof
|
|
22
|
+
const getData = matchedRoute?.Component?.getData;
|
|
23
|
+
if (typeof getData === 'function') {
|
|
20
24
|
try {
|
|
21
|
-
preloadedData = await
|
|
25
|
+
preloadedData = await getData(params);
|
|
22
26
|
}
|
|
23
27
|
catch (e) {
|
|
24
|
-
console.error(`SSR
|
|
28
|
+
console.error(`SSR getData failed for ${matchedRoute?.path}:`, e);
|
|
25
29
|
preloadedData = { ...preloadedData, is_success: false };
|
|
26
30
|
}
|
|
27
31
|
}
|
package/dist/ssr/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/ssr/server.ts"],"names":[],"mappings":"AAGA,OAAgB,EAAE,KAAK,OAAO,EAAkD,MAAM,SAAS,CAAC;AAIhG,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/ssr/server.ts"],"names":[],"mappings":"AAGA,OAAgB,EAAE,KAAK,OAAO,EAAkD,MAAM,SAAS,CAAC;AAIhG,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA8MD,wBAAsB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC;IACtE,MAAM,EAAE,MAAM,OAAO,CAAC;IACtB,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACxD,CAAC,CAOD;AAED;qDACqD;AACrD,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,QAO7D"}
|
package/dist/ssr/server.js
CHANGED
|
@@ -15,6 +15,15 @@ class SsrServer {
|
|
|
15
15
|
config;
|
|
16
16
|
isProd;
|
|
17
17
|
_rendererCache;
|
|
18
|
+
/** On-demand SSR cache: key = pathname + normalized search params, value = render result. Only used in production. */
|
|
19
|
+
_ssrCache = new Map();
|
|
20
|
+
normalizeCacheKey(url) {
|
|
21
|
+
const u = new URL(url, 'http://localhost');
|
|
22
|
+
const search = new URLSearchParams(u.search);
|
|
23
|
+
const sorted = new URLSearchParams([...search.entries()].sort((a, b) => a[0].localeCompare(b[0])));
|
|
24
|
+
const q = sorted.toString();
|
|
25
|
+
return (u.pathname || '/') + (q ? `?${q}` : '');
|
|
26
|
+
}
|
|
18
27
|
constructor(config) {
|
|
19
28
|
this.config = {
|
|
20
29
|
root: path.resolve(config.root),
|
|
@@ -86,9 +95,30 @@ class SsrServer {
|
|
|
86
95
|
}
|
|
87
96
|
async renderSsr(url, res) {
|
|
88
97
|
const { template, render } = await this.getSsrRenderer();
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
98
|
+
if (process.env.NODE_ENV !== 'production' && process.env.LOVABLE_SSR_DEBUG) {
|
|
99
|
+
console.log('[lovable-ssr] render(url)', url);
|
|
100
|
+
}
|
|
101
|
+
let appHtml;
|
|
102
|
+
let preloadedData;
|
|
103
|
+
if (this.isProd) {
|
|
104
|
+
const cacheKey = this.normalizeCacheKey(url);
|
|
105
|
+
const cached = this._ssrCache.get(cacheKey);
|
|
106
|
+
if (cached) {
|
|
107
|
+
appHtml = cached.html;
|
|
108
|
+
preloadedData = cached.preloadedData;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
const result = await render(url);
|
|
112
|
+
appHtml = typeof result.html === 'string' ? result.html : '';
|
|
113
|
+
preloadedData = result.preloadedData ?? {};
|
|
114
|
+
this._ssrCache.set(cacheKey, { html: appHtml, preloadedData });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const result = await render(url);
|
|
119
|
+
appHtml = typeof result.html === 'string' ? result.html : '';
|
|
120
|
+
preloadedData = result.preloadedData ?? {};
|
|
121
|
+
}
|
|
92
122
|
let html = template.replace('<div id="root"></div>', `<div id="root">${appHtml}</div>`);
|
|
93
123
|
html = this.injectPreloadedData(html, preloadedData);
|
|
94
124
|
if (this.vite) {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
export type
|
|
3
|
-
|
|
2
|
+
export type ComponentWithGetData = React.ComponentType<any> & {
|
|
3
|
+
getData?: (params?: Record<'routeParams' | 'searchParams', Record<string, string>>) => Promise<Record<string, unknown>>;
|
|
4
4
|
};
|
|
5
5
|
export type RouteConfig = {
|
|
6
6
|
path: string;
|
|
7
|
-
Component:
|
|
7
|
+
Component: ComponentWithGetData;
|
|
8
8
|
isSSR: boolean;
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,aAAa,GAAG,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACzH,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lovable-ssr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "SSR and route data engine for Lovable projects",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ssr",
|
|
7
|
+
"react",
|
|
8
|
+
"vite",
|
|
9
|
+
"express",
|
|
10
|
+
"lovable",
|
|
11
|
+
"getData",
|
|
12
|
+
"route-registry",
|
|
13
|
+
"server-side-rendering"
|
|
14
|
+
],
|
|
5
15
|
"type": "module",
|
|
6
16
|
"main": "./dist/index.js",
|
|
7
17
|
"module": "./dist/index.js",
|