@alicloud/alfa-react 1.4.30-alpha.7 → 1.4.30-alpha.8

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.
@@ -6,6 +6,7 @@ var containerStyle = {
6
6
  padding: padding
7
7
  };
8
8
  var commonErrorStyle = {
9
+ display: 'none',
9
10
  lineHeight: '22px',
10
11
  color: '#d93026',
11
12
  fontSize: 14
@@ -14,10 +15,6 @@ var commonErrorStyle = {
14
15
  var ErrorPanel = function ErrorPanel(props) {
15
16
  var error = props.error;
16
17
  return /*#__PURE__*/React.createElement("div", {
17
- style: {
18
- padding: padding
19
- }
20
- }, process.env.NODE_ENV === 'development' ? /*#__PURE__*/React.createElement("div", {
21
18
  style: containerStyle
22
19
  }, /*#__PURE__*/React.createElement("div", {
23
20
  style: commonErrorStyle
@@ -25,9 +22,7 @@ var ErrorPanel = function ErrorPanel(props) {
25
22
  style: {
26
23
  overflow: 'scroll'
27
24
  }
28
- }, error === null || error === void 0 ? void 0 : error.stack)) : /*#__PURE__*/React.createElement("div", {
29
- style: commonErrorStyle
30
- }, "Error"));
25
+ }, error === null || error === void 0 ? void 0 : error.stack));
31
26
  };
32
27
 
33
28
  export default ErrorPanel;
@@ -34,13 +34,11 @@ function createAlfaApp(option) {
34
34
  }, [props]);
35
35
  return /*#__PURE__*/React.createElement(ErrorBoundary, props, /*#__PURE__*/React.createElement(Application // 兼容历史逻辑,优先使用 option 中的 sandbox 参数
36
36
  , _extends({}, passedInOption, {
37
- puppeteer: props.puppeteer,
37
+ syncHistory: props.syncHistory,
38
38
  basename: props.basename,
39
39
  sandbox: option.sandbox || props.sandbox,
40
40
  deps: dependencies || {},
41
- customProps: customProps // 受控模式下,用于触发子应用随主应用路由变更更新
42
- ,
43
- path: props.puppeteer ? window.location.toString() : props.path
41
+ customProps: customProps
44
42
  })));
45
43
  };
46
44
  }
@@ -75,7 +75,7 @@ export default function createApplication(loader) {
75
75
  locale = props.locale,
76
76
  dynamicConfig = props.dynamicConfig,
77
77
  noCache = props.noCache,
78
- puppeteer = props.puppeteer,
78
+ syncHistory = props.syncHistory,
79
79
  basename = props.basename;
80
80
 
81
81
  var _useState = useState(null),
@@ -88,13 +88,13 @@ export default function createApplication(loader) {
88
88
  setError = _useState4[1];
89
89
 
90
90
  var appRef = useRef(undefined);
91
- var $puppeteer = useRef(puppeteer);
91
+ var $syncHistory = useRef(syncHistory);
92
92
  var $basename = useRef(basename);
93
93
  var tagName = normalizeName(props.name);
94
- $puppeteer.current = puppeteer;
94
+ $syncHistory.current = syncHistory;
95
95
  $basename.current = basename; // 受控模式锁定一些参数
96
96
 
97
- if ($puppeteer.current) {
97
+ if ($syncHistory.current) {
98
98
  // 禁止子应用和 consoleBase 通信
99
99
  customProps.consoleBase = null; // 覆写 path 参数,用于通知子应用更新路由
100
100
 
@@ -249,7 +249,7 @@ export default function createApplication(loader) {
249
249
 
250
250
  if (frameWindow) {
251
251
  frameWindow.history.pushState = function (data, unused, _url) {
252
- if ($puppeteer.current) {
252
+ if ($syncHistory.current) {
253
253
  var nextPath = addBasename((_url === null || _url === void 0 ? void 0 : _url.toString()) || '', $basename.current);
254
254
 
255
255
  if ("".concat(nextPath) !== peelPath(window.location)) {
@@ -265,7 +265,7 @@ export default function createApplication(loader) {
265
265
  frameWindow.history.replaceState = function (data, unused, _url) {
266
266
  var nextPath = addBasename((_url === null || _url === void 0 ? void 0 : _url.toString()) || '', $basename.current);
267
267
 
268
- if ($puppeteer.current) {
268
+ if ($syncHistory.current) {
269
269
  window.history.replaceState(data, unused, nextPath);
270
270
  }
271
271
 
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '1.4.30-alpha.7';
1
+ export var version = '1.4.30-alpha.8';
@@ -16,6 +16,7 @@ var containerStyle = {
16
16
  padding: padding
17
17
  };
18
18
  var commonErrorStyle = {
19
+ display: 'none',
19
20
  lineHeight: '22px',
20
21
  color: '#d93026',
21
22
  fontSize: 14
@@ -24,10 +25,6 @@ var commonErrorStyle = {
24
25
  var ErrorPanel = function ErrorPanel(props) {
25
26
  var error = props.error;
26
27
  return /*#__PURE__*/_react.default.createElement("div", {
27
- style: {
28
- padding: padding
29
- }
30
- }, process.env.NODE_ENV === 'development' ? /*#__PURE__*/_react.default.createElement("div", {
31
28
  style: containerStyle
32
29
  }, /*#__PURE__*/_react.default.createElement("div", {
33
30
  style: commonErrorStyle
@@ -35,9 +32,7 @@ var ErrorPanel = function ErrorPanel(props) {
35
32
  style: {
36
33
  overflow: 'scroll'
37
34
  }
38
- }, error === null || error === void 0 ? void 0 : error.stack)) : /*#__PURE__*/_react.default.createElement("div", {
39
- style: commonErrorStyle
40
- }, "Error"));
35
+ }, error === null || error === void 0 ? void 0 : error.stack));
41
36
  };
42
37
 
43
38
  var _default = ErrorPanel;
@@ -57,13 +57,11 @@ function createAlfaApp(option) {
57
57
  }, [props]);
58
58
  return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, props, /*#__PURE__*/_react.default.createElement(Application // 兼容历史逻辑,优先使用 option 中的 sandbox 参数
59
59
  , (0, _extends2.default)({}, passedInOption, {
60
- puppeteer: props.puppeteer,
60
+ syncHistory: props.syncHistory,
61
61
  basename: props.basename,
62
62
  sandbox: option.sandbox || props.sandbox,
63
63
  deps: dependencies || {},
64
- customProps: customProps // 受控模式下,用于触发子应用随主应用路由变更更新
65
- ,
66
- path: props.puppeteer ? window.location.toString() : props.path
64
+ customProps: customProps
67
65
  })));
68
66
  };
69
67
  }
@@ -97,7 +97,7 @@ function createApplication(loader) {
97
97
  locale = props.locale,
98
98
  dynamicConfig = props.dynamicConfig,
99
99
  noCache = props.noCache,
100
- puppeteer = props.puppeteer,
100
+ syncHistory = props.syncHistory,
101
101
  basename = props.basename;
102
102
 
103
103
  var _useState = (0, _react.useState)(null),
@@ -110,13 +110,13 @@ function createApplication(loader) {
110
110
  setError = _useState4[1];
111
111
 
112
112
  var appRef = (0, _react.useRef)(undefined);
113
- var $puppeteer = (0, _react.useRef)(puppeteer);
113
+ var $syncHistory = (0, _react.useRef)(syncHistory);
114
114
  var $basename = (0, _react.useRef)(basename);
115
115
  var tagName = (0, _utils.normalizeName)(props.name);
116
- $puppeteer.current = puppeteer;
116
+ $syncHistory.current = syncHistory;
117
117
  $basename.current = basename; // 受控模式锁定一些参数
118
118
 
119
- if ($puppeteer.current) {
119
+ if ($syncHistory.current) {
120
120
  // 禁止子应用和 consoleBase 通信
121
121
  customProps.consoleBase = null; // 覆写 path 参数,用于通知子应用更新路由
122
122
 
@@ -270,7 +270,7 @@ function createApplication(loader) {
270
270
 
271
271
  if (frameWindow) {
272
272
  frameWindow.history.pushState = function (data, unused, _url) {
273
- if ($puppeteer.current) {
273
+ if ($syncHistory.current) {
274
274
  var nextPath = addBasename((_url === null || _url === void 0 ? void 0 : _url.toString()) || '', $basename.current);
275
275
 
276
276
  if ("".concat(nextPath) !== peelPath(window.location)) {
@@ -286,7 +286,7 @@ function createApplication(loader) {
286
286
  frameWindow.history.replaceState = function (data, unused, _url) {
287
287
  var nextPath = addBasename((_url === null || _url === void 0 ? void 0 : _url.toString()) || '', $basename.current);
288
288
 
289
- if ($puppeteer.current) {
289
+ if ($syncHistory.current) {
290
290
  window.history.replaceState(data, unused, nextPath);
291
291
  }
292
292
 
package/lib/version.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- var version = '1.4.30-alpha.7';
7
+ var version = '1.4.30-alpha.8';
8
8
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-react",
3
- "version": "1.4.30-alpha.7",
3
+ "version": "1.4.30-alpha.8",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -5,7 +5,7 @@ interface IProps {
5
5
  * @deprecated
6
6
  */
7
7
  sandbox: Record<string, any>;
8
- puppeteer?: boolean;
8
+ syncHistory?: boolean;
9
9
  basename?: string;
10
10
  history?: any;
11
11
  path?: string;
@@ -3,9 +3,8 @@ import { BaseLoader } from '@alicloud/alfa-core';
3
3
  import { AlfaFactoryOption } from './types';
4
4
  interface IProps<C = any> extends AlfaFactoryOption {
5
5
  customProps: C;
6
- puppeteer?: boolean;
6
+ syncHistory?: boolean;
7
7
  basename?: string;
8
- path?: string;
9
8
  }
10
9
  /**
11
10
  * container for microApp mount
@@ -1 +1 @@
1
- export declare const version = "1.4.30-alpha.7";
1
+ export declare const version = "1.4.30-alpha.8";