@alicloud/alfa-react 1.5.6 → 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Alibaba Cloud
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -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;
@@ -140,7 +140,7 @@ export default function createApplication(loader) {
140
140
  if ((_RISK_INFO = window.RISK_INFO) !== null && _RISK_INFO !== void 0 && _RISK_INFO.UMID) aliyunExternalsVars.push('RISK_INFO');
141
141
  if ((_um = window.um) !== null && _um !== void 0 && _um.getToken) aliyunExternalsVars.push('um');
142
142
  ['__bl', 'aplus_queue', 'goldlog_queue', 'goldlog', 'APLUS_CONFIG'].forEach(function (key) {
143
- if (window[key]) aliyunExternalsVars.push('key');
143
+ if (window[key]) aliyunExternalsVars.push(key);
144
144
  });
145
145
  return _objectSpread(_objectSpread({}, customSandbox), {}, {
146
146
  // allowResources: [
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '1.5.6';
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;
@@ -150,7 +150,7 @@ function createApplication(loader) {
150
150
  if ((_RISK_INFO = window.RISK_INFO) !== null && _RISK_INFO !== void 0 && _RISK_INFO.UMID) aliyunExternalsVars.push('RISK_INFO');
151
151
  if ((_um = window.um) !== null && _um !== void 0 && _um.getToken) aliyunExternalsVars.push('um');
152
152
  ['__bl', 'aplus_queue', 'goldlog_queue', 'goldlog', 'APLUS_CONFIG'].forEach(function (key) {
153
- if (window[key]) aliyunExternalsVars.push('key');
153
+ if (window[key]) aliyunExternalsVars.push(key);
154
154
  });
155
155
  return _objectSpread(_objectSpread({}, customSandbox), {}, {
156
156
  // allowResources: [
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.6';
7
+ var version = '1.5.8';
8
8
  exports.version = version;
package/package.json CHANGED
@@ -1,25 +1,12 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-react",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
7
7
  "types": "types/index.d.ts",
8
8
  "author": "pushiming",
9
9
  "license": "MIT",
10
- "scripts": {
11
- "prepublish": "npm run version && npm run build && npm run babel && npm run babel:esm && npm run types",
12
- "pub": "pnpm publish",
13
- "build": "breezr build --engine webpack",
14
- "babel": "breezr build --engine babel",
15
- "babel:esm": "breezr build --engine babel --es-module",
16
- "types": "tsc --emitDeclarationOnly -d --declarationDir ./types",
17
- "storybook": "breezr start-storybook",
18
- "clean": "rm -rf lib es dist types yarn.lock",
19
- "start": "breezr start-storybook",
20
- "precommit": "npm run version",
21
- "version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts"
22
- },
23
10
  "publishConfig": {
24
11
  "access": "public"
25
12
  },
@@ -44,16 +31,29 @@
44
31
  "typescript": "^4.0.0"
45
32
  },
46
33
  "dependencies": {
47
- "@alicloud/alfa-core": "^1.4.32",
48
- "@alicloud/console-os-loader": "^1.4.5",
49
34
  "@alicloud/widget-utils-console": "^0.1.6",
50
35
  "axios": "^1.4.0",
51
36
  "classnames": "^2.2.6",
52
37
  "crypto-js": "^4.1.1",
53
- "prop-types": "^15.8.1"
38
+ "prop-types": "^15.8.1",
39
+ "@alicloud/console-os-loader": "1.4.30",
40
+ "@alicloud/alfa-core": "1.4.32"
54
41
  },
55
42
  "peerDependencies": {
56
43
  "react": ">=16.0.0"
57
44
  },
58
- "gitHead": "ff9294b1d5e08b14691c8aa2bef098da2857f3df"
59
- }
45
+ "gitHead": "ff9294b1d5e08b14691c8aa2bef098da2857f3df",
46
+ "scripts": {
47
+ "prepublish": "npm run version && npm run build && npm run babel && npm run babel:esm && npm run types",
48
+ "pub": "pnpm publish",
49
+ "build": "breezr build --engine webpack",
50
+ "babel": "breezr build --engine babel",
51
+ "babel:esm": "breezr build --engine babel --es-module",
52
+ "types": "tsc --emitDeclarationOnly -d --declarationDir ./types",
53
+ "storybook": "breezr start-storybook",
54
+ "clean": "rm -rf lib es dist types yarn.lock",
55
+ "start": "breezr start-storybook",
56
+ "precommit": "npm run version",
57
+ "version": "node -p \"'export const version = \\'' + require('./package.json').version + '\\';'\" > src/version.ts && git add src/version.ts"
58
+ }
59
+ }
@@ -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.6";
1
+ export declare const version = "1.5.8";