@@ -39,6 +39,7 @@ import {
3939 isDragAnyObject ,
4040 isDragNodeObject ,
4141 isLocationData ,
42+ Logger ,
4243} from '@alilc/lowcode-utils' ;
4344import {
4445 isShaken ,
@@ -72,6 +73,8 @@ import { IScroller } from '../designer/scroller';
7273import { isElementNode , isDOMNodeVisible } from '../utils/misc' ;
7374import { debounce } from 'lodash' ;
7475
76+ const logger = new Logger ( { level : 'warn' , bizName : 'designer' } ) ;
77+
7578export type LibraryItem = IPublicTypePackage & {
7679 package : string ;
7780 library : string ;
@@ -122,21 +125,6 @@ const defaultSimulatorUrl = (() => {
122125 return urls ;
123126} ) ( ) ;
124127
125- const defaultRaxSimulatorUrl = ( ( ) => {
126- const publicPath = getPublicPath ( ) ;
127- let urls ;
128- // eslint-disable-next-line @typescript-eslint/no-unused-vars
129- const [ _ , prefix = '' , dev ] = / ^ ( .+ ?) ( \/ j s ) ? \/ ? $ / . exec ( publicPath ) || [ ] ;
130- if ( dev ) {
131- urls = [ `${ prefix } /css/rax-simulator-renderer.css` , `${ prefix } /js/rax-simulator-renderer.js` ] ;
132- } else if ( process . env . NODE_ENV === 'production' ) {
133- urls = [ `${ prefix } /rax-simulator-renderer.css` , `${ prefix } /rax-simulator-renderer.js` ] ;
134- } else {
135- urls = [ `${ prefix } /rax-simulator-renderer.css` , `${ prefix } /rax-simulator-renderer.js` ] ;
136- }
137- return urls ;
138- } ) ( ) ;
139-
140128const defaultEnvironment = [
141129 // 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
142130 assetItem (
@@ -151,17 +139,6 @@ const defaultEnvironment = [
151139 ) ,
152140] ;
153141
154- const defaultRaxEnvironment = [
155- assetItem (
156- AssetType . JSText ,
157- 'window.Rax=parent.Rax;window.React=parent.React;window.ReactDOM=parent.ReactDOM;window.VisualEngineUtils=parent.VisualEngineUtils;window.VisualEngine=parent.VisualEngine' ,
158- ) ,
159- assetItem (
160- AssetType . JSText ,
161- 'window.PropTypes=parent.PropTypes;React.PropTypes=parent.PropTypes; window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;' ,
162- ) ,
163- ] ;
164-
165142export class BuiltinSimulatorHost implements ISimulatorHost < BuiltinSimulatorProps > {
166143 readonly isSimulator = true ;
167144
@@ -467,11 +444,15 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
467444
468445 const libraryAsset : AssetList = this . buildLibrary ( ) ;
469446
447+ if ( this . renderEnv === 'rax' ) {
448+ logger . error ( 'After LowcodeEngine v1.3.0, Rax is no longer supported.' ) ;
449+ }
450+
470451 const vendors = [
471452 // required & use once
472453 assetBundle (
473454 this . get ( 'environment' ) ||
474- ( this . renderEnv === 'rax' ? defaultRaxEnvironment : defaultEnvironment ) ,
455+ defaultEnvironment ,
475456 AssetLevel . Environment ,
476457 ) ,
477458 // required & use once
@@ -484,7 +465,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
484465 // required & use once
485466 assetBundle (
486467 this . get ( 'simulatorUrl' ) ||
487- ( this . renderEnv === 'rax' ? defaultRaxSimulatorUrl : defaultSimulatorUrl ) ,
468+ defaultSimulatorUrl ,
488469 AssetLevel . Runtime ,
489470 ) ,
490471 ] ;
0 commit comments