Skip to content

Commit 3c77855

Browse files
committed
chore(build): Remove .es6 files which shadow .ts files.
This removes .es6 files which are pure duplicates of a .ts file in the same folder. Next we need to remove .js files as well, and remove karma preprocessors for dart.
1 parent c157922 commit 3c77855

24 files changed

+45
-870
lines changed

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ gulp.task('build.js.cjs', ['build.tools'], function() {
568568
var bundleConfig = {
569569
paths: {
570570
"*": "dist/js/prod/es6/*.es6",
571-
"rx/*": "node_modules/rx/*.js"
571+
"rx": "node_modules/rx/dist/rx.js"
572572
},
573573
meta: {
574574
// auto-detection fails to detect properly here - https://github.com/systemjs/builder/issues/123

karma-dart.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ module.exports = function(config) {
6161

6262
preprocessors: {
6363
'modules/**/*.js': ['ts2dart'],
64+
'modules/angular2/src/reflection/reflector.ts': ['ts2dart'],
6465
'tools/**/*.js': ['ts2dart']
6566
},
6667

6768
ts2dartPreprocessor: {
6869
resolveModuleName: file2moduleName,
6970
transformPath: function(fileName) {
70-
return fileName.replace(/.js$/, '.dart');
71+
return fileName.replace(/\.(js|ts)$/, '.dart');
7172
}
7273
},
7374

karma-js.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function(config) {
1818
'node_modules/systemjs/dist/system.src.js',
1919
'node_modules/systemjs/lib/extension-register.js',
2020
'node_modules/systemjs/lib/extension-cjs.js',
21-
'node_modules/rx/dist/rx.all.js',
21+
'node_modules/rx/dist/rx.js',
2222
'node_modules/reflect-metadata/Reflect.js',
2323
'node_modules/zone.js/zone.js',
2424
'node_modules/zone.js/long-stack-trace-zone.js',

modules/angular2/src/facade/async.es6

Lines changed: 0 additions & 126 deletions
This file was deleted.

modules/angular2/src/facade/async.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,23 @@ export class Observable {
7878
*/
7979
export class EventEmitter extends Observable {
8080
_subject: Rx.Subject<any>;
81+
_immediateScheduler;
8182

8283
constructor() {
8384
super();
84-
this._subject = new Rx.Subject<any>();
85+
86+
// System creates a different object for import * than Typescript es5 emit.
87+
if (Rx.hasOwnProperty('default')) {
88+
this._subject = new (<any>Rx).default.Rx.Subject();
89+
this._immediateScheduler = (<any>Rx).default.Rx.Scheduler.immediate;
90+
} else {
91+
this._subject = new Rx.Subject<any>();
92+
this._immediateScheduler = (<any>Rx.Scheduler).immediate;
93+
}
8594
}
8695

8796
observer(generator) {
88-
var immediateScheduler = (<any>Rx.Scheduler).immediate;
89-
return this._subject.observeOn(immediateScheduler)
97+
return this._subject.observeOn(this._immediateScheduler)
9098
.subscribe((value) => { setTimeout(() => generator.next(value)); },
9199
(error) => generator.throw ? generator.throw(error) : null,
92100
() => generator.return ? generator.return () : null);

modules/angular2/src/facade/browser.es6

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)