Skip to content

Commit

Permalink
feat: removed Rax packages, discontinuing support for Rax
Browse files Browse the repository at this point in the history
  • Loading branch information
liujuping committed Jan 5, 2024
1 parent ba53d6c commit b9a7092
Show file tree
Hide file tree
Showing 58 changed files with 24 additions and 2,819 deletions.
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
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.

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

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.
54 changes: 0 additions & 54 deletions packages/rax-renderer/package.json

This file was deleted.

Loading

0 comments on commit b9a7092

Please sign in to comment.