refactor(facade): use rxjs package

move to new RxJS distribution.

BREAKING CHANGE:

RxJS imports now are via `rxjs` instead of `@reactivex/rxjs`
Individual operators can be imported `import 'rxjs/operators/map'`
This commit is contained in:
Rob Wormald 2015-11-30 17:22:52 -08:00 committed by Jeremy Elbourn
parent a16ac84840
commit 5514dc19d9
16 changed files with 42 additions and 69 deletions

View File

@ -146,7 +146,7 @@ var BENCHPRESS_BUNDLE_CONFIG = {
packageJson: './dist/js/cjs/benchpress/package.json', packageJson: './dist/js/cjs/benchpress/package.json',
includes: ['angular2'], includes: ['angular2'],
excludes: ['reflect-metadata', 'selenium-webdriver', 'zone.js'], excludes: ['reflect-metadata', 'selenium-webdriver', 'zone.js'],
ignore: ['@reactivex/rxjs'], ignore: [],
dest: CONFIG.dest.benchpress_bundle dest: CONFIG.dest.benchpress_bundle
}; };
@ -815,8 +815,7 @@ gulp.task('static-checks', ['!build.tools'], function(done) {
// Make sure the two typings tests are isolated, by running this one in a tempdir // Make sure the two typings tests are isolated, by running this one in a tempdir
var tmpdir = path.join(os.tmpdir(), 'test.typings', new Date().getTime().toString()); var tmpdir = path.join(os.tmpdir(), 'test.typings', new Date().getTime().toString());
gulp.task('!pre.test.typings.layoutNodeModule', ['build.js.cjs'], function() { gulp.task('!pre.test.typings.layoutNodeModule', ['build.js.cjs'], function() {
return gulp.src(['dist/js/cjs/angular2/**/*', 'node_modules/@reactivex/rxjs/dist/cjs/**'], return gulp.src(['dist/js/cjs/angular2/**/*', 'node_modules/rxjs/**'], {base: 'dist/js/cjs'})
{base: 'dist/js/cjs'})
.pipe(gulp.dest(path.join(tmpdir, 'node_modules'))); .pipe(gulp.dest(path.join(tmpdir, 'node_modules')));
}); });
gulp.task('!pre.test.typings.copyTypingsSpec', function() { gulp.task('!pre.test.typings.copyTypingsSpec', function() {
@ -1152,9 +1151,11 @@ var JS_DEV_DEPS = [
// Splice in RX license if rx is in the bundle. // Splice in RX license if rx is in the bundle.
function insertRXLicense(source) { function insertRXLicense(source) {
var n = source.indexOf('System.register("@reactivex/rxjs/dist/cjs/Subject"'); var n = source.indexOf('System.register("rxjs/Subject"');
if (n >= 0) { if (n >= 0) {
var rxLicense = licenseWrap('node_modules/@reactivex/rxjs/LICENSE.txt'); // TODO: point this to Rx once Rx includes license in dist
// https://github.com/angular/angular/issues/5558
var rxLicense = licenseWrap('LICENSE');
return source.slice(0, n) + rxLicense + source.slice(n); return source.slice(0, n) + rxLicense + source.slice(n);
} else { } else {
return source; return source;

View File

@ -25,7 +25,7 @@ module.exports = function(config) {
// Including systemjs because it defines `__eval`, which produces correct stack traces. // Including systemjs because it defines `__eval`, which produces correct stack traces.
'modules/angular2/src/testing/shims_for_IE.js', 'modules/angular2/src/testing/shims_for_IE.js',
'node_modules/systemjs/dist/system.src.js', 'node_modules/systemjs/dist/system.src.js',
{pattern: 'node_modules/@reactivex/rxjs/**', included: false, watched: false, served: true}, {pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
'node_modules/reflect-metadata/Reflect.js', 'node_modules/reflect-metadata/Reflect.js',
'tools/build/file2modulename.js', 'tools/build/file2modulename.js',
'test-main.js', 'test-main.js',

View File

@ -9,7 +9,7 @@
"repository": <%= JSON.stringify(packageJson.repository) %>, "repository": <%= JSON.stringify(packageJson.repository) %>,
"dependencies": { "dependencies": {
"reflect-metadata": "<%= packageJson.dependencies['reflect-metadata'] %>", "reflect-metadata": "<%= packageJson.dependencies['reflect-metadata'] %>",
"@reactivex/rxjs": "<%= packageJson.dependencies['@reactivex/rxjs'] %>", "rxjs": "<%= packageJson.dependencies['rxjs'] %>",
"zone.js": "<%= packageJson.dependencies['zone.js'] %>" "zone.js": "<%= packageJson.dependencies['zone.js'] %>"
}, },
"devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %> "devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %>

View File

@ -4,11 +4,16 @@ import {global, isPresent, noop} from 'angular2/src/facade/lang';
import {PromiseWrapper, Promise, PromiseCompleter} from 'angular2/src/facade/promise'; import {PromiseWrapper, Promise, PromiseCompleter} from 'angular2/src/facade/promise';
export {PromiseWrapper, Promise, PromiseCompleter} from 'angular2/src/facade/promise'; export {PromiseWrapper, Promise, PromiseCompleter} from 'angular2/src/facade/promise';
import {Subject} from '@reactivex/rxjs/dist/cjs/Subject'; import {Subject} from 'rxjs/Subject';
import {Observable as RxObservable} from '@reactivex/rxjs/dist/cjs/Observable'; import {Observable as RxObservable} from 'rxjs/Observable';
import {Subscription} from '@reactivex/rxjs/dist/cjs/Subscription'; import {Subscription} from 'rxjs/Subscription';
import {Operator} from '@reactivex/rxjs/dist/cjs/Operator'; import {Operator} from 'rxjs/Operator';
export {Subject} from '@reactivex/rxjs/dist/cjs/Subject';
import 'rxjs/observable/fromPromise';
import 'rxjs/operators/toPromise';
export {Subject} from 'rxjs/Subject';
export namespace NodeJS { export namespace NodeJS {

View File

@ -5,7 +5,8 @@ import {ReadyStates} from '../enums';
import {Connection, ConnectionBackend} from '../interfaces'; import {Connection, ConnectionBackend} from '../interfaces';
import {isPresent} from 'angular2/src/facade/lang'; import {isPresent} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions'; import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {Subject, ReplaySubject} from '@reactivex/rxjs/dist/cjs/Rx'; import {Subject} from 'rxjs/Subject';
import {ReplaySubject} from 'rxjs/subjects/ReplaySubject';
/** /**
* *

View File

@ -9,7 +9,7 @@
"repository": <%= JSON.stringify(packageJson.repository) %>, "repository": <%= JSON.stringify(packageJson.repository) %>,
"dependencies": { "dependencies": {
"angular2": "<%= packageJson.version %>", "angular2": "<%= packageJson.version %>",
"@reactivex/rxjs": "<%= packageJson.dependencies['@reactivex/rxjs'] %>", "rxjs": "<%= packageJson.dependencies['rxjs'] %>",
"reflect-metadata": "<%= packageJson.dependencies['reflect-metadata'] %>" "reflect-metadata": "<%= packageJson.dependencies['reflect-metadata'] %>"
}, },
"devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %> "devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %>

View File

@ -29,7 +29,8 @@ import {
Http, Http,
Jsonp Jsonp
} from 'angular2/http'; } from 'angular2/http';
import {Observable, Subject} from '@reactivex/rxjs/dist/cjs/Rx'; import {Observable} from 'rxjs/Observable';
import {Subject} from 'rxjs/Subject';
class SpyObserver extends SpyObject { class SpyObserver extends SpyObject {
onNext: Function; onNext: Function;

View File

@ -689,47 +689,12 @@ var NG_ALL = [
'EventEmitter.emit():js', 'EventEmitter.emit():js',
'Observable:js', 'Observable:js',
'Observable#create():js', 'Observable#create():js',
'Observable.buffer():js',
'Observable.bufferCount():js',
'Observable.bufferTime():js',
'Observable.bufferToggle():js',
'Observable.bufferWhen():js',
'Observable.catch():js',
'Observable.combineAll():js',
'Observable.combineLatest():js',
'Observable.concat():js',
'Observable.concatAll():js',
'Observable.concatMap():js',
'Observable.concatMapTo():js',
'Observable.count():js',
'Observable.debounce():js',
'Observable.debounceTime():js',
'Observable.defaultIfEmpty():js',
'Observable.delay():js',
'Observable.dematerialize():js',
'Observable.distinctUntilChanged():js',
'Observable.do():js',
'Observable.every():js',
'Observable.expand():js',
'Observable.filter():js',
'Observable.finally():js',
'Observable.first():js',
'Observable.flatMap():js',
'Observable.flatMapTo():js',
'Observable.forEach():js', 'Observable.forEach():js',
'Observable.groupBy():js', 'Observable#fromPromise():js',
'Observable.ignoreElements():js',
'Observable.last():js',
'Observable.lift():js', 'Observable.lift():js',
'Observable.map():js', 'Observable.subscribe():js',
'Observable.mapTo():js', 'Observable.take():js',
'Observable.materialize():js', 'Observable.toPromise():js',
'Observable.merge():js',
'Observable.mergeAll():js',
'Observable.mergeMap():js',
'Observable.mergeMapTo():js',
'Observable.multicast():js',
'Observable.observeOn():js',
'OutputMetadata', 'OutputMetadata',
'OutputMetadata.bindingPropertyName', 'OutputMetadata.bindingPropertyName',

View File

@ -9,7 +9,7 @@
"repository": <%= JSON.stringify(packageJson.repository) %>, "repository": <%= JSON.stringify(packageJson.repository) %>,
"dependencies": { "dependencies": {
"angular2": "<%= packageJson.version %>", "angular2": "<%= packageJson.version %>",
"@reactivex/rxjs": "<%= packageJson.dependencies['@reactivex/rxjs'] %>", "rxjs": "<%= packageJson.dependencies['rxjs'] %>",
"zone.js": "<%= packageJson.dependencies['zone.js'] %>" "zone.js": "<%= packageJson.dependencies['zone.js'] %>"
}, },
"devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %> "devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %>

View File

@ -1,8 +1,5 @@
{ {
"dependencies": { "dependencies": {
"@reactivex/rxjs": {
"version": "5.0.0-alpha.10"
},
"angular": { "angular": {
"version": "1.4.7" "version": "1.4.7"
}, },
@ -13184,6 +13181,9 @@
} }
} }
}, },
"rxjs": {
"version": "5.0.0-alpha.11"
},
"selenium-webdriver": { "selenium-webdriver": {
"version": "2.48.2", "version": "2.48.2",
"dependencies": { "dependencies": {

12
npm-shrinkwrap.json generated
View File

@ -2,11 +2,6 @@
"name": "angular-srcs", "name": "angular-srcs",
"version": "2.0.0-alpha.46", "version": "2.0.0-alpha.46",
"dependencies": { "dependencies": {
"@reactivex/rxjs": {
"version": "5.0.0-alpha.10",
"from": "@reactivex/rxjs@5.0.0-alpha.10",
"resolved": "http://registry.npmjs.org/@reactivex/rxjs/-/rxjs-5.0.0-alpha.10.tgz"
},
"angular": { "angular": {
"version": "1.4.7", "version": "1.4.7",
"from": "https://registry.npmjs.org/angular/-/angular-1.4.7.tgz", "from": "https://registry.npmjs.org/angular/-/angular-1.4.7.tgz",
@ -20211,6 +20206,11 @@
} }
} }
}, },
"rxjs": {
"version": "5.0.0-alpha.11",
"from": "http://registry.npmjs.org/rxjs/-/rxjs-5.0.0-alpha.11.tgz",
"resolved": "http://registry.npmjs.org/rxjs/-/rxjs-5.0.0-alpha.11.tgz"
},
"selenium-webdriver": { "selenium-webdriver": {
"version": "2.48.2", "version": "2.48.2",
"from": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-2.48.2.tgz", "from": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-2.48.2.tgz",
@ -20341,7 +20341,7 @@
}, },
"source-map-loader": { "source-map-loader": {
"version": "0.1.5", "version": "0.1.5",
"from": "source-map-loader@*", "from": "source-map-loader@>=0.1.5 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-0.1.5.tgz", "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-0.1.5.tgz",
"dependencies": { "dependencies": {
"loader-utils": { "loader-utils": {

View File

@ -31,8 +31,8 @@
"test": "gulp test.all.js && gulp test.all.dart" "test": "gulp test.all.js && gulp test.all.dart"
}, },
"dependencies": { "dependencies": {
"@reactivex/rxjs": "5.0.0-alpha.10",
"reflect-metadata": "0.1.2", "reflect-metadata": "0.1.2",
"rxjs": "^5.0.0-alpha.11",
"zone.js": "0.5.8" "zone.js": "0.5.8"
}, },
"devDependencies": { "devDependencies": {

View File

@ -14,7 +14,7 @@ System.config({
'benchpress/*': 'dist/js/dev/es5/benchpress/*.js', 'benchpress/*': 'dist/js/dev/es5/benchpress/*.js',
'angular2/*': 'dist/js/dev/es5/angular2/*.js', 'angular2/*': 'dist/js/dev/es5/angular2/*.js',
'angular2_material/*': 'dist/js/dev/es5/angular2_material/*.js', 'angular2_material/*': 'dist/js/dev/es5/angular2_material/*.js',
'@reactivex/rxjs/*': 'node_modules/@reactivex/rxjs/*.js' 'rxjs/*': 'node_modules/rxjs/*.js'
} }
}); });

View File

@ -17,7 +17,7 @@ class CheckImports implements DiffingBroccoliPlugin {
"angular2/src/core", "angular2/src/core",
"angular2/src/facade", "angular2/src/facade",
], ],
"angular2/src/facade": ["angular2/src/facade", "@reactivex/rxjs"], "angular2/src/facade": ["angular2/src/facade", "rxjs"],
"angular2/src/common": ["angular2/core", "angular2/src/facade", "angular2/src/common"] "angular2/src/common": ["angular2/core", "angular2/src/facade", "angular2/src/common"]
//"angular2/src/render": [ //"angular2/src/render": [
// "angular2/animate", // "angular2/animate",

View File

@ -263,7 +263,7 @@ class CustomLanguageServiceHost implements ts.LanguageServiceHost {
} else if (this.compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs && } else if (this.compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs &&
tsFilePath.match(/^node_modules/)) { tsFilePath.match(/^node_modules/)) {
absoluteTsFilePath = path.resolve(tsFilePath); absoluteTsFilePath = path.resolve(tsFilePath);
} else if (tsFilePath.match(/^@reactivex/)) { } else if (tsFilePath.match(/^rxjs/)) {
absoluteTsFilePath = path.resolve('node_modules', tsFilePath); absoluteTsFilePath = path.resolve('node_modules', tsFilePath);
} else { } else {
absoluteTsFilePath = path.join(this.treeInputPath, tsFilePath); absoluteTsFilePath = path.join(this.treeInputPath, tsFilePath);

View File

@ -279,7 +279,7 @@ module.exports = function makeBrowserTree(options, destinationPath) {
// typescript resolves dependencies automatically // typescript resolves dependencies automatically
if (modules.bundle_deps) { if (modules.bundle_deps) {
var nodeModules = new Funnel( var nodeModules = new Funnel(
'node_modules', {include: ['@reactivex/**/**', 'parse5/**/**', 'css/**/**'], destDir: '/'}); 'node_modules', {include: ['rxjs/**/**', 'parse5/**/**', 'css/**/**'], destDir: '/'});
} }
if (generateEs6) { if (generateEs6) {