Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: removed Rax packages, discontinuing support for Rax #2819

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/docs/guide/appendix/npms.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ sidebar_position: 3
| @alilc/lowcode-engine | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/engine |
| @alilc/lowcode-plugin-designer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/plugin-designer |
| @alilc/lowcode-plugin-outline-pane | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/plugin-outline-pane |
| @alilc/lowcode-rax-renderer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/rax-renderer |
| @alilc/lowcode-rax-simulator-renderer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/rax-simulator-renderer |
| @alilc/lowcode-react-renderer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/react-renderer |
| @alilc/lowcode-react-simulator-renderer | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/react-simulator-renderer |
| @alilc/lowcode-renderer-core | [https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) | packages/renderer-core |
Expand Down
16 changes: 7 additions & 9 deletions docs/docs/guide/appendix/repos.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ sidebar_position: 2
5. ignitor
6. plugin-designer
7. plugin-outline-pane
8. rax-renderer
9. rax-simulator-renderer
10. react-renderer
11. react-simulator-renderer
12. renderer-core
13. types
14. utils
15. material-parser
16. code-generator
8. react-renderer
9. react-simulator-renderer
10. renderer-core
11. types
12. utils
13. material-parser
14. code-generator

## 2. 引擎官方扩展包
包含了常用的设置器(setter)、跟 setter 绑定的插件等
Expand Down
1 change: 0 additions & 1 deletion docs/docs/guide/design/renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ sidebar_position: 4
## npm 包与仓库信息

- React 框架渲染 npm 包:@alilc/lowcode-react-renderer
- Rax 框架渲染 npm 包:@alilc/lowcode-rax-renderer
- 仓库:[https://github.com/alibaba/lowcode-engine](https://github.com/alibaba/lowcode-engine) 下的
- packages/renderer-core
- packages/react-renderer
Expand Down
1 change: 0 additions & 1 deletion docs/docs/guide/expand/runtime/renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ ReactDOM.render((
), document.getElementById('root'));
```

- rax-renderer:npm 包替换为 @alilc/lowcode-rax-renderer
####
### 项目使用示例
> [设计器 demo](https://lowcode-engine.cn/demo/demo-general/index.html)
Expand Down
10 changes: 1 addition & 9 deletions docs/docs/participate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,7 @@ npm install && npm run setup
[
"https?://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/(.*)/dist/css/react-simulator-renderer.css",
"http://localhost:5555/css/ReactSimulatorRenderer.css"
],
[
"https?://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/(.*)/dist/js/rax-simulator-renderer.js",
"http://localhost:5555/js/RaxSimulatorRenderer.js"
],
[
"https?://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/(.*)/dist/css/rax-simulator-renderer.css",
"http://localhost:5555/css/RaxSimulatorRenderer.css"
],
]
]
}
```
Expand Down
1 change: 0 additions & 1 deletion docs/docs/specs/lowcode-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ try {
- 说明:组件即将从 DOM 中移除
- componentDidCatch(error, info)
- 说明:组件捕获到异常
- Rax:目前没有使用生命周期,使用 hooks 替代生命周期;

该对象由一系列 key-value 组成,key 为生命周期方法名,value 为 JSFunction 的描述,详见下方示例:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"yarn": "^1.22.17",
"rimraf": "^3.0.2",
"@types/react-router": "5.1.18",
"@alilc/build-plugin-lce": "^0.0.3",
"@alilc/build-plugin-lce": "^0.0.4",
"babel-jest": "^26.5.2",
"@alilc/lowcode-test-mate": "^1.0.1"
},
Expand Down
37 changes: 9 additions & 28 deletions packages/designer/src/builtin-simulator/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
isDragAnyObject,
isDragNodeObject,
isLocationData,
Logger,
} from '@alilc/lowcode-utils';
import {
isShaken,
Expand Down Expand Up @@ -72,6 +73,8 @@ import { IScroller } from '../designer/scroller';
import { isElementNode, isDOMNodeVisible } from '../utils/misc';
import { debounce } from 'lodash';

const logger = new Logger({ level: 'warn', bizName: 'designer' });

export type LibraryItem = IPublicTypePackage & {
package: string;
library: string;
Expand Down Expand Up @@ -122,21 +125,6 @@ const defaultSimulatorUrl = (() => {
return urls;
})();

const defaultRaxSimulatorUrl = (() => {
const publicPath = getPublicPath();
let urls;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_, prefix = '', dev] = /^(.+?)(\/js)?\/?$/.exec(publicPath) || [];
if (dev) {
urls = [`${prefix}/css/rax-simulator-renderer.css`, `${prefix}/js/rax-simulator-renderer.js`];
} else if (process.env.NODE_ENV === 'production') {
urls = [`${prefix}/rax-simulator-renderer.css`, `${prefix}/rax-simulator-renderer.js`];
} else {
urls = [`${prefix}/rax-simulator-renderer.css`, `${prefix}/rax-simulator-renderer.js`];
}
return urls;
})();

const defaultEnvironment = [
// https://g.alicdn.com/mylib/??react/16.11.0/umd/react.production.min.js,react-dom/16.8.6/umd/react-dom.production.min.js,prop-types/15.7.2/prop-types.min.js
assetItem(
Expand All @@ -151,17 +139,6 @@ const defaultEnvironment = [
),
];

const defaultRaxEnvironment = [
assetItem(
AssetType.JSText,
'window.Rax=parent.Rax;window.React=parent.React;window.ReactDOM=parent.ReactDOM;window.VisualEngineUtils=parent.VisualEngineUtils;window.VisualEngine=parent.VisualEngine',
),
assetItem(
AssetType.JSText,
'window.PropTypes=parent.PropTypes;React.PropTypes=parent.PropTypes; window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;',
),
];

export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProps> {
readonly isSimulator = true;

Expand Down Expand Up @@ -467,11 +444,15 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp

const libraryAsset: AssetList = this.buildLibrary();

if (this.renderEnv === 'rax') {
logger.error('After LowcodeEngine v1.3.0, Rax is no longer supported.');
}

const vendors = [
// required & use once
assetBundle(
this.get('environment') ||
(this.renderEnv === 'rax' ? defaultRaxEnvironment : defaultEnvironment),
defaultEnvironment,
AssetLevel.Environment,
),
// required & use once
Expand All @@ -484,7 +465,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
// required & use once
assetBundle(
this.get('simulatorUrl') ||
(this.renderEnv === 'rax' ? defaultRaxSimulatorUrl : defaultSimulatorUrl),
defaultSimulatorUrl,
AssetLevel.Runtime,
),
];
Expand Down
15 changes: 7 additions & 8 deletions packages/designer/src/designer/setting/setting-top-entry.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { IPublicTypeCustomView, IPublicModelEditor, IPublicModelSettingTopEntry } from '@alilc/lowcode-types';
import { IPublicTypeCustomView, IPublicModelEditor, IPublicModelSettingTopEntry, IPublicApiSetters } from '@alilc/lowcode-types';
import { isCustomView } from '@alilc/lowcode-utils';
import { computed, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
import { ISettingEntry } from './setting-entry-type';
import { ISettingField, SettingField } from './setting-field';
import { INode } from '../../document';
import type { IComponentMeta } from '../../component-meta';
import { IDesigner } from '../designer';
import { Setters } from '@alilc/lowcode-shell';

function generateSessionId(nodes: INode[]) {
return nodes
Expand All @@ -19,18 +18,18 @@ export interface ISettingTopEntry extends ISettingEntry, IPublicModelSettingTopE
INode,
ISettingField
> {
purge(): void;

items: Array<ISettingField | IPublicTypeCustomView>;

readonly top: ISettingTopEntry;

readonly parent: ISettingTopEntry;

readonly path: never[];

items: Array<ISettingField | IPublicTypeCustomView>;

componentMeta: IComponentMeta | null;

purge(): void;

getExtraPropValue(propName: string): void;

setExtraPropValue(propName: string, value: any): void;
Expand Down Expand Up @@ -92,7 +91,7 @@ export class SettingTopEntry implements ISettingTopEntry {

readonly designer: IDesigner | undefined;

readonly setters: Setters;
readonly setters: IPublicApiSetters;

disposeFunctions: any[] = [];

Expand All @@ -103,7 +102,7 @@ export class SettingTopEntry implements ISettingTopEntry {
this.id = generateSessionId(nodes);
this.first = nodes[0];
this.designer = this.first.document?.designer;
this.setters = editor.get('setters') as Setters;
this.setters = editor.get('setters') as IPublicApiSetters;

// setups
this.setupComponentMeta();
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const VALID_ENGINE_OPTIONS = {
},
renderEnv: {
type: 'string',
enum: ['react', 'rax', 'any string value'],
enum: ['react', 'any string value'],
default: 'react',
description: '渲染器类型',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ https://cdn.jsdelivr.net/npm/@alilc/[email protected]/dist
```

#### 方式 5:使用自有 cdn
将源码中 packages/engine/dist 和 packages/(react|rax)-simulator-renderer/dist 下的文件传至你的 cdn 提供商
将源码中 packages/engine/dist 和 packages/react-simulator-renderer/dist 下的文件传至你的 cdn 提供商

## 🔗 相关链接

Expand Down
2 changes: 1 addition & 1 deletion packages/engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ https://cdn.jsdelivr.net/npm/@alilc/[email protected]/dist
```

#### Method 5: Use your own cdn
Pass the files under packages/engine/dist and packages/(react|rax)-simulator-renderer/dist in the source code to your cdn provider
Pass the files under packages/engine/dist and packages/react-simulator-renderer/dist in the source code to your cdn provider

## 🔗 Related Links

Expand Down
3 changes: 1 addition & 2 deletions packages/ignitor/build.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"entry": {
"AliLowCodeEngine": "../engine/src/index.ts",
"ReactSimulatorRenderer": "../react-simulator-renderer/src/index.ts",
"RaxSimulatorRenderer": "../rax-simulator-renderer/src/index.ts"
"ReactSimulatorRenderer": "../react-simulator-renderer/src/index.ts"
},
"vendor": false,
"devServer": {
Expand Down
49 changes: 0 additions & 49 deletions packages/rax-renderer/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions packages/rax-renderer/build.json

This file was deleted.

35 changes: 0 additions & 35 deletions packages/rax-renderer/demo/index.jsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/rax-renderer/demo/miniapp/app.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/rax-renderer/demo/miniapp/app.json

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion packages/rax-renderer/demo/miniapp/pages/index.axml

This file was deleted.

4 changes: 0 additions & 4 deletions packages/rax-renderer/demo/miniapp/pages/index.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/rax-renderer/demo/miniapp/pages/index.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/rax-renderer/demo/wechat-miniprogram/app.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/rax-renderer/demo/wechat-miniprogram/app.json

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading