Skip to content

Commit 7fb95be

Browse files
committed
Merge branch 'angular-v7.0' of https://github.com/trotyl/js-framework-benchmark into trotyl-angular-v7.0
2 parents 8344bc3 + ee9e19f commit 7fb95be

36 files changed

+184
-367
lines changed

frameworks/keyed/angular-ivy/closure.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ node_modules/zone.js/dist/zone_externs.js
3333
--js node_modules/@angular/common/package.json
3434
--js node_modules/@angular/common/fesm2015/common.js
3535

36+
--js node_modules/@angular/compiler/package.json
37+
--js node_modules/@angular/compiler/fesm2015/compiler.js
38+
3639
--js node_modules/@angular/platform-browser/package.json
3740
--js node_modules/@angular/platform-browser/fesm2015/platform-browser.js
3841

frameworks/keyed/angular-ivy/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
</head>
99

1010
<body>
11-
12-
<body>
13-
<my-app></my-app>
14-
<script type="text/javascript" src="dist/bundle.js"></script>
15-
</body>
11+
<my-app></my-app>
12+
<script type="text/javascript" src="dist/bundle.js"></script>
13+
</body>
1614

1715
</html>

frameworks/keyed/angular-ivy/package.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,40 @@
66
"frameworkVersionFromPackage": "@angular/core"
77
},
88
"scripts": {
9+
"postinstall": "ivy-ngcc && bash ./workaround.sh",
910
"start": "echo 'please start in root project'",
1011
"test": "karma start",
1112
"prengc": "rimraf tmp",
1213
"ngc": "ngc -p tsconfig.json",
1314
"preclosure": "rimraf dist",
1415
"closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf",
15-
"build-prod": "npm run ngc && npm run closure",
16+
"build-prod-failed": "npm run ngc && npm run closure",
1617
"rollup": "rollup -c rollup.config.js",
17-
"build-dev": "npm run ngc && npm run rollup"
18+
"build-prod": "npm run ngc && npm run rollup"
1819
},
1920
"license": "MIT",
2021
"dependencies": {
21-
"@angular/common": "6.1.0",
22-
"@angular/compiler": "6.1.0",
23-
"@angular/compiler-cli": "6.1.0",
24-
"@angular/core": "6.1.0",
25-
"@angular/platform-browser": "6.1.0",
22+
"@angular/common": "7.0.0",
23+
"@angular/compiler": "7.0.0",
24+
"@angular/compiler-cli": "7.0.0",
25+
"@angular/core": "7.0.0",
26+
"@angular/platform-browser": "7.0.0",
2627
"core-js": "2.5.7",
27-
"rxjs": "6.2.2",
28+
"rxjs": "6.3.3",
2829
"tslib": "1.9.3",
2930
"zone.js": "0.8.26"
3031
},
3132
"devDependencies": {
3233
"google-closure-compiler": "20180716.0.1",
3334
"http-server": "0.11.1",
3435
"rimraf": "2.5.4",
35-
"rollup": "0.55.0",
36-
"rollup-plugin-commonjs": "8.2.6",
37-
"rollup-plugin-node-resolve": "3.0.2",
38-
"rollup-plugin-uglify": "3.0.0",
39-
"typescript": "2.7.2",
36+
"rollup": "0.66.6",
37+
"rollup-plugin-alias": "^1.4.0",
38+
"rollup-plugin-node-resolve": "3.4.0",
39+
"rollup-plugin-replace": "2.1.0",
40+
"rollup-plugin-terser": "3.0.0",
41+
"rollup-plugin-uglify": "6.0.0",
42+
"typescript": "3.1.4",
4043
"yargs": "11.0.0"
4144
}
4245
}
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1+
import path from 'path';
12
import nodeResolve from 'rollup-plugin-node-resolve';
2-
import commonjs from 'rollup-plugin-commonjs';
3+
import replace from 'rollup-plugin-replace';
4+
import alias from 'rollup-plugin-alias';
5+
import { terser } from 'rollup-plugin-terser';
36

47
export default {
58
input: 'tmp/main.js',
69
output: {
710
file: 'dist/bundle.js',
811
format: 'iife',
9-
name: 'ngApp',
12+
sourcemap: true,
1013
},
1114
plugins: [
15+
alias({
16+
'@angular/compiler': path.resolve(__dirname, './tmp/empty-compiler.js'),
17+
}),
1218
nodeResolve({
13-
jsnext: true,
14-
module: true
19+
module: true,
20+
}),
21+
replace({
22+
'ngDevMode': 'false',
1523
}),
16-
commonjs(),
24+
terser(),
1725
]
18-
}
26+
}

frameworks/keyed/angular-ivy/src/app.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ɵdetectChanges as detectChanges, AfterViewChecked, Component, NgModule, VERSION } from '@angular/core';
2-
import { NgForOf } from './ng_for_of';
1+
import { ɵdetectChanges as detectChanges, AfterViewChecked, Component, NgModule, ChangeDetectorRef, VERSION } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
33

44
interface Data {
55
id: number;
@@ -32,7 +32,7 @@ let stopMeasure = function () {
3232
<div class="jumbotron">
3333
<div class="row">
3434
<div class="col-md-6">
35-
<h1>Angular v6.1.0 (ivy renderer)</h1>
35+
<h1>Angular v7.0.0 (ivy renderer)</h1>
3636
</div>
3737
<div class="col-md-6">
3838
<div class="col-sm-6 smallpad">
@@ -94,7 +94,7 @@ export class AppComponent implements AfterViewChecked {
9494
id: number = 1;
9595
backup: Array<Data> = undefined;
9696

97-
constructor() {
97+
constructor(private cdRef: ChangeDetectorRef) {
9898
console.info(VERSION.full);
9999
}
100100

@@ -125,7 +125,7 @@ export class AppComponent implements AfterViewChecked {
125125
startMeasure('select');
126126
event.preventDefault();
127127
this.selected = item.id;
128-
detectChanges(this);
128+
this.cdRef.detectChanges();
129129
}
130130

131131
delete(item: Data, event: Event) {
@@ -137,41 +137,41 @@ export class AppComponent implements AfterViewChecked {
137137
break;
138138
}
139139
}
140-
detectChanges(this);
140+
this.cdRef.detectChanges();
141141
}
142142

143143
run() {
144144
startMeasure('run');
145145
this.data = this.buildData();
146-
detectChanges(this);
146+
this.cdRef.detectChanges();
147147
}
148148

149149
add() {
150150
startMeasure('add');
151151
this.data = this.data.concat(this.buildData(1000));
152-
detectChanges(this);
152+
this.cdRef.detectChanges();
153153
}
154154

155155
update() {
156156
startMeasure('update');
157157
for (let i = 0; i < this.data.length; i += 10) {
158158
this.data[i].label += ' !!!';
159159
}
160-
detectChanges(this);
160+
this.cdRef.detectChanges();
161161
}
162162

163163
runLots() {
164164
startMeasure('runLots');
165165
this.data = this.buildData(10000);
166166
this.selected = undefined;
167-
detectChanges(this);
167+
this.cdRef.detectChanges();
168168
}
169169

170170
clear() {
171171
startMeasure('clear');
172172
this.data = [];
173173
this.selected = undefined;
174-
detectChanges(this);
174+
this.cdRef.detectChanges();
175175
}
176176

177177
swapRows() {
@@ -181,7 +181,7 @@ export class AppComponent implements AfterViewChecked {
181181
this.data[1] = this.data[998];
182182
this.data[998] = a;
183183
}
184-
detectChanges(this);
184+
this.cdRef.detectChanges();
185185
}
186186

187187
ngAfterViewChecked() {
@@ -193,8 +193,8 @@ export class AppComponent implements AfterViewChecked {
193193
Object.assign(AppComponent, { ngComponentDef: (AppComponent as any).ngComponentDef });
194194

195195
@NgModule({
196-
imports: [],
197-
declarations: [AppComponent, NgForOf],
196+
imports: [CommonModule],
197+
declarations: [AppComponent],
198198
bootstrap: [AppComponent],
199199
})
200200
export class AppModule {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Waiting for https://github.com/angular/angular/pull/26734
2+
3+
export const LiteralExpr = {}
4+
export const R3ResolvedDependencyType = {}
5+
export const WrappedNodeExpr = {}
6+
export const compileInjector = {}
7+
export const compileNgModule = {}
8+
export const jitExpression = {}
9+
export const ConstantPool = {}
10+
export const compileComponentFromMetadata = {}
11+
export const compileDirectiveFromMetadata ={}
12+
export const makeBindingParser = {}
13+
export const parseHostBindings = {}
14+
export const parseTemplate = {}
15+
export const compileInjectable = {}
16+
export const compilePipeFromMetadata = {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import './ng_dev_mode';
21
import { ɵrenderComponent as renderComponent } from '@angular/core';
32
import { AppComponent } from './app';
43

5-
renderComponent(AppComponent)
4+
renderComponent(AppComponent);

frameworks/keyed/angular-ivy/src/ng_dev_mode.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)