From 174c016104d4f5d9e12123ef31d7b9f80fb9f1ff Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 30 Aug 2016 12:13:38 -0700 Subject: [PATCH] fix(bundles): correct RxJS mapping in rollup config for umd/es5 bundles --- .../@angular/common/rollup-testing.config.js | 6 ++--- modules/@angular/common/rollup.config.js | 6 ++--- .../compiler/rollup-testing.config.js | 6 ++--- modules/@angular/compiler/rollup.config.js | 6 ++--- .../@angular/core/rollup-testing.config.js | 6 ++--- modules/@angular/core/rollup.config.js | 6 ++--- modules/@angular/forms/rollup.config.js | 6 ++--- modules/@angular/forms/src/model.ts | 4 +-- .../@angular/http/rollup-testing.config.js | 8 +++--- modules/@angular/http/rollup.config.js | 6 ++--- .../rollup-testing.config.js | 6 +---- .../platform-browser-dynamic/rollup.config.js | 6 +---- .../platform-browser/rollup-testing.config.js | 6 +---- .../platform-browser/rollup.config.js | 6 +---- .../platform-server/rollup-testing.config.js | 6 +---- .../@angular/platform-server/rollup.config.js | 6 +---- .../rollup.config.js | 7 ++--- .../platform-webworker/rollup.config.js | 6 ++--- .../@angular/router/rollup-testing.config.js | 27 ++----------------- 19 files changed, 34 insertions(+), 102 deletions(-) diff --git a/modules/@angular/common/rollup-testing.config.js b/modules/@angular/common/rollup-testing.config.js index 69423c4132..3a0e5d0236 100644 --- a/modules/@angular/common/rollup-testing.config.js +++ b/modules/@angular/common/rollup-testing.config.js @@ -7,9 +7,7 @@ export default { globals: { '@angular/core': 'ng.core', '@angular/common': 'ng.common', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/Observable': 'Rx', + 'rxjs/Subject': 'Rx' } } diff --git a/modules/@angular/common/rollup.config.js b/modules/@angular/common/rollup.config.js index 8ad150cfec..0ff5c1a5df 100644 --- a/modules/@angular/common/rollup.config.js +++ b/modules/@angular/common/rollup.config.js @@ -6,9 +6,7 @@ export default { moduleName: 'ng.common', globals: { '@angular/core': 'ng.core', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/Observable': 'Rx', + 'rxjs/Subject': 'Rx' } } diff --git a/modules/@angular/compiler/rollup-testing.config.js b/modules/@angular/compiler/rollup-testing.config.js index 69d0730748..dbc0d14d4e 100644 --- a/modules/@angular/compiler/rollup-testing.config.js +++ b/modules/@angular/compiler/rollup-testing.config.js @@ -8,9 +8,7 @@ export default { '@angular/core': 'ng.core', '@angular/core/testing': 'ng.core.testing', '@angular/compiler': 'ng.compiler', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/Observable': 'Rx', + 'rxjs/Subject': 'Rx' } } diff --git a/modules/@angular/compiler/rollup.config.js b/modules/@angular/compiler/rollup.config.js index 11b0aa2ca9..3f6d445490 100644 --- a/modules/@angular/compiler/rollup.config.js +++ b/modules/@angular/compiler/rollup.config.js @@ -6,10 +6,8 @@ export default { moduleName: 'ng.compiler', globals: { '@angular/core': 'ng.core', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/Observable': 'Rx', + 'rxjs/Subject': 'Rx' }, plugins: [ // nodeResolve({ jsnext: true, main: true }), diff --git a/modules/@angular/core/rollup-testing.config.js b/modules/@angular/core/rollup-testing.config.js index 33ddb63e8f..0d150b4c92 100644 --- a/modules/@angular/core/rollup-testing.config.js +++ b/modules/@angular/core/rollup-testing.config.js @@ -6,10 +6,8 @@ export default { moduleName: 'ng.core.testing', globals: { '@angular/core': 'ng.core', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/Observable': 'Rx', + 'rxjs/Subject': 'Rx' } } diff --git a/modules/@angular/core/rollup.config.js b/modules/@angular/core/rollup.config.js index 745d563672..6e7fa74e72 100644 --- a/modules/@angular/core/rollup.config.js +++ b/modules/@angular/core/rollup.config.js @@ -5,10 +5,8 @@ export default { format: 'umd', moduleName: 'ng.core', globals: { - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/Observable': 'Rx', + 'rxjs/Subject': 'Rx' } } diff --git a/modules/@angular/forms/rollup.config.js b/modules/@angular/forms/rollup.config.js index a2dde36bda..10133a054e 100644 --- a/modules/@angular/forms/rollup.config.js +++ b/modules/@angular/forms/rollup.config.js @@ -8,9 +8,9 @@ export default { '@angular/core': 'ng.core', '@angular/common': 'ng.common', '@angular/compiler': 'ng.compiler', + 'rxjs/Observable': 'Rx', 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/observable/fromPromise': 'Rx.Observable', + 'rxjs/operator/toPromise': 'Rx.Observable.prototype' } } diff --git a/modules/@angular/forms/src/model.ts b/modules/@angular/forms/src/model.ts index 24aaffad8f..2b76958a63 100644 --- a/modules/@angular/forms/src/model.ts +++ b/modules/@angular/forms/src/model.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {PromiseObservable} from 'rxjs/observable/PromiseObservable'; +import {fromPromise} from 'rxjs/observable/fromPromise'; import {composeAsyncValidators, composeValidators} from './directives/shared'; import {AsyncValidatorFn, ValidatorFn} from './directives/validators'; @@ -63,7 +63,7 @@ function _find(control: AbstractControl, path: Array| string, del } function toObservable(r: any): Observable { - return isPromise(r) ? PromiseObservable.create(r) : r; + return isPromise(r) ? fromPromise(r) : r; } function coerceToValidator(validator: ValidatorFn | ValidatorFn[]): ValidatorFn { diff --git a/modules/@angular/http/rollup-testing.config.js b/modules/@angular/http/rollup-testing.config.js index c4c6e6862b..8ca61d2efc 100644 --- a/modules/@angular/http/rollup-testing.config.js +++ b/modules/@angular/http/rollup-testing.config.js @@ -9,11 +9,9 @@ export default { '@angular/compiler': 'ng.compiler', '@angular/platform-browser': 'ng.platformBrowser', '@angular/http': 'ng.http', - 'rxjs/Subject': 'Rx', - 'rxjs/ReplaySubject': 'Rx', 'rxjs/Observable': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/operator/take': 'Rx.Observable.prototype', + 'rxjs/ReplaySubject': 'Rx', + 'rxjs/Subject': 'Rx', + 'rxjs/operator/take': 'Rx.Observable.prototype' } } diff --git a/modules/@angular/http/rollup.config.js b/modules/@angular/http/rollup.config.js index bda3d9b701..43fbb74359 100644 --- a/modules/@angular/http/rollup.config.js +++ b/modules/@angular/http/rollup.config.js @@ -8,9 +8,7 @@ export default { '@angular/core': 'ng.core', '@angular/compiler': 'ng.compiler', '@angular/platform-browser': 'ng.platformBrowser', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/Observable': 'Rx', + 'rxjs/Subject': 'Rx' } } diff --git a/modules/@angular/platform-browser-dynamic/rollup-testing.config.js b/modules/@angular/platform-browser-dynamic/rollup-testing.config.js index 911f61cef2..c78d0a4fb9 100644 --- a/modules/@angular/platform-browser-dynamic/rollup-testing.config.js +++ b/modules/@angular/platform-browser-dynamic/rollup-testing.config.js @@ -11,10 +11,6 @@ export default { '@angular/compiler/testing': 'ng.compiler.testing', '@angular/platform-browser': 'ng.platformBrowser', '@angular/platform-browser/testing': 'ng.platformBrowser.testing', - '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic' } } diff --git a/modules/@angular/platform-browser-dynamic/rollup.config.js b/modules/@angular/platform-browser-dynamic/rollup.config.js index 03f0429b78..ef9cc3e576 100644 --- a/modules/@angular/platform-browser-dynamic/rollup.config.js +++ b/modules/@angular/platform-browser-dynamic/rollup.config.js @@ -7,10 +7,6 @@ export default { '@angular/core': 'ng.core', '@angular/common': 'ng.common', '@angular/compiler': 'ng.compiler', - '@angular/platform-browser': 'ng.platformBrowser', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + '@angular/platform-browser': 'ng.platformBrowser' } } diff --git a/modules/@angular/platform-browser/rollup-testing.config.js b/modules/@angular/platform-browser/rollup-testing.config.js index 267e10ddfd..1a04170dae 100644 --- a/modules/@angular/platform-browser/rollup-testing.config.js +++ b/modules/@angular/platform-browser/rollup-testing.config.js @@ -7,10 +7,6 @@ export default { globals: { '@angular/core': 'ng.core', '@angular/common': 'ng.common', - '@angular/platform-browser': 'ng.platformBrowser', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + '@angular/platform-browser': 'ng.platformBrowser' } } diff --git a/modules/@angular/platform-browser/rollup.config.js b/modules/@angular/platform-browser/rollup.config.js index c44d5d8b68..4e920200d5 100644 --- a/modules/@angular/platform-browser/rollup.config.js +++ b/modules/@angular/platform-browser/rollup.config.js @@ -6,10 +6,6 @@ export default { moduleName: 'ng.platformBrowser', globals: { '@angular/core': 'ng.core', - '@angular/common': 'ng.common', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + '@angular/common': 'ng.common' } } diff --git a/modules/@angular/platform-server/rollup-testing.config.js b/modules/@angular/platform-server/rollup-testing.config.js index db243a5262..8741bcaa21 100644 --- a/modules/@angular/platform-server/rollup-testing.config.js +++ b/modules/@angular/platform-server/rollup-testing.config.js @@ -11,10 +11,6 @@ export default { '@angular/compiler/testing': 'ng.compiler.testing', '@angular/platform-browser': 'ng.platformBrowser', '@angular/platform-server': 'ng.platformServer', - '@angular/platform-browser-dynamic/testing': 'ng.platformBrowserDynamic.testing', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + '@angular/platform-browser-dynamic/testing': 'ng.platformBrowserDynamic.testing' } } diff --git a/modules/@angular/platform-server/rollup.config.js b/modules/@angular/platform-server/rollup.config.js index 68ec9b71dc..345d5b3702 100644 --- a/modules/@angular/platform-server/rollup.config.js +++ b/modules/@angular/platform-server/rollup.config.js @@ -8,10 +8,6 @@ export default { '@angular/core': 'ng.core', '@angular/common': 'ng.common', '@angular/compiler': 'ng.compiler', - '@angular/platform-browser': 'ng.platformBrowser', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + '@angular/platform-browser': 'ng.platformBrowser' } } diff --git a/modules/@angular/platform-webworker-dynamic/rollup.config.js b/modules/@angular/platform-webworker-dynamic/rollup.config.js index 9f7839a3b3..407844e271 100644 --- a/modules/@angular/platform-webworker-dynamic/rollup.config.js +++ b/modules/@angular/platform-webworker-dynamic/rollup.config.js @@ -8,10 +8,7 @@ export default { '@angular/common': 'ng.common', '@angular/compiler': 'ng.compiler', '@angular/platform-browser': 'ng.platformBrowser', - '@angular/platform-webworker': 'ng.platformWebworker', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', + '@angular/platform-webworker': 'ng.platformWebworker' } } diff --git a/modules/@angular/platform-webworker/rollup.config.js b/modules/@angular/platform-webworker/rollup.config.js index 7b76392be7..cafbd1b952 100644 --- a/modules/@angular/platform-webworker/rollup.config.js +++ b/modules/@angular/platform-webworker/rollup.config.js @@ -8,9 +8,7 @@ export default { '@angular/core': 'ng.core', '@angular/common': 'ng.common', '@angular/platform-browser': 'ng.platformBrowser', - 'rxjs/Subject': 'Rx', - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/Observable': 'Rx' + 'rxjs/Observable': 'Rx', + 'rxjs/Subject': 'Rx' } } diff --git a/modules/@angular/router/rollup-testing.config.js b/modules/@angular/router/rollup-testing.config.js index 22f94e8024..329907971d 100644 --- a/modules/@angular/router/rollup-testing.config.js +++ b/modules/@angular/router/rollup-testing.config.js @@ -6,31 +6,8 @@ export default { globals: { '@angular/core': 'ng.core', '@angular/common': 'ng.common', - '@angular/compiler': 'ng.compiler', + '@angular/common/testing': 'ng.common.testing', '@angular/platform-browser': 'ng.platformBrowser', - '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic', - - 'rxjs/Observable': 'Rx', - 'rxjs/Subject': 'Rx', - 'rxjs/BehaviorSubject': 'Rx', - 'rxjs/Observer': 'Rx', - 'rxjs/Subscription': 'Rx', - - 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. - 'rxjs/add/operator/map': 'Rx.Observable.prototype', - 'rxjs/add/operator/mergeAll': 'Rx.Observable.prototype', - 'rxjs/add/operator/concatAll': 'Rx.Observable.prototype', - 'rxjs/add/operator/mergeMap': 'Rx.Observable.prototype', - 'rxjs/add/operator/reduce': 'Rx.Observable.prototype', - 'rxjs/add/operator/every': 'Rx.Observable.prototype', - 'rxjs/add/operator/first': 'Rx.Observable.prototype', - 'rxjs/add/operator/catch': 'Rx.Observable.prototype', - 'rxjs/add/operator/last': 'Rx.Observable.prototype', - 'rxjs/add/operator/toPromise': 'Rx.Observable.prototype', - 'rxjs/observable/from': 'Rx.Observable', - 'rxjs/observable/fromPromise': 'Rx.Observable', - 'rxjs/observable/forkJoin': 'Rx.Observable', - 'rxjs/observable/of': 'Rx.Observable', - 'rxjs/util/EmptyError': 'Rx.EmptyError' + '@angular/router': 'ng.router' } }