@alicloud/alfa-react 1.5.7 → 1.5.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.
@@ -50,7 +50,7 @@ function createAlfaApp(option) {
50
50
  export function useAlfaApp(option) {
51
51
  var App = useMemo(function () {
52
52
  return createAlfaApp(option);
53
- }, []);
53
+ }, [JSON.stringify(option)]);
54
54
  return App;
55
55
  }
56
56
  export default createAlfaApp;
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '1.5.7';
1
+ export var version = '1.5.8';
@@ -61,7 +61,7 @@ function createAlfaApp(option) {
61
61
  function useAlfaApp(option) {
62
62
  var App = (0, _react.useMemo)(function () {
63
63
  return createAlfaApp(option);
64
- }, []);
64
+ }, [JSON.stringify(option)]);
65
65
  return App;
66
66
  }
67
67
  var _default = createAlfaApp;
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.5.7';
7
+ var version = '1.5.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.5.7",
3
+ "version": "1.5.8",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -36,8 +36,8 @@
36
36
  "classnames": "^2.2.6",
37
37
  "crypto-js": "^4.1.1",
38
38
  "prop-types": "^15.8.1",
39
- "@alicloud/alfa-core": "1.4.32",
40
- "@alicloud/console-os-loader": "1.4.30"
39
+ "@alicloud/console-os-loader": "1.4.30",
40
+ "@alicloud/alfa-core": "1.4.32"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": ">=16.0.0"
@@ -1,16 +1,6 @@
1
- import React from 'react';
2
- import { AlfaFactoryOption } from './types';
3
- interface IProps {
4
- /**
5
- * @deprecated
6
- */
7
- sandbox?: Record<string, any>;
8
- /**
9
- * 处理外跳链接
10
- * @param url
11
- * @returns
12
- */
13
- handleExternalLink?: (url: string) => void;
1
+ /// <reference types="react" />
2
+ import { AlfaFactoryOption, CommonProps } from './types';
3
+ interface IProps extends CommonProps {
14
4
  /**
15
5
  * 是否开启路由自动同步,需配合 basename 使用
16
6
  */
@@ -28,10 +18,6 @@ interface IProps {
28
18
  * 子应用路由
29
19
  */
30
20
  path?: string;
31
- /**
32
- * 根节点样式
33
- */
34
- style?: React.CSSProperties;
35
21
  }
36
22
  declare function createAlfaApp<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
37
23
  /**
@@ -1,16 +1,6 @@
1
- import React from 'react';
2
- import { AlfaFactoryOption } from './types';
3
- interface IProps {
4
- /**
5
- * 处理外跳链接
6
- * @param url
7
- * @returns
8
- */
9
- handleExternalLink?: (url: string) => void;
10
- /**
11
- * 根节点样式
12
- */
13
- style?: React.CSSProperties;
1
+ /// <reference types="react" />
2
+ import { AlfaFactoryOption, CommonProps } from './types';
3
+ interface IProps extends CommonProps {
14
4
  }
15
5
  declare function createAlfaWidget<P = any>(option: AlfaFactoryOption): (() => null) | ((props: P & IProps) => JSX.Element);
16
6
  /**
@@ -31,18 +31,34 @@ export interface AlfaFactoryOption extends IAppConfig {
31
31
  * 开启业务配置加载
32
32
  */
33
33
  dynamicConfig?: boolean;
34
+ /**
35
+ * @deprecated
36
+ * used in cwsWidget
37
+ */
34
38
  runtimeVersion?: string;
35
- fallbackRender?: (error: Error) => Element;
36
39
  }
37
- type OmitKeys = 'manifest';
38
- export interface WidgetFactoryOption extends Omit<AlfaFactoryOption, OmitKeys> {
39
- runtimeVersion?: string;
40
- alfaLoader?: boolean;
41
- theme?: string;
42
- central?: boolean;
43
- host?: string;
44
- configHost?: string;
40
+ export interface CommonProps {
41
+ /**
42
+ * @deprecated
43
+ */
44
+ sandbox?: Record<string, any>;
45
+ /**
46
+ * 处理外跳链接
47
+ * @param url
48
+ * @returns
49
+ */
50
+ handleExternalLink?: (url?: string) => void;
51
+ /**
52
+ * 根节点样式
53
+ */
54
+ style?: React.CSSProperties;
55
+ /**
56
+ * render when throw error
57
+ */
58
+ fallbackRender?: (error?: Error) => Element;
45
59
  }
60
+ type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;
61
+ export type MicroApplication = ThenArg<ReturnType<typeof createMicroApp>>;
46
62
  export interface AlfaEnvConfigDescriptor {
47
63
  releaseUrl: string;
48
64
  configUrl?: string;
@@ -55,6 +71,9 @@ export interface AlfaEnvConfig {
55
71
  pre: AlfaEnvConfigDescriptor;
56
72
  prod: AlfaEnvConfigDescriptor;
57
73
  }
74
+ /**
75
+ * 兼容 cws widget 的配置
76
+ */
58
77
  export interface WidgetReleaseConfig {
59
78
  [id: string]: {
60
79
  [version: string]: {
@@ -62,6 +81,15 @@ export interface WidgetReleaseConfig {
62
81
  };
63
82
  };
64
83
  }
84
+ type OmitKeys = 'manifest';
85
+ export interface WidgetFactoryOption extends Omit<AlfaFactoryOption, OmitKeys> {
86
+ runtimeVersion?: string;
87
+ alfaLoader?: boolean;
88
+ theme?: string;
89
+ central?: boolean;
90
+ host?: string;
91
+ configHost?: string;
92
+ }
65
93
  export interface WidgetCWSConfig {
66
94
  conf: {
67
95
  [channel: string]: {
@@ -98,6 +126,4 @@ export interface WidgetRuntime {
98
126
  '@ali/wind-intl/lib/withRcIntl': any;
99
127
  '@ali/widget-utils-console': any;
100
128
  }
101
- type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;
102
- export type MicroApplication = ThenArg<ReturnType<typeof createMicroApp>>;
103
129
  export {};
@@ -1 +1 @@
1
- export declare const version = "1.5.7";
1
+ export declare const version = "1.5.8";