@modern-js/runtime 2.41.0 → 2.42.1

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.
Files changed (122) hide show
  1. package/dist/cjs/document/DocumentStructureContext.js +2 -1
  2. package/dist/cjs/document/Head.js +7 -5
  3. package/dist/cjs/document/Html.js +2 -0
  4. package/dist/cjs/document/Title.js +34 -0
  5. package/dist/cjs/document/cli/index.js +5 -1
  6. package/dist/cjs/document/constants.js +3 -0
  7. package/dist/cjs/router/runtime/index.js +6 -2
  8. package/dist/cjs/router/runtime/plugin.js +2 -2
  9. package/dist/cjs/router/runtime/{shouldRevalidate.js → routeModule.js} +19 -5
  10. package/dist/cjs/ssr/index.js +3 -3
  11. package/dist/cjs/ssr/serverRender/tracker.js +9 -6
  12. package/dist/esm/document/DocumentStructureContext.js +2 -1
  13. package/dist/esm/document/Head.js +7 -5
  14. package/dist/esm/document/Html.js +2 -0
  15. package/dist/esm/document/Title.js +10 -0
  16. package/dist/esm/document/cli/index.js +9 -3
  17. package/dist/esm/document/constants.js +2 -0
  18. package/dist/esm/router/runtime/index.js +3 -1
  19. package/dist/esm/router/runtime/plugin.js +1 -1
  20. package/dist/esm/router/runtime/{shouldRevalidate.js → routeModule.js} +13 -1
  21. package/dist/esm/ssr/index.js +1 -1
  22. package/dist/esm/ssr/serverRender/tracker.js +9 -6
  23. package/dist/esm-node/document/DocumentStructureContext.js +2 -1
  24. package/dist/esm-node/document/Head.js +7 -5
  25. package/dist/esm-node/document/Html.js +2 -0
  26. package/dist/esm-node/document/Title.js +10 -0
  27. package/dist/esm-node/document/cli/index.js +6 -2
  28. package/dist/esm-node/document/constants.js +2 -0
  29. package/dist/esm-node/router/runtime/index.js +3 -1
  30. package/dist/esm-node/router/runtime/plugin.js +1 -1
  31. package/dist/esm-node/router/runtime/{shouldRevalidate.js → routeModule.js} +13 -1
  32. package/dist/esm-node/ssr/index.js +1 -1
  33. package/dist/esm-node/ssr/serverRender/tracker.js +9 -6
  34. package/dist/types/cli/index.d.ts +1 -1
  35. package/dist/types/common.d.ts +3 -3
  36. package/dist/types/config.d.ts +5 -5
  37. package/dist/types/core/appConfig.d.ts +1 -1
  38. package/dist/types/core/compatible.d.ts +8 -11
  39. package/dist/types/core/index.d.ts +1 -1
  40. package/dist/types/core/loader/index.d.ts +1 -1
  41. package/dist/types/core/loader/loaderManager.d.ts +38 -38
  42. package/dist/types/core/loader/useLoader.d.ts +31 -31
  43. package/dist/types/core/plugin.d.ts +178 -177
  44. package/dist/types/core/types.d.ts +12 -12
  45. package/dist/types/document/Body.d.ts +2 -2
  46. package/dist/types/document/Comment.d.ts +3 -3
  47. package/dist/types/document/DocumentContext.d.ts +9 -9
  48. package/dist/types/document/DocumentStructureContext.d.ts +8 -7
  49. package/dist/types/document/Head.d.ts +2 -2
  50. package/dist/types/document/Html.d.ts +2 -2
  51. package/dist/types/document/Links.d.ts +1 -1
  52. package/dist/types/document/Root.d.ts +4 -4
  53. package/dist/types/document/Script.d.ts +2 -2
  54. package/dist/types/document/Scripts.d.ts +1 -1
  55. package/dist/types/document/Style.d.ts +3 -3
  56. package/dist/types/document/Title.d.ts +2 -0
  57. package/dist/types/document/cli/index.d.ts +1 -1
  58. package/dist/types/document/constants.d.ts +3 -2
  59. package/dist/types/document/index.d.ts +1 -1
  60. package/dist/types/exports/head.d.ts +1 -1
  61. package/dist/types/exports/loadable.d.ts +1 -1
  62. package/dist/types/exports/server.d.ts +9 -17
  63. package/dist/types/exports/styled.d.ts +1 -1
  64. package/dist/types/index.d.ts +3 -3
  65. package/dist/types/router/cli/index.d.ts +1 -1
  66. package/dist/types/router/index.d.ts +1 -1
  67. package/dist/types/router/runtime/DefaultNotFound.d.ts +1 -1
  68. package/dist/types/router/runtime/DeferredDataScripts.d.ts +1 -1
  69. package/dist/types/router/runtime/DeferredDataScripts.node.d.ts +2 -2
  70. package/dist/types/router/runtime/PrefetchLink.d.ts +3 -3
  71. package/dist/types/router/runtime/fetch.d.ts +1 -1
  72. package/dist/types/router/runtime/fetch.node.d.ts +1 -1
  73. package/dist/types/router/runtime/fetch.worker.d.ts +1 -1
  74. package/dist/types/router/runtime/hooks.d.ts +1 -1
  75. package/dist/types/router/runtime/index.d.ts +3 -3
  76. package/dist/types/router/runtime/plugin.d.ts +1 -7
  77. package/dist/types/router/runtime/plugin.node.d.ts +2 -6
  78. package/dist/types/router/runtime/routeModule.d.ts +6 -0
  79. package/dist/types/router/runtime/server.d.ts +1 -1
  80. package/dist/types/router/runtime/types.d.ts +41 -41
  81. package/dist/types/router/runtime/utils.d.ts +11 -21
  82. package/dist/types/router/runtime/withRouter.d.ts +4 -4
  83. package/dist/types/runtimeContext.d.ts +26 -26
  84. package/dist/types/ssr/cli/babel-plugin-ssr-loader-id.d.ts +1 -1
  85. package/dist/types/ssr/cli/index.d.ts +1 -1
  86. package/dist/types/ssr/cli/loadable-bundler-plugin.d.ts +1 -1
  87. package/dist/types/ssr/index.d.ts +5 -5
  88. package/dist/types/ssr/index.node.d.ts +1 -1
  89. package/dist/types/ssr/prefetch.d.ts +9 -9
  90. package/dist/types/ssr/react/index.d.ts +1 -1
  91. package/dist/types/ssr/react/nossr/index.d.ts +3 -3
  92. package/dist/types/ssr/react/prerender/index.d.ts +1 -1
  93. package/dist/types/ssr/react/prerender/type.d.ts +17 -17
  94. package/dist/types/ssr/react/prerender/util.d.ts +1 -1
  95. package/dist/types/ssr/react/withCallback/index.d.ts +3 -3
  96. package/dist/types/ssr/serverRender/helmet.d.ts +1 -1
  97. package/dist/types/ssr/serverRender/index.d.ts +1 -1
  98. package/dist/types/ssr/serverRender/renderToStream/buildTemplate.after.d.ts +3 -3
  99. package/dist/types/ssr/serverRender/renderToStream/buildTemplate.share.d.ts +1 -1
  100. package/dist/types/ssr/serverRender/renderToStream/bulidTemplate.before.d.ts +1 -1
  101. package/dist/types/ssr/serverRender/renderToStream/index.d.ts +1 -4
  102. package/dist/types/ssr/serverRender/renderToStream/renderToPipe.d.ts +1 -1
  103. package/dist/types/ssr/serverRender/renderToStream/renderToPipe.worker.d.ts +1 -1
  104. package/dist/types/ssr/serverRender/renderToStream/template.d.ts +3 -3
  105. package/dist/types/ssr/serverRender/renderToString/buildHtml.d.ts +1 -1
  106. package/dist/types/ssr/serverRender/renderToString/entry.d.ts +19 -19
  107. package/dist/types/ssr/serverRender/renderToString/index.d.ts +1 -5
  108. package/dist/types/ssr/serverRender/renderToString/loadable.d.ts +18 -18
  109. package/dist/types/ssr/serverRender/renderToString/render.d.ts +8 -8
  110. package/dist/types/ssr/serverRender/renderToString/styledComponent.d.ts +7 -7
  111. package/dist/types/ssr/serverRender/renderToString/type.d.ts +10 -10
  112. package/dist/types/ssr/serverRender/tracker.d.ts +14 -19
  113. package/dist/types/ssr/serverRender/types.d.ts +17 -17
  114. package/dist/types/ssr/serverRender/utils.d.ts +1 -1
  115. package/dist/types/ssr/utils.d.ts +4 -4
  116. package/dist/types/state/cli/index.d.ts +1 -1
  117. package/dist/types/state/index.d.ts +1 -1
  118. package/dist/types/state/plugins.d.ts +1 -1
  119. package/dist/types/state/runtime/index.d.ts +1 -1
  120. package/dist/types/state/runtime/plugin.d.ts +3 -3
  121. package/package.json +10 -10
  122. package/dist/types/router/runtime/shouldRevalidate.d.ts +0 -2
@@ -1,33 +1,34 @@
1
1
  import type React from 'react';
2
2
  import { Setup, ToThreads, CommonAPI, PluginOptions } from '@modern-js/plugin';
3
3
  import type { RuntimeContext, TRuntimeContext } from '../runtimeContext';
4
- export interface AppProps {}
4
+ export interface AppProps {
5
+ }
5
6
  declare const runtimeHooks: {
6
- hoc: import("@modern-js/plugin").Pipeline<{
7
- App: React.ComponentType<any>;
8
- }, React.ComponentType<any>>;
9
- provide: import("@modern-js/plugin").Pipeline<{
10
- element: JSX.Element;
11
- readonly props: AppProps;
12
- readonly context: RuntimeContext;
13
- }, JSX.Element>;
14
- client: import("@modern-js/plugin").AsyncPipeline<{
15
- App: React.ComponentType<any>;
16
- readonly context: RuntimeContext;
17
- ModernRender: (App: React.ReactElement) => void;
18
- ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
19
- }, void>;
20
- server: import("@modern-js/plugin").AsyncPipeline<{
21
- App: React.ComponentType<any>;
22
- readonly context: RuntimeContext;
23
- }, string>;
24
- init: import("@modern-js/plugin").AsyncPipeline<{
25
- context: RuntimeContext;
26
- }, unknown>;
27
- pickContext: import("@modern-js/plugin").Pipeline<{
28
- context: RuntimeContext;
29
- pickedContext: TRuntimeContext;
30
- }, TRuntimeContext>;
7
+ hoc: import("@modern-js/plugin").Pipeline<{
8
+ App: React.ComponentType<any>;
9
+ }, React.ComponentType<any>>;
10
+ provide: import("@modern-js/plugin").Pipeline<{
11
+ element: JSX.Element;
12
+ readonly props: AppProps;
13
+ readonly context: RuntimeContext;
14
+ }, JSX.Element>;
15
+ client: import("@modern-js/plugin").AsyncPipeline<{
16
+ App: React.ComponentType<any>;
17
+ readonly context: RuntimeContext;
18
+ ModernRender: (App: React.ReactElement) => void;
19
+ ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
20
+ }, void>;
21
+ server: import("@modern-js/plugin").AsyncPipeline<{
22
+ App: React.ComponentType<any>;
23
+ readonly context: RuntimeContext;
24
+ }, string>;
25
+ init: import("@modern-js/plugin").AsyncPipeline<{
26
+ context: RuntimeContext;
27
+ }, unknown>;
28
+ pickContext: import("@modern-js/plugin").Pipeline<{
29
+ context: RuntimeContext;
30
+ pickedContext: TRuntimeContext;
31
+ }, TRuntimeContext>;
31
32
  };
32
33
  /** All hooks of runtime plugin. */
33
34
  export type RuntimeHooks = typeof runtimeHooks;
@@ -38,166 +39,166 @@ export type PluginAPI = CommonAPI<RuntimeHooks>;
38
39
  /** Plugin options of a runtime plugin. */
39
40
  export type Plugin = PluginOptions<RuntimeHooks, Setup<RuntimeHooks>>;
40
41
  export declare const createRuntime: () => import("@modern-js/plugin").Manager<{
41
- hoc: import("@modern-js/plugin").Pipeline<{
42
- App: React.ComponentType<any>;
43
- }, React.ComponentType<any>>;
44
- provide: import("@modern-js/plugin").Pipeline<{
45
- element: JSX.Element;
46
- readonly props: AppProps;
47
- readonly context: RuntimeContext;
48
- }, JSX.Element>;
49
- client: import("@modern-js/plugin").AsyncPipeline<{
50
- App: React.ComponentType<any>;
51
- readonly context: RuntimeContext;
52
- ModernRender: (App: React.ReactElement) => void;
53
- ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
54
- }, void>;
55
- server: import("@modern-js/plugin").AsyncPipeline<{
56
- App: React.ComponentType<any>;
57
- readonly context: RuntimeContext;
58
- }, string>;
59
- init: import("@modern-js/plugin").AsyncPipeline<{
60
- context: RuntimeContext;
61
- }, unknown>;
62
- pickContext: import("@modern-js/plugin").Pipeline<{
63
- context: RuntimeContext;
64
- pickedContext: TRuntimeContext;
65
- }, TRuntimeContext>;
42
+ hoc: import("@modern-js/plugin").Pipeline<{
43
+ App: React.ComponentType<any>;
44
+ }, React.ComponentType<any>>;
45
+ provide: import("@modern-js/plugin").Pipeline<{
46
+ element: JSX.Element;
47
+ readonly props: AppProps;
48
+ readonly context: RuntimeContext;
49
+ }, JSX.Element>;
50
+ client: import("@modern-js/plugin").AsyncPipeline<{
51
+ App: React.ComponentType<any>;
52
+ readonly context: RuntimeContext;
53
+ ModernRender: (App: React.ReactElement) => void;
54
+ ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
55
+ }, void>;
56
+ server: import("@modern-js/plugin").AsyncPipeline<{
57
+ App: React.ComponentType<any>;
58
+ readonly context: RuntimeContext;
59
+ }, string>;
60
+ init: import("@modern-js/plugin").AsyncPipeline<{
61
+ context: RuntimeContext;
62
+ }, unknown>;
63
+ pickContext: import("@modern-js/plugin").Pipeline<{
64
+ context: RuntimeContext;
65
+ pickedContext: TRuntimeContext;
66
+ }, TRuntimeContext>;
66
67
  }, Record<string, never>>;
67
68
  /**
68
69
  * register init hook. It would be revoked both ssr and csr.
69
70
  */
70
71
  declare const registerInit: (App: React.ComponentType, _init: (context: RuntimeContext) => any | Promise<any>) => void;
71
72
  export declare const runtime: import("@modern-js/plugin").Manager<{
72
- hoc: import("@modern-js/plugin").Pipeline<{
73
- App: React.ComponentType<any>;
74
- }, React.ComponentType<any>>;
75
- provide: import("@modern-js/plugin").Pipeline<{
76
- element: JSX.Element;
77
- readonly props: AppProps;
78
- readonly context: RuntimeContext;
79
- }, JSX.Element>;
80
- client: import("@modern-js/plugin").AsyncPipeline<{
81
- App: React.ComponentType<any>;
82
- readonly context: RuntimeContext;
83
- ModernRender: (App: React.ReactElement) => void;
84
- ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
85
- }, void>;
86
- server: import("@modern-js/plugin").AsyncPipeline<{
87
- App: React.ComponentType<any>;
88
- readonly context: RuntimeContext;
89
- }, string>;
90
- init: import("@modern-js/plugin").AsyncPipeline<{
91
- context: RuntimeContext;
92
- }, unknown>;
93
- pickContext: import("@modern-js/plugin").Pipeline<{
94
- context: RuntimeContext;
95
- pickedContext: TRuntimeContext;
96
- }, TRuntimeContext>;
73
+ hoc: import("@modern-js/plugin").Pipeline<{
74
+ App: React.ComponentType<any>;
75
+ }, React.ComponentType<any>>;
76
+ provide: import("@modern-js/plugin").Pipeline<{
77
+ element: JSX.Element;
78
+ readonly props: AppProps;
79
+ readonly context: RuntimeContext;
80
+ }, JSX.Element>;
81
+ client: import("@modern-js/plugin").AsyncPipeline<{
82
+ App: React.ComponentType<any>;
83
+ readonly context: RuntimeContext;
84
+ ModernRender: (App: React.ReactElement) => void;
85
+ ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
86
+ }, void>;
87
+ server: import("@modern-js/plugin").AsyncPipeline<{
88
+ App: React.ComponentType<any>;
89
+ readonly context: RuntimeContext;
90
+ }, string>;
91
+ init: import("@modern-js/plugin").AsyncPipeline<{
92
+ context: RuntimeContext;
93
+ }, unknown>;
94
+ pickContext: import("@modern-js/plugin").Pipeline<{
95
+ context: RuntimeContext;
96
+ pickedContext: TRuntimeContext;
97
+ }, TRuntimeContext>;
97
98
  }, Record<string, never>>;
98
99
  export declare const createPlugin: (setup?: Setup<{
99
- hoc: import("@modern-js/plugin").Pipeline<{
100
- App: React.ComponentType<any>;
101
- }, React.ComponentType<any>>;
102
- provide: import("@modern-js/plugin").Pipeline<{
103
- element: JSX.Element;
104
- readonly props: AppProps;
105
- readonly context: RuntimeContext;
106
- }, JSX.Element>;
107
- client: import("@modern-js/plugin").AsyncPipeline<{
108
- App: React.ComponentType<any>;
109
- readonly context: RuntimeContext;
110
- ModernRender: (App: React.ReactElement) => void;
111
- ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
112
- }, void>;
113
- server: import("@modern-js/plugin").AsyncPipeline<{
114
- App: React.ComponentType<any>;
115
- readonly context: RuntimeContext;
116
- }, string>;
117
- init: import("@modern-js/plugin").AsyncPipeline<{
118
- context: RuntimeContext;
119
- }, unknown>;
120
- pickContext: import("@modern-js/plugin").Pipeline<{
121
- context: RuntimeContext;
122
- pickedContext: TRuntimeContext;
123
- }, TRuntimeContext>;
100
+ hoc: import("@modern-js/plugin").Pipeline<{
101
+ App: React.ComponentType<any>;
102
+ }, React.ComponentType<any>>;
103
+ provide: import("@modern-js/plugin").Pipeline<{
104
+ element: JSX.Element;
105
+ readonly props: AppProps;
106
+ readonly context: RuntimeContext;
107
+ }, JSX.Element>;
108
+ client: import("@modern-js/plugin").AsyncPipeline<{
109
+ App: React.ComponentType<any>;
110
+ readonly context: RuntimeContext;
111
+ ModernRender: (App: React.ReactElement) => void;
112
+ ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
113
+ }, void>;
114
+ server: import("@modern-js/plugin").AsyncPipeline<{
115
+ App: React.ComponentType<any>;
116
+ readonly context: RuntimeContext;
117
+ }, string>;
118
+ init: import("@modern-js/plugin").AsyncPipeline<{
119
+ context: RuntimeContext;
120
+ }, unknown>;
121
+ pickContext: import("@modern-js/plugin").Pipeline<{
122
+ context: RuntimeContext;
123
+ pickedContext: TRuntimeContext;
124
+ }, TRuntimeContext>;
124
125
  }, Record<string, never>> | undefined, options?: PluginOptions<{
125
- hoc: import("@modern-js/plugin").Pipeline<{
126
- App: React.ComponentType<any>;
127
- }, React.ComponentType<any>>;
128
- provide: import("@modern-js/plugin").Pipeline<{
129
- element: JSX.Element;
130
- readonly props: AppProps;
131
- readonly context: RuntimeContext;
132
- }, JSX.Element>;
133
- client: import("@modern-js/plugin").AsyncPipeline<{
134
- App: React.ComponentType<any>;
135
- readonly context: RuntimeContext;
136
- ModernRender: (App: React.ReactElement) => void;
137
- ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
138
- }, void>;
139
- server: import("@modern-js/plugin").AsyncPipeline<{
140
- App: React.ComponentType<any>;
141
- readonly context: RuntimeContext;
142
- }, string>;
143
- init: import("@modern-js/plugin").AsyncPipeline<{
144
- context: RuntimeContext;
145
- }, unknown>;
146
- pickContext: import("@modern-js/plugin").Pipeline<{
147
- context: RuntimeContext;
148
- pickedContext: TRuntimeContext;
149
- }, TRuntimeContext>;
126
+ hoc: import("@modern-js/plugin").Pipeline<{
127
+ App: React.ComponentType<any>;
128
+ }, React.ComponentType<any>>;
129
+ provide: import("@modern-js/plugin").Pipeline<{
130
+ element: JSX.Element;
131
+ readonly props: AppProps;
132
+ readonly context: RuntimeContext;
133
+ }, JSX.Element>;
134
+ client: import("@modern-js/plugin").AsyncPipeline<{
135
+ App: React.ComponentType<any>;
136
+ readonly context: RuntimeContext;
137
+ ModernRender: (App: React.ReactElement) => void;
138
+ ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
139
+ }, void>;
140
+ server: import("@modern-js/plugin").AsyncPipeline<{
141
+ App: React.ComponentType<any>;
142
+ readonly context: RuntimeContext;
143
+ }, string>;
144
+ init: import("@modern-js/plugin").AsyncPipeline<{
145
+ context: RuntimeContext;
146
+ }, unknown>;
147
+ pickContext: import("@modern-js/plugin").Pipeline<{
148
+ context: RuntimeContext;
149
+ pickedContext: TRuntimeContext;
150
+ }, TRuntimeContext>;
150
151
  }, Setup<{
151
- hoc: import("@modern-js/plugin").Pipeline<{
152
- App: React.ComponentType<any>;
153
- }, React.ComponentType<any>>;
154
- provide: import("@modern-js/plugin").Pipeline<{
155
- element: JSX.Element;
156
- readonly props: AppProps;
157
- readonly context: RuntimeContext;
158
- }, JSX.Element>;
159
- client: import("@modern-js/plugin").AsyncPipeline<{
160
- App: React.ComponentType<any>;
161
- readonly context: RuntimeContext;
162
- ModernRender: (App: React.ReactElement) => void;
163
- ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
164
- }, void>;
165
- server: import("@modern-js/plugin").AsyncPipeline<{
166
- App: React.ComponentType<any>;
167
- readonly context: RuntimeContext;
168
- }, string>;
169
- init: import("@modern-js/plugin").AsyncPipeline<{
170
- context: RuntimeContext;
171
- }, unknown>;
172
- pickContext: import("@modern-js/plugin").Pipeline<{
173
- context: RuntimeContext;
174
- pickedContext: TRuntimeContext;
175
- }, TRuntimeContext>;
152
+ hoc: import("@modern-js/plugin").Pipeline<{
153
+ App: React.ComponentType<any>;
154
+ }, React.ComponentType<any>>;
155
+ provide: import("@modern-js/plugin").Pipeline<{
156
+ element: JSX.Element;
157
+ readonly props: AppProps;
158
+ readonly context: RuntimeContext;
159
+ }, JSX.Element>;
160
+ client: import("@modern-js/plugin").AsyncPipeline<{
161
+ App: React.ComponentType<any>;
162
+ readonly context: RuntimeContext;
163
+ ModernRender: (App: React.ReactElement) => void;
164
+ ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
165
+ }, void>;
166
+ server: import("@modern-js/plugin").AsyncPipeline<{
167
+ App: React.ComponentType<any>;
168
+ readonly context: RuntimeContext;
169
+ }, string>;
170
+ init: import("@modern-js/plugin").AsyncPipeline<{
171
+ context: RuntimeContext;
172
+ }, unknown>;
173
+ pickContext: import("@modern-js/plugin").Pipeline<{
174
+ context: RuntimeContext;
175
+ pickedContext: TRuntimeContext;
176
+ }, TRuntimeContext>;
176
177
  }, Record<string, never>>> | undefined) => import("@modern-js/plugin").Plugin<{
177
- hoc: import("@modern-js/plugin").Pipeline<{
178
- App: React.ComponentType<any>;
179
- }, React.ComponentType<any>>;
180
- provide: import("@modern-js/plugin").Pipeline<{
181
- element: JSX.Element;
182
- readonly props: AppProps;
183
- readonly context: RuntimeContext;
184
- }, JSX.Element>;
185
- client: import("@modern-js/plugin").AsyncPipeline<{
186
- App: React.ComponentType<any>;
187
- readonly context: RuntimeContext;
188
- ModernRender: (App: React.ReactElement) => void;
189
- ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
190
- }, void>;
191
- server: import("@modern-js/plugin").AsyncPipeline<{
192
- App: React.ComponentType<any>;
193
- readonly context: RuntimeContext;
194
- }, string>;
195
- init: import("@modern-js/plugin").AsyncPipeline<{
196
- context: RuntimeContext;
197
- }, unknown>;
198
- pickContext: import("@modern-js/plugin").Pipeline<{
199
- context: RuntimeContext;
200
- pickedContext: TRuntimeContext;
201
- }, TRuntimeContext>;
178
+ hoc: import("@modern-js/plugin").Pipeline<{
179
+ App: React.ComponentType<any>;
180
+ }, React.ComponentType<any>>;
181
+ provide: import("@modern-js/plugin").Pipeline<{
182
+ element: JSX.Element;
183
+ readonly props: AppProps;
184
+ readonly context: RuntimeContext;
185
+ }, JSX.Element>;
186
+ client: import("@modern-js/plugin").AsyncPipeline<{
187
+ App: React.ComponentType<any>;
188
+ readonly context: RuntimeContext;
189
+ ModernRender: (App: React.ReactElement) => void;
190
+ ModernHydrate: (App: React.ReactElement, callback?: () => void) => void;
191
+ }, void>;
192
+ server: import("@modern-js/plugin").AsyncPipeline<{
193
+ App: React.ComponentType<any>;
194
+ readonly context: RuntimeContext;
195
+ }, string>;
196
+ init: import("@modern-js/plugin").AsyncPipeline<{
197
+ context: RuntimeContext;
198
+ }, unknown>;
199
+ pickContext: import("@modern-js/plugin").Pipeline<{
200
+ context: RuntimeContext;
201
+ pickedContext: TRuntimeContext;
202
+ }, TRuntimeContext>;
202
203
  }, Record<string, never>>;
203
- export { registerInit };
204
+ export { registerInit };
@@ -1,22 +1,22 @@
1
1
  import type { LoaderResult } from './loader/loaderManager';
2
2
  declare global {
3
- interface Window {
4
- _SSR_DATA?: SSRContainer;
5
- _ROUTER_DATA?: RouterSSRData;
6
- }
3
+ interface Window {
4
+ _SSR_DATA?: SSRContainer;
5
+ _ROUTER_DATA?: RouterSSRData;
6
+ }
7
7
  }
8
8
  export interface SSRData {
9
- loadersData: Record<string, LoaderResult | undefined>;
10
- initialData?: Record<string, unknown>;
11
- storeState?: any;
9
+ loadersData: Record<string, LoaderResult | undefined>;
10
+ initialData?: Record<string, unknown>;
11
+ storeState?: any;
12
12
  }
13
13
  export interface RouteData {
14
- [routeId: string]: any;
14
+ [routeId: string]: any;
15
15
  }
16
16
  export interface RouterSSRData {
17
- loaderData: RouteData;
18
- errors: RouteData | null;
17
+ loaderData: RouteData;
18
+ errors: RouteData | null;
19
19
  }
20
20
  export interface SSRContainer {
21
- data?: SSRData;
22
- }
21
+ data?: SSRData;
22
+ }
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  export declare function Body(props: {
3
- children?: any;
4
- }): JSX.Element;
3
+ children?: any;
4
+ }): JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare function Comment(props: {
3
- comment?: string;
4
- children?: string;
5
- }): JSX.Element;
3
+ comment?: string;
4
+ children?: string;
5
+ }): JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  type DocumentProps = {
3
- [x: string]: any;
4
- config?: any;
5
- templateParams: {
6
- [y: string]: any;
7
- mountId?: string;
8
- };
9
- processEnv?: Record<string, string | undefined>;
10
- children?: JSX.Element;
3
+ [x: string]: any;
4
+ config?: any;
5
+ templateParams: {
6
+ [y: string]: any;
7
+ mountId?: string;
8
+ };
9
+ processEnv?: Record<string, string | undefined>;
10
+ children?: JSX.Element;
11
11
  };
12
12
  export declare const DocumentContext: React.Context<DocumentProps>;
13
- export {};
13
+ export {};
@@ -1,11 +1,12 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  type DocumentStructureContextProps = {
3
- hasSetHead?: boolean;
4
- hasSetScripts?: boolean;
5
- hasSetLinks?: boolean;
6
- hasSetBody?: boolean;
7
- hasSetRoot?: boolean;
8
- docChild?: ReactNode;
3
+ hasSetHead?: boolean;
4
+ hasSetScripts?: boolean;
5
+ hasSetLinks?: boolean;
6
+ hasSetBody?: boolean;
7
+ hasSetRoot?: boolean;
8
+ hasSetTitle?: boolean;
9
+ docChild?: ReactNode;
9
10
  };
10
11
  export declare const DocumentStructureContext: React.Context<DocumentStructureContextProps>;
11
- export {};
12
+ export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare function Head(props: {
3
- children?: any;
3
+ children?: any;
4
4
  }): JSX.Element;
5
- export declare function DefaultHead(): JSX.Element;
5
+ export declare function DefaultHead(): JSX.Element;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  export declare function Html(props: {
3
- children: any[];
4
- }): JSX.Element;
3
+ children: any[];
4
+ }): JSX.Element;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare function Links(): JSX.Element;
2
+ export declare function Links(): JSX.Element;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  export declare function Root(props: {
3
- children?: any;
4
- rootId?: string;
3
+ children?: any;
4
+ rootId?: string;
5
5
  }): JSX.Element;
6
6
  export declare function DefaultRoot(props: {
7
- children?: any;
8
- }): JSX.Element;
7
+ children?: any;
8
+ }): JSX.Element;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  export declare function Script(props: {
3
- content: () => void;
4
- }): JSX.Element;
3
+ content: () => void;
4
+ }): JSX.Element;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare function Scripts(): JSX.Element;
2
+ export declare function Scripts(): JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare function Style(props: {
3
- children?: string;
4
- content?: string;
5
- }): JSX.Element;
3
+ children?: string;
4
+ content?: string;
5
+ }): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function Title(): JSX.Element;
@@ -2,4 +2,4 @@ import type { CliPlugin, AppTools } from '@modern-js/app-tools';
2
2
  import { Entrypoint } from '@modern-js/types/cli';
3
3
  export declare const getDocumenByEntryName: (entrypoints: Entrypoint[], entryName: string, fallbackDir?: string) => string | undefined;
4
4
  export declare const documentPlugin: () => CliPlugin<AppTools>;
5
- export default documentPlugin;
5
+ export default documentPlugin;
@@ -1,5 +1,6 @@
1
1
  export declare const DOC_EXT: string[];
2
2
  export declare const DOCUMENT_META_PLACEHOLDER: string;
3
+ export declare const DOCUMENT_TITLE_PLACEHOLDER: string;
3
4
  export declare const HTML_SEPARATOR = "<!--<?- html ?>-->";
4
5
  export declare const HEAD_PARTICALS_SEPARATOR: string;
5
6
  export declare const BODY_PARTICALS_SEPARATOR: string;
@@ -18,5 +19,5 @@ export declare const DOCUMENT_STYLE_PLACEHOLDER_END: string;
18
19
  export declare const DOCUMENT_COMMENT_PLACEHOLDER_START: string;
19
20
  export declare const DOCUMENT_COMMENT_PLACEHOLDER_END: string;
20
21
  export declare const PLACEHOLDER_REPLACER_MAP: {
21
- [x: string]: string;
22
- };
22
+ [x: string]: string;
23
+ };
@@ -9,4 +9,4 @@ export * from './Comment';
9
9
  export * from './Style';
10
10
  export * from './Scripts';
11
11
  export * from './Script';
12
- export * from './constants';
12
+ export * from './constants';
@@ -1,3 +1,3 @@
1
1
  import head from 'react-helmet';
2
2
  export default head;
3
- export * from 'react-helmet';
3
+ export * from 'react-helmet';
@@ -1,3 +1,3 @@
1
1
  import loadable from '@loadable/component';
2
2
  export default loadable;
3
- export * from '@loadable/component';
3
+ export * from '@loadable/component';
@@ -1,21 +1,13 @@
1
1
  import { AfterMatchContext, AfterRenderContext, MiddlewareContext, NextFunction } from '@modern-js/types';
2
- export declare const hook: (attacher: ({
3
- addMiddleware,
4
- afterMatch,
5
- afterRender
6
- }: {
7
- addMiddleware: (mid: Middleware) => void;
8
- afterRender: (hook: AfterRenderHook) => void;
9
- afterMatch: (hook: AfterMatchHook) => void;
10
- }) => void) => ({
11
- addMiddleware,
12
- afterMatch,
13
- afterRender
14
- }: {
15
- addMiddleware: (mid: Middleware) => void;
16
- afterRender: (hook: AfterRenderHook) => void;
17
- afterMatch: (hook: AfterMatchHook) => void;
2
+ export declare const hook: (attacher: ({ addMiddleware, afterMatch, afterRender, }: {
3
+ addMiddleware: (mid: Middleware) => void;
4
+ afterRender: (hook: AfterRenderHook) => void;
5
+ afterMatch: (hook: AfterMatchHook) => void;
6
+ }) => void) => ({ addMiddleware, afterMatch, afterRender, }: {
7
+ addMiddleware: (mid: Middleware) => void;
8
+ afterRender: (hook: AfterRenderHook) => void;
9
+ afterMatch: (hook: AfterMatchHook) => void;
18
10
  }) => void;
19
11
  export type AfterRenderHook = (context: AfterRenderContext, next: NextFunction) => void;
20
12
  export type AfterMatchHook = (context: AfterMatchContext, next: NextFunction) => void;
21
- export type Middleware = (context: MiddlewareContext, next: NextFunction) => Promise<void> | void;
13
+ export type Middleware = (context: MiddlewareContext, next: NextFunction) => Promise<void> | void;
@@ -1,3 +1,3 @@
1
1
  import styled from 'styled-components';
2
2
  export default styled;
3
- export * from 'styled-components';
3
+ export * from 'styled-components';
@@ -3,7 +3,7 @@ import type { RouterConfig } from './router';
3
3
  export type { Plugin } from './core';
4
4
  export type { AppConfig } from './common';
5
5
  export { isBrowser } from './common';
6
- export type { BaseRuntimeContext, RuntimeContext, BaseTRuntimeContext, TRuntimeContext } from './runtimeContext';
6
+ export type { BaseRuntimeContext, RuntimeContext, BaseTRuntimeContext, TRuntimeContext, } from './runtimeContext';
7
7
  export type { RuntimeUserConfig } from './config';
8
- export { createApp, createPlugin, useLoader, bootstrap, RuntimeReactContext, defineConfig, registerInit, useRuntimeContext } from './core';
9
- export { StateConfig, RouterConfig };
8
+ export { createApp, createPlugin, useLoader, bootstrap, RuntimeReactContext, defineConfig, registerInit, useRuntimeContext, } from './core';
9
+ export { StateConfig, RouterConfig };
@@ -1,3 +1,3 @@
1
1
  import type { CliPlugin, AppTools } from '@modern-js/app-tools';
2
2
  export declare const routerPlugin: () => CliPlugin<AppTools>;
3
- export default routerPlugin;
3
+ export default routerPlugin;