@umijs/server 4.6.67 → 4.6.69
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/index.d.ts +1 -0
- package/dist/scripts.d.ts +5 -5
- package/dist/ssr.d.ts +5 -6
- package/dist/ssr.js +2 -1
- package/dist/styles.d.ts +5 -5
- package/dist/types.d.ts +5 -5
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/scripts.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type IScript = string | {
|
|
2
2
|
src?: string;
|
|
3
3
|
content?: string;
|
|
4
4
|
};
|
|
5
5
|
export declare function normalizeScripts(scripts: IScript[]): {
|
|
6
|
-
src?: string
|
|
7
|
-
content?: string
|
|
6
|
+
src?: string;
|
|
7
|
+
content?: string;
|
|
8
8
|
}[];
|
|
9
9
|
export declare function normalizeScript(script: IScript): {
|
|
10
|
-
src?: string
|
|
11
|
-
content?: string
|
|
10
|
+
src?: string;
|
|
11
|
+
content?: string;
|
|
12
12
|
};
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference lib="webworker" />
|
|
2
1
|
import type { RequestHandler } from '@umijs/bundler-utils/compiled/express';
|
|
3
|
-
import React from 'react';
|
|
2
|
+
import React, { ReactElement } from 'react';
|
|
4
3
|
import type { IhtmlPageOpts, UmiRequest } from './types';
|
|
5
4
|
interface RouteLoaders {
|
|
6
5
|
[key: string]: () => Promise<any>;
|
|
7
6
|
}
|
|
8
|
-
export
|
|
7
|
+
export type ServerInsertedHTMLHook = (callbacks: () => React.ReactNode) => void;
|
|
9
8
|
interface CreateRequestServerlessOptions {
|
|
10
9
|
/**
|
|
11
10
|
* folder path for `build-manifest.json`
|
|
@@ -36,8 +35,8 @@ interface CreateRequestHandlerOptions extends CreateRequestServerlessOptions {
|
|
|
36
35
|
useStream?: boolean;
|
|
37
36
|
}
|
|
38
37
|
export declare function createMarkupGenerator(opts: CreateRequestHandlerOptions): (url: string) => Promise<unknown>;
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
type IExpressRequestHandlerArgs = Parameters<RequestHandler>;
|
|
39
|
+
type IWorkerRequestHandlerArgs = [
|
|
41
40
|
ev: FetchEvent,
|
|
42
41
|
opts?: {
|
|
43
42
|
modifyResponse?: (res: Response) => Promise<Response> | Response;
|
|
@@ -46,5 +45,5 @@ declare type IWorkerRequestHandlerArgs = [
|
|
|
46
45
|
export default function createRequestHandler(opts: CreateRequestHandlerOptions): (...args: IExpressRequestHandlerArgs | IWorkerRequestHandlerArgs) => Promise<void>;
|
|
47
46
|
export declare function createUmiHandler(opts: CreateRequestHandlerOptions): (req: UmiRequest, params?: CreateRequestHandlerOptions) => Promise<NodeJS.ReadableStream>;
|
|
48
47
|
export declare function createUmiServerLoader(opts: CreateRequestHandlerOptions): (req: UmiRequest) => Promise<any>;
|
|
49
|
-
export declare function createAppRootElement(opts: CreateRequestHandlerOptions): (...args: IExpressRequestHandlerArgs | IWorkerRequestHandlerArgs) => Promise<() =>
|
|
48
|
+
export declare function createAppRootElement(opts: CreateRequestHandlerOptions): (...args: IExpressRequestHandlerArgs | IWorkerRequestHandlerArgs) => Promise<() => ReactElement<any, string | React.JSXElementConstructor<any>> | undefined>;
|
|
50
49
|
export {};
|
package/dist/ssr.js
CHANGED
|
@@ -504,7 +504,8 @@ async function executeMetadataLoader(params) {
|
|
|
504
504
|
);
|
|
505
505
|
const result = {};
|
|
506
506
|
Object.values(MetaLoaderResultKeys).forEach((key) => {
|
|
507
|
-
if (loaderDatas == null ? void 0 : loaderDatas[key])
|
|
507
|
+
if (loaderDatas == null ? void 0 : loaderDatas[key])
|
|
508
|
+
result[key] = loaderDatas[key];
|
|
508
509
|
});
|
|
509
510
|
return result;
|
|
510
511
|
}
|
package/dist/styles.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type IStyle = string | {
|
|
2
2
|
src?: string;
|
|
3
3
|
content?: string;
|
|
4
4
|
};
|
|
5
5
|
export declare function normalizeStyles(scripts: IStyle[]): {
|
|
6
|
-
src?: string
|
|
7
|
-
content?: string
|
|
6
|
+
src?: string;
|
|
7
|
+
content?: string;
|
|
8
8
|
}[];
|
|
9
9
|
export declare function normalizeStyle(style: IStyle): {
|
|
10
|
-
src?: string
|
|
11
|
-
content?: string
|
|
10
|
+
src?: string;
|
|
11
|
+
content?: string;
|
|
12
12
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface IOpts {
|
|
|
20
20
|
}) => Promise<string>;
|
|
21
21
|
historyType?: 'hash' | 'browser';
|
|
22
22
|
}
|
|
23
|
-
export
|
|
23
|
+
export type IUserExtraRoute = string | {
|
|
24
24
|
path: string;
|
|
25
25
|
prerender: boolean;
|
|
26
26
|
};
|
|
@@ -36,12 +36,12 @@ export interface IRoutesById {
|
|
|
36
36
|
export interface IRouteCustom extends IRoute {
|
|
37
37
|
[key: string]: any;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
export
|
|
39
|
+
type LoaderReturn<T> = T | Promise<T>;
|
|
40
|
+
export type UmiRequest = Partial<Request> & Pick<Request, 'url' | 'headers'>;
|
|
41
41
|
export interface IServerLoaderArgs {
|
|
42
42
|
request: UmiRequest;
|
|
43
43
|
}
|
|
44
|
-
export
|
|
44
|
+
export type ServerLoader<T = any> = (req?: IServerLoaderArgs) => LoaderReturn<T>;
|
|
45
45
|
export interface IMetaTag {
|
|
46
46
|
name: string;
|
|
47
47
|
content: string;
|
|
@@ -64,5 +64,5 @@ export interface IhtmlPageOpts extends IMetadata {
|
|
|
64
64
|
scripts?: (Record<string, string> | string)[];
|
|
65
65
|
[key: string]: any;
|
|
66
66
|
}
|
|
67
|
-
export
|
|
67
|
+
export type MetadataLoader<T = any> = (serverLoaderData: T, req?: IServerLoaderArgs) => LoaderReturn<IMetadata>;
|
|
68
68
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/server",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.69",
|
|
4
4
|
"description": "@umijs/server",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/server#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react": "18.3.1",
|
|
20
20
|
"react-dom": "18.3.1",
|
|
21
21
|
"react-router-dom": "6.3.0",
|
|
22
|
-
"@umijs/bundler-utils": "4.6.
|
|
22
|
+
"@umijs/bundler-utils": "4.6.69"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|