@umijs/renderer-react 4.0.0-canary.20240517.1 → 4.0.0-canary.20240605.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.
- package/dist/browser.d.ts +10 -8
- package/dist/browser.js +1 -1
- package/dist/html.d.ts +1 -1
- package/dist/html.js +3 -4
- package/dist/types.d.ts +4 -2
- package/package.json +3 -3
package/dist/browser.d.ts
CHANGED
|
@@ -28,14 +28,16 @@ export declare type RenderClientOpts = {
|
|
|
28
28
|
* @doc 一般不需要改,微前端的时候会变化
|
|
29
29
|
*/
|
|
30
30
|
rootElement?: HTMLElement;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
|
|
32
|
+
/**
|
|
33
|
+
* 内部流程, 渲染特殊 app 节点, 不要使用!!!
|
|
34
|
+
*/
|
|
35
|
+
pureApp?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 内部流程, 渲染特殊 html 节点, 不要使用!!!
|
|
38
|
+
*/
|
|
39
|
+
pureHtml?: boolean;
|
|
40
|
+
};
|
|
39
41
|
/**
|
|
40
42
|
* 当前的路由配置
|
|
41
43
|
*/
|
package/dist/browser.js
CHANGED
|
@@ -280,7 +280,7 @@ export function renderClient(opts) {
|
|
|
280
280
|
loaderData: loaderData,
|
|
281
281
|
mountElementId: opts.mountElementId
|
|
282
282
|
};
|
|
283
|
-
ReactDOM.hydrateRoot(opts.
|
|
283
|
+
ReactDOM.hydrateRoot(opts.__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.pureApp ? rootElement : document, /*#__PURE__*/React.createElement(Html, hydtateHtmloptions, /*#__PURE__*/React.createElement(Browser, null)));
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
if (ReactDOM.createRoot) {
|
package/dist/html.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IHtmlProps } from './types';
|
|
3
|
-
export declare function Html({ children, loaderData, manifest, htmlPageOpts,
|
|
3
|
+
export declare function Html({ children, loaderData, manifest, htmlPageOpts, __INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, mountElementId, }: React.PropsWithChildren<IHtmlProps>): JSX.Element;
|
package/dist/html.js
CHANGED
|
@@ -109,12 +109,11 @@ export function Html(_ref) {
|
|
|
109
109
|
loaderData = _ref.loaderData,
|
|
110
110
|
manifest = _ref.manifest,
|
|
111
111
|
htmlPageOpts = _ref.htmlPageOpts,
|
|
112
|
-
|
|
113
|
-
__SPECIAL_HTML_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = _ref.__SPECIAL_HTML_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
|
112
|
+
__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = _ref.__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
|
114
113
|
mountElementId = _ref.mountElementId;
|
|
115
114
|
// TODO: 处理 head 标签,比如 favicon.ico 的一致性
|
|
116
115
|
// TODO: root 支持配置
|
|
117
|
-
if (
|
|
116
|
+
if (__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== null && __INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== void 0 && __INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.pureHtml) {
|
|
118
117
|
return /*#__PURE__*/React.createElement("html", null, /*#__PURE__*/React.createElement("head", null), /*#__PURE__*/React.createElement("body", null, /*#__PURE__*/React.createElement(EnableJsScript, null), /*#__PURE__*/React.createElement("div", {
|
|
119
118
|
id: mountElementId
|
|
120
119
|
}, children), /*#__PURE__*/React.createElement(GlobalDataScript, {
|
|
@@ -123,7 +122,7 @@ export function Html(_ref) {
|
|
|
123
122
|
htmlPageOpts: htmlPageOpts
|
|
124
123
|
})));
|
|
125
124
|
}
|
|
126
|
-
if (
|
|
125
|
+
if (__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== null && __INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED !== void 0 && __INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.pureApp) {
|
|
127
126
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
128
127
|
}
|
|
129
128
|
var serverBuildManifest = typeof window === 'undefined' ? manifest : window.__UMI_BUILD_MANIFEST_DATA__;
|
package/dist/types.d.ts
CHANGED
|
@@ -49,8 +49,10 @@ export interface ILoaderData {
|
|
|
49
49
|
}
|
|
50
50
|
interface IHtmlHydrateOptions {
|
|
51
51
|
htmlPageOpts?: IhtmlPageOpts;
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?: {
|
|
53
|
+
pureApp: boolean;
|
|
54
|
+
pureHtml: boolean;
|
|
55
|
+
};
|
|
54
56
|
mountElementId?: string;
|
|
55
57
|
}
|
|
56
58
|
export interface IRootComponentOptions extends IHtmlHydrateOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/renderer-react",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.20240605.1",
|
|
4
4
|
"description": "@umijs/renderer-react",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-react#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"react-router-dom": "6.3.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"react": "18.
|
|
27
|
-
"react-dom": "18.
|
|
26
|
+
"react": "18.1.0",
|
|
27
|
+
"react-dom": "18.1.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": ">=16.8",
|