@modern-js/types 2.6.0 → 2.7.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @modern-js/types
2
2
 
3
+ ## 2.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dcad887024: feat: support deferred data for streaming ssr
8
+ feat: 流式渲染支持 deferred data
9
+ - 84bfb439b8: feat: support custom apiDir, lambdaDir and style of writing for bff
10
+ feat: 支持定制 api 目录,lambda 目录,bff 的写法
11
+
3
12
  ## 2.6.0
4
13
 
5
14
  ### Patch Changes
package/common/index.d.ts CHANGED
@@ -7,3 +7,5 @@ export type InternalPlugins = Record<
7
7
  string,
8
8
  string | { path: string; forced?: boolean }
9
9
  >;
10
+
11
+ export type SSRMode = 'string' | 'stream';
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.6.0",
14
+ "version": "2.7.0",
15
15
  "types": "./index.d.ts",
16
16
  "exports": {
17
17
  ".": "./index.d.ts",
@@ -38,8 +38,8 @@
38
38
  "http-proxy-middleware": "^2.0.4",
39
39
  "jest": "^27",
40
40
  "type-fest": "2.15.0",
41
- "@scripts/build": "2.6.0",
42
- "@scripts/jest-config": "2.6.0"
41
+ "@scripts/build": "2.7.0",
42
+ "@scripts/jest-config": "2.7.0"
43
43
  },
44
44
  "sideEffects": false,
45
45
  "publishConfig": {
@@ -0,0 +1 @@
1
+ export type HttpMethodDecider = 'functionName' | 'inputParams';
@@ -1,6 +1,7 @@
1
1
  import { IncomingMessage, ServerResponse, IncomingHttpHeaders } from 'http';
2
2
  import { URL } from 'url';
3
3
  import qs from 'querystring';
4
+ import type { SSRMode } from 'common';
4
5
  import { Metrics, Logger } from './utils';
5
6
 
6
7
  export interface ModernServerContext {
@@ -94,6 +95,8 @@ export type BaseSSRServerContext = {
94
95
  req: ModernServerContext['req'];
95
96
 
96
97
  res: ModernServerContext['res'];
98
+
99
+ mode?: SSRMode; // ssr type
97
100
  };
98
101
  export interface ISAppContext {
99
102
  appDirectory: string;
@@ -25,7 +25,8 @@ export type DevServerOptions = {
25
25
  protocol?: string;
26
26
  };
27
27
  devMiddleware?: {
28
- writeToDisk: boolean | ((filename: string) => boolean);
28
+ writeToDisk?: boolean | ((filename: string) => boolean);
29
+ outputFileSystem?: Record<string, any>;
29
30
  };
30
31
  proxy?: BffProxyOptions;
31
32
  headers?: Record<string, string>;
package/server/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './context';
2
2
  export * from './hook';
3
3
  export * from './utils';
4
4
  export * from './route';
5
+ export * from './bff';
5
6
  export * from './devServer';