efront 4.0.11 → 4.0.15
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/#/345/233/275/351/231/205/345/214/226.yml +638 -47
- package/{docs → apps}/drequest/index.html +11 -1
- package/{docs → apps}/drequest/main.js +5 -5
- package/coms/basic/#loader.js +2 -1
- package/coms/basic/YAML.js +3 -3
- package/coms/basic/parseYML.js +4 -1
- package/coms/basic/parseYML_test.js +3 -1
- package/coms/basic/strings.js +22 -15
- package/coms/basic_/readme-en.md +112 -0
- package/coms/basic_/readme.md +1 -1
- package/coms/compile/Javascript.js +4 -2
- package/coms/compile/Program.js +0 -2
- package/coms/compile/common.js +1 -0
- package/coms/compile/downLevel.js +8 -4
- package/coms/compile/translate.js +3 -3
- package/coms/compile/unstruct.js +107 -67
- package/coms/compile/unstruct_test.js +6 -2
- package/coms/docs/helps.js +69 -65
- package/coms/zimoli/data.js +10 -10
- package/coms/zimoli/table.html +4 -4
- package/docs/compare-en.md +327 -0
- package/docs/components.jsp +1 -1
- package/docs/main.xht +18 -18
- package/docs/version-desc.md +11 -0
- package/docs/welcome.jsp +1 -1
- package/docs//345/221/275/344/273/244.xht +12 -6
- package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +54 -53
- package/docs//345/267/245/345/205/267//345/255/227/347/254/246/351/233/206/346/243/200/346/237/245.xht +7 -7
- package/docs//347/273/204/344/273/266.xht +12 -12
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/readme-en.md +168 -0
- package/readme.md +16 -7
- package/_envs/setup.bat +0 -10
- package/apis/zimoli/file/checkPermission.js +0 -10
- package/apis/zimoli/file/info.js +0 -68
- package/apis/zimoli/file/root.js +0 -2
- package/apis/zimoli/server/count.js +0 -4
- package/apis/zimoli/user/login.js +0 -12
- package/apis/zimoli/yuanfen/suggest.js +0 -8
- package/coms/zimoli/editor.js +0 -85
- package/coms/zimoli/editor.less +0 -64
- package/data/i18n/zh-cn.json +0 -21
- package/docs/canvas/main.js +0 -5
- package/docs/compare/index.html +0 -14
- package/docs/compare/main.js +0 -7
- package/docs/editor/index.html +0 -30
- package/docs/editor/main.js +0 -5
- package/docs/editor/main.less +0 -0
- /package/{docs → apps}/sample/mycolor.html +0 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# efront vs. angular/react/vue
|
|
2
|
+
|
|
3
|
+
* `efront` is a development environment, not a dependency library. Additionally, `efront` provides a browser mode component library called 'zimoli', which is provided in a discrete functionality manner and allows for but does not enforce the use of any item.
|
|
4
|
+
|
|
5
|
+
* Here we only present the facts and do not make any evaluations. The behavior of a certain official "belittling others and elevating oneself" is not criticized by efront.
|
|
6
|
+
* For the comparison of the web section in the following text, use the `zimoli` component library in the efront environment as a reference
|
|
7
|
+
|
|
8
|
+
## 表面参数对比
|
|
9
|
+
|
|
10
|
+
| Comparison item\framework | efront/(zimoli) | angular | react | vue |
|
|
11
|
+
| -------------------- | --------------------------------------------------------------------------- | ---------------------------------- | -------------------------------- | ------------------------------ |
|
|
12
|
+
| Hello World object code | ≈1kb; | >30kb | >30kb | ≈30kb; |
|
|
13
|
+
| Development environment startup time | ≈0s; | >2s | >2s | >2s |
|
|
14
|
+
| development language | js/html/less | ts/html/less/sass/scss | jsx/css/js/ts/html | html/css/js |
|
|
15
|
+
| Export Component Dependencies | 无 | angular | react | vue |
|
|
16
|
+
| Official routing | zimoli,No need to register a path before use | angular-router, Path registration is required before use | react-router, Path registration is required before use | vue-router, Path registration is required before use |
|
|
17
|
+
| Cross domain implementation | Built in development environment | Configure browser or server | Configure browser or server | Configure browser or server |
|
|
18
|
+
| Code loading scheme | Dependency loading/Automatic preloading/Manual preloading`preapre('/page/path');` / Load on dynamic path access | One load/Or load on access | One load/Or load on access | One load/Or load on access |
|
|
19
|
+
| Jump to pass parameters | `go`(pagepath, params) | ignore | ignore | ignore |
|
|
20
|
+
| Asynchronous Object Parameter Transfer | `cast`(target, data) 
 `care`(target, handle) | ignore | ignore | ignore |
|
|
21
|
+
|
|
22
|
+
## Architecture Comparison
|
|
23
|
+
|
|
24
|
+
### 1. efront/zimoli
|
|
25
|
+
|
|
26
|
+
In the efront environment, users directly operate or create dom elements in an isolated environment, and zimoli/render is responsible for assembly and binding between elements.
|
|
27
|
+
|
|
28
|
+
### 2. angular 1~9
|
|
29
|
+
|
|
30
|
+
Angular1 isolates the view and logic, and JS can update the view by updating the data on the scope. The user's input on the view can be automatically synchronized to the scope through binding relationships. Angular2+abstracts the scope as an instance of a class in typescript, and its actual purpose remains unchanged. Angular's own logic maintains the binding relationship between data and views.
|
|
31
|
+
|
|
32
|
+
### 3. react
|
|
33
|
+
|
|
34
|
+
React maintains synchronization with the view through the virtual dom. Before each rendering, the virtual dom is reconstructed through user logic, while React maintains synchronization between the virtual dom and the view.
|
|
35
|
+
|
|
36
|
+
### 4. vue
|
|
37
|
+
|
|
38
|
+
Vue uses Object. defineProperty for data binding, which is different from the mechanism of event binding in regular, but it also isolates views from logic and maintains the binding relationship between data and views.
|
|
39
|
+
|
|
40
|
+
## grammatical comparison
|
|
41
|
+
|
|
42
|
+
### 1. conditional construct
|
|
43
|
+
|
|
44
|
+
```xml
|
|
45
|
+
<!-- efront/(zimoli) with render(element,scope) -->
|
|
46
|
+
<component1 ng-if="expression"> </component1>
|
|
47
|
+
<!-- or -->
|
|
48
|
+
<component1 v-if="expression"> </component1>
|
|
49
|
+
<!-- Or any prefix -->
|
|
50
|
+
<component1 x-if="expression"> </component1>
|
|
51
|
+
<!-- In the following text, the prefix can be modified for the prefix that starts with 'ng-' -->
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```xml
|
|
55
|
+
<!-- angular 1.x -->
|
|
56
|
+
<component1 ng-if="expression" ></component1>
|
|
57
|
+
<!-- angular 2+ -->
|
|
58
|
+
<component1 *ngIf="expression" ></component1>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
// react render() Using jsx syntax in
|
|
63
|
+
render(){
|
|
64
|
+
return expression ? <Component1></Component1> : null
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```xml
|
|
69
|
+
<!-- vue Start with 'v-' -->
|
|
70
|
+
<component1 v-if="expression"></component1>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 2. 循环结构
|
|
74
|
+
|
|
75
|
+
```xml
|
|
76
|
+
<!-- efront/(zimoli) with render(element,scope) -->
|
|
77
|
+
<component1 ng-repeat="(item,index) in expression"></component1>
|
|
78
|
+
<component1 v-for="(item,index) in expression"></component1>
|
|
79
|
+
<component1 ng-repeat="item in expression"></component1>
|
|
80
|
+
<component1 v-for="item in expression"></component1>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```xml
|
|
84
|
+
<!-- angular 1.x -->
|
|
85
|
+
<component1 ng-repeat="(item,index) in expression" ></component1>
|
|
86
|
+
<!-- angular 1.x -->
|
|
87
|
+
<component1 ng-repeat="item in expression" ></component1>
|
|
88
|
+
<!-- angular 2+ structural grammar -->
|
|
89
|
+
<component1 *ngFor="let item of expression;let index=index" ></component1>
|
|
90
|
+
<!-- angular 2+ directive syntax -->
|
|
91
|
+
<component1 ngFor [ngForOf]="expression" let-item let-index></component1>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```jsx
|
|
95
|
+
// react render() Using map syntax in
|
|
96
|
+
render(){
|
|
97
|
+
return expression.map((item,index)=><Copoment1></Component1>)
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```xml
|
|
102
|
+
<!-- vue Start with 'v-' -->
|
|
103
|
+
<component1 v-for="(item,index) in expression"></component1>
|
|
104
|
+
<!-- vue Start with 'v-' -->
|
|
105
|
+
<component1 v-for="item in expression"></component1>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 3. Data binding
|
|
109
|
+
|
|
110
|
+
```xml
|
|
111
|
+
<!-- efront/(zimoli) with render(element,scope) -->
|
|
112
|
+
<component1 ng-bind="expression"></component1>
|
|
113
|
+
<!-- efront/(zimoli) with render(element,scope) Set JS object properties element[key]=value -->
|
|
114
|
+
<image _src="expression" />
|
|
115
|
+
<image .src="expression" />
|
|
116
|
+
<image :src="expression" />
|
|
117
|
+
<!-- efront/(zimoli) with render(element,scope) Set Element Attributes element.setAttribute(key,value) -->
|
|
118
|
+
<image src_="expression" />
|
|
119
|
+
<image src.="expression" />
|
|
120
|
+
<image src:="expression" />
|
|
121
|
+
<image src@="expression" />
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
```xml
|
|
125
|
+
<!-- angular 1.x -->
|
|
126
|
+
<component1 ng-bind="expression" ></component1>
|
|
127
|
+
<image ng-src="expression" />
|
|
128
|
+
<!-- angular 2+ -->
|
|
129
|
+
<component1 [innerText]="expression" ></component1>
|
|
130
|
+
<image [src]="expression" />
|
|
131
|
+
<!-- angular 1+ -->
|
|
132
|
+
<component1 >{{expression}}</component1>
|
|
133
|
+
<image src="{{expression}}" />
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```jsx
|
|
137
|
+
// react render() Using jsx syntax
|
|
138
|
+
render(){
|
|
139
|
+
return <Component1> { expression } </Component1>
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```xml
|
|
144
|
+
<!-- vueStart with 'v-' -->
|
|
145
|
+
<component1 >{{expression}}</component1>
|
|
146
|
+
<image v-bind:src="expression" />
|
|
147
|
+
<image :src="expression" />
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 4. two-way/reverse/Event binding
|
|
151
|
+
|
|
152
|
+
```xml
|
|
153
|
+
<!-- efront/(zimoli) with render(element,scope) -->
|
|
154
|
+
<component1 ng-model="expression"></component1>
|
|
155
|
+
<component1 ng-click="expression"></component1>
|
|
156
|
+
<component1 @click="expression"></component1>
|
|
157
|
+
<component1 v-on:click="expression"></component1>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
```xml
|
|
162
|
+
<!-- angular 1.x -->
|
|
163
|
+
<input ng-model="expression" />
|
|
164
|
+
<button ng-click="expression" ></button>
|
|
165
|
+
<!-- angular 2+ -->
|
|
166
|
+
<component1 [(ngModel)]="expression" ></component1>
|
|
167
|
+
<component1 (click)="expression" ></component1>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
```jsx
|
|
171
|
+
// react render() Using jsx syntax
|
|
172
|
+
render(){
|
|
173
|
+
return <Component1 onClick={expression}> </Component1>
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
```xml
|
|
178
|
+
<!-- vue Start with 'v-' -->
|
|
179
|
+
<component1 v-model="expression" ></component1>
|
|
180
|
+
<component1 v-on:click="expression" ></component1>
|
|
181
|
+
<component1 @click="expression" ></component1>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 5. Define web components
|
|
185
|
+
|
|
186
|
+
```javascript
|
|
187
|
+
// efront/(zimoli) with render(element,scope)
|
|
188
|
+
|
|
189
|
+
var htmlFileData={toString(){
|
|
190
|
+
// If there is an HTML file with the same name, similar code will be automatically generated
|
|
191
|
+
// The one-time binding before rendering can be done here
|
|
192
|
+
return `<btn>${i18n`Content`}</btn>`;
|
|
193
|
+
}};
|
|
194
|
+
|
|
195
|
+
function main(elem){
|
|
196
|
+
// Construction method
|
|
197
|
+
// You can use mounted or unmounted elements
|
|
198
|
+
// You can use the incoming element or create a new one;
|
|
199
|
+
elem = elem || document.createElement("div");
|
|
200
|
+
elem.innerHTML = htmlFileData;
|
|
201
|
+
onappend(elem,function(event){
|
|
202
|
+
// Triggered after mounting, can be bound if necessary
|
|
203
|
+
});
|
|
204
|
+
onremove(elem,function(event){
|
|
205
|
+
// Remove the previous trigger and bind it if necessary
|
|
206
|
+
});
|
|
207
|
+
watch(elem, {
|
|
208
|
+
// `propname` Refers to the propname in<element: propname=propvalue></element>
|
|
209
|
+
propname(current_value, previous_value){
|
|
210
|
+
// Tasks after parameter changes
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
var scope = {
|
|
214
|
+
// The content used in the HTML should appear here
|
|
215
|
+
btn: button, // Internal components can be renamed before rendering to simplify tagName in HTML and facilitate writing and reading in local contexts
|
|
216
|
+
};
|
|
217
|
+
render(elem,scope);// If not used, export native components
|
|
218
|
+
// If there is a less file with the same name, it will be automatically bound during compilation
|
|
219
|
+
return elem //If not transmitted, the original elements will not be replaced
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
// angular 1.x
|
|
225
|
+
var app=angular.module("modulename");
|
|
226
|
+
app.directive("component-name",[
|
|
227
|
+
"$rootScope",//依赖项
|
|
228
|
+
function($rootScope){
|
|
229
|
+
return {
|
|
230
|
+
restrict: 'E',//Element
|
|
231
|
+
restrict: 'A',//Attribute
|
|
232
|
+
transclude: true,// Content
|
|
233
|
+
replace: true,
|
|
234
|
+
template:"<template-string></template-string>",
|
|
235
|
+
template:function(elem,attr){//Template construction method
|
|
236
|
+
},
|
|
237
|
+
templateUrl:"...",
|
|
238
|
+
scope:{//Private parameters
|
|
239
|
+
paramKey1:"=",//two way
|
|
240
|
+
paramKey1:"=?",//No reverse is possible
|
|
241
|
+
paramKey1:"@",//String parameter
|
|
242
|
+
},
|
|
243
|
+
compile(elem,attr,trans){
|
|
244
|
+
//Custom compiler
|
|
245
|
+
return function(scope,elem,attr,ctrl,transclude){};
|
|
246
|
+
},
|
|
247
|
+
link(scope,elem,attr,ctr,transclude){
|
|
248
|
+
// Compiler's lower level methods
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}]);
|
|
252
|
+
// angular 2+
|
|
253
|
+
@Component({
|
|
254
|
+
template:'',
|
|
255
|
+
templateUrl:'',
|
|
256
|
+
stylesUrl:[],
|
|
257
|
+
styles:[],
|
|
258
|
+
})
|
|
259
|
+
class ComponentName implements OnChanges,AfterViewInit,OnInit,OnDestroy{
|
|
260
|
+
@Input() params1;
|
|
261
|
+
@Input() params2;
|
|
262
|
+
@Output() event1;
|
|
263
|
+
@Output() event2;
|
|
264
|
+
constructor(){
|
|
265
|
+
}
|
|
266
|
+
ngOnInit(){
|
|
267
|
+
// initialization
|
|
268
|
+
}
|
|
269
|
+
ngOnDestroy(){
|
|
270
|
+
// Destruction
|
|
271
|
+
}
|
|
272
|
+
ngOnChanges(){
|
|
273
|
+
// Triggered when parameter changes
|
|
274
|
+
}
|
|
275
|
+
ngAfterViewInit(){
|
|
276
|
+
// Trigger after rendering is completed
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
```jsx
|
|
282
|
+
// react render() Using jsx syntax
|
|
283
|
+
import React, { Component } from 'react';
|
|
284
|
+
import { render } from 'react-dom';
|
|
285
|
+
|
|
286
|
+
class ComponentName extends Component {
|
|
287
|
+
constructor(props){}
|
|
288
|
+
componentWillMount(){}
|
|
289
|
+
componentDidMount(){}
|
|
290
|
+
componentWillReceiveProps(){}
|
|
291
|
+
shouldComponentUpdate(){}
|
|
292
|
+
componentWillUpdate(){}
|
|
293
|
+
componentDidUpdate(){}
|
|
294
|
+
componentWillUnmount(){}
|
|
295
|
+
render() {
|
|
296
|
+
return <div>Hello {this.props.name}</div>;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
```html
|
|
302
|
+
<!-- vue -->
|
|
303
|
+
<template>
|
|
304
|
+
<component></component>
|
|
305
|
+
</template>
|
|
306
|
+
<script>
|
|
307
|
+
var component = {
|
|
308
|
+
created(){},
|
|
309
|
+
mounted(){},
|
|
310
|
+
beforeDestroy(){},
|
|
311
|
+
destroyed(){},
|
|
312
|
+
render(){},
|
|
313
|
+
data(){
|
|
314
|
+
return {};
|
|
315
|
+
},
|
|
316
|
+
props:{},
|
|
317
|
+
watch:{},
|
|
318
|
+
methods:{},
|
|
319
|
+
components:{
|
|
320
|
+
component:compoment1
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
export default component;
|
|
324
|
+
</script>
|
|
325
|
+
<style></style>
|
|
326
|
+
```
|
|
327
|
+
|
package/docs/components.jsp
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
var basepath = path.join(String(__efront), 'coms');
|
|
7
7
|
if (req.id) {
|
|
8
8
|
var compath = path.join(basepath, req.id);
|
|
9
|
-
if (!comm_file_reg.test(req.id) || !/^\.\./.test(path.relative(compath, basepath))) return forbidden("
|
|
9
|
+
if (!comm_file_reg.test(req.id) || !/^\.\./.test(path.relative(compath, basepath))) return forbidden(i18n[req.headers["accept-language"]]`禁止访问`);
|
|
10
10
|
return fs.readFile(compath);
|
|
11
11
|
}
|
|
12
12
|
|
package/docs/main.xht
CHANGED
|
@@ -77,27 +77,27 @@
|
|
|
77
77
|
<script>
|
|
78
78
|
var menus = [
|
|
79
79
|
{
|
|
80
|
-
name:
|
|
80
|
+
name: i18n`efront简介`,
|
|
81
81
|
children: [
|
|
82
|
-
{ name:
|
|
83
|
-
{ name:
|
|
84
|
-
{ name:
|
|
85
|
-
{ name:
|
|
86
|
-
// { name:
|
|
82
|
+
{ name: i18n`使用说明`, md: i18n`readme.md` },
|
|
83
|
+
{ name: i18n`兼容性说明`, md: i18n`coms/basic_/readme.md` },
|
|
84
|
+
{ name: i18n`版本说明`, md: i18n`docs/版本说明.md` },
|
|
85
|
+
{ name: i18n`与前端框架对比`, md: i18n`docs/compare.md` },
|
|
86
|
+
// { name: i18n`notive`, md: "docs/notive.md" },
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
|
-
name:
|
|
90
|
+
name: i18n`组件库`,
|
|
91
91
|
closed: true,
|
|
92
92
|
children: []
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
name:
|
|
95
|
+
name: i18n`小工具`,
|
|
96
96
|
closed: true,
|
|
97
97
|
children: [
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
]
|
|
98
|
+
{ name: i18n`字符集检查`, path: "/工具/字符集检查" },
|
|
99
|
+
{ name: i18n`国际化`, path: "/工具/国际化" }
|
|
100
|
+
]
|
|
101
101
|
}
|
|
102
102
|
];
|
|
103
103
|
zimoli.register("/mark");
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
if (!window.require) return;
|
|
108
108
|
return menuList(null, [
|
|
109
109
|
{
|
|
110
|
-
"name":
|
|
110
|
+
"name": i18n`开发者选项`,
|
|
111
111
|
do() {
|
|
112
112
|
window.require("electron").ipcRenderer.send("window", "open-dev-tools");
|
|
113
113
|
window.resizeBy(400, 0);
|
|
@@ -123,14 +123,14 @@
|
|
|
123
123
|
var initCommandsDocs = async function () {
|
|
124
124
|
var helps = await init("docs$helps");
|
|
125
125
|
var m = {
|
|
126
|
-
name:
|
|
126
|
+
name: i18n`命令参考`,
|
|
127
127
|
closed: true,
|
|
128
128
|
children: [
|
|
129
|
-
{ name:
|
|
130
|
-
{ name:
|
|
131
|
-
{ name:
|
|
132
|
-
{ name:
|
|
133
|
-
{ name:
|
|
129
|
+
{ name: i18n`防御系`, a: "f" },
|
|
130
|
+
{ name: i18n`强攻系`, a: "q" },
|
|
131
|
+
{ name: i18n`辅助系`, a: "z" },
|
|
132
|
+
{ name: i18n`控制系`, a: "k" },
|
|
133
|
+
{ name: i18n`暗器系`, a: "a" }
|
|
134
134
|
]
|
|
135
135
|
};
|
|
136
136
|
m.children.forEach(a => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
`efront` is a growing project with many incomplete features and areas for optimization. So far, there have been three major versions of updates and many minor revisions. Currently, `efront` does not provide detailed release instructions for each small version. You can refer to the code [submit logs](https://github.com/yunxu1019/efront/commits/develop) to view the updated content in.
|
|
2
|
+
|
|
3
|
+
# The update instructions for the major version are as follows:
|
|
4
|
+
|
|
5
|
+
1.x `efront` is released in source code format, mainly relying on `esprima`, `esmangle`, `escodegen`, `pngjs`, `less node`, and `typescript` to provide compilation support
|
|
6
|
+
|
|
7
|
+
2.x `efront` is published in a self compiled format
|
|
8
|
+
|
|
9
|
+
3.x With a self built grammar parser, `efront` no longer relies on `esprima`, `esmangle`, and `escodegen`. The self compilation time has gradually decreased from the original 10 minute Github workflow to about 2 minutes.
|
|
10
|
+
|
|
11
|
+
4.0 No longer relying on `typescript` (nearly 170000 lines of source code), the compilation speed has increased by four times, the memory usage has been reduced to 1/8 of the original, and the self compilation time on GitHub has also been reduced to about 15 seconds.
|
package/docs/welcome.jsp
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
__efront = String(__efront);
|
|
3
3
|
var fullpath = path.join(__efront, req.id);
|
|
4
4
|
if (!/^\.\./.test(path.relative(fullpath, __efront)) || !/\.md$/.test(req.id)) {
|
|
5
|
-
return forbidden("
|
|
5
|
+
return forbidden(i18n[req.headers["accept-language"]]`禁止访问!`);
|
|
6
6
|
}
|
|
7
7
|
return fs.promises.readFile(fullpath);
|
|
8
8
|
</script>
|
|
@@ -34,9 +34,11 @@
|
|
|
34
34
|
color: #fff;
|
|
35
35
|
padding: 10px 16px;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
[body] {
|
|
38
39
|
background: #222;
|
|
39
40
|
}
|
|
41
|
+
|
|
40
42
|
:scope {
|
|
41
43
|
height: 100%;
|
|
42
44
|
width: 100%;
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
</style>
|
|
56
58
|
<h2 head -bind="help?.info"></h2>
|
|
57
59
|
<div body>
|
|
58
|
-
<div
|
|
60
|
+
<div>${i18n`可以使用的命令有:`}</div>
|
|
59
61
|
<m -repeat="c in help?.cmds">
|
|
60
62
|
<cmds></cmds>
|
|
61
63
|
<topic></topic>
|
|
@@ -82,10 +84,14 @@
|
|
|
82
84
|
});
|
|
83
85
|
},
|
|
84
86
|
topic(elem, s) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
var topics = s.topics.filter(a => scope.dict[a]);
|
|
88
|
+
if (!topics.length) return;
|
|
89
|
+
elem.innerHTML = i18n`其中,` + topics.map(a => {
|
|
90
|
+
var d = scope.dict[a];
|
|
91
|
+
var t = i18n`${a}是${d[0]}`;
|
|
92
|
+
if (d.length > 1) t += i18n`,可取值有${d.slice(1).join('、')}`;
|
|
93
|
+
if (d.default) t += i18n`,默认值是${d.default}`;
|
|
94
|
+
return t;
|
|
89
95
|
}).join(';');
|
|
90
96
|
}
|
|
91
97
|
}
|