5htp-core 0.3.9-3 → 0.3.9-4
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5htp-core",
|
|
3
3
|
"description": "Convenient TypeScript framework designed for Performance and Productivity.",
|
|
4
|
-
"version": "0.3.9-
|
|
4
|
+
"version": "0.3.9-4",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp-core.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -126,7 +126,6 @@ type THookName = 'location.change' | 'page.changed'
|
|
|
126
126
|
type Config<TAdditionnalContext extends {} = {}> = {
|
|
127
127
|
preload: string[], // List of globs
|
|
128
128
|
context: (context: ClientContext, router: ClientRouter) => TAdditionnalContext,
|
|
129
|
-
domains: TDomainsList
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
/*----------------------------------
|
|
@@ -140,6 +139,7 @@ export default class ClientRouter<
|
|
|
140
139
|
// Context data
|
|
141
140
|
public ssrRoutes = window["routes"] as TSsrUnresolvedRoute[];
|
|
142
141
|
public ssrContext = window["ssr"] as (TBasicSSrData | undefined);
|
|
142
|
+
public domains = window["ssr"].domains;
|
|
143
143
|
public context!: ClientContext;
|
|
144
144
|
|
|
145
145
|
public setLoading!: React.Dispatch< React.SetStateAction<boolean> >;
|
|
@@ -14,7 +14,7 @@ import express from 'express';
|
|
|
14
14
|
import { Application } from '@server/app';
|
|
15
15
|
import type ServerRouter from '@server/services/router';
|
|
16
16
|
import ServerRequest from '@server/services/router/request';
|
|
17
|
-
import { TRoute, TAnyRoute } from '@common/router';
|
|
17
|
+
import { TRoute, TAnyRoute, TDomainsList } from '@common/router';
|
|
18
18
|
import { NotFound, Forbidden, Anomaly } from '@common/errors';
|
|
19
19
|
import BaseResponse, { TResponseData } from '@common/router/response';
|
|
20
20
|
import Page from './page';
|
|
@@ -31,7 +31,8 @@ const debug = true;
|
|
|
31
31
|
export type TBasicSSrData = {
|
|
32
32
|
request: { data: TObjetDonnees, id: string },
|
|
33
33
|
page: { chunkId: string, data?: TObjetDonnees },
|
|
34
|
-
user: User | null
|
|
34
|
+
user: User | null,
|
|
35
|
+
domains: TDomainsList
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
export type TRouterContext<TRouter extends ServerRouter = ServerRouter> = (
|
|
@@ -176,6 +177,7 @@ export default class ServerResponse<
|
|
|
176
177
|
chunkId: page.chunkId,
|
|
177
178
|
data: page.data
|
|
178
179
|
},
|
|
180
|
+
domains: this.router.config.domains,
|
|
179
181
|
...customSsrData
|
|
180
182
|
}
|
|
181
183
|
}
|