-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor to use bare RxJS implementations. #5288
Conversation
c9e8ca4
to
b4a430d
Compare
ddbc0a5
to
b8ef694
Compare
http.get('./people.json') | ||
.map((res: Response) => res.json()) | ||
.subscribe((people: Array<Object>) => this.people = people); | ||
http.get('./people.json').subscribe(res => { this.people = res.json(); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this need to be changed as part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I changed that when I did the first commit, I'll add it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needs to be fixed.
Any reason why we can't just re-export import {Observable} from '@reactivex/rxjs/dist/cjs/Observable';
export {Observable} from '@reactivex/rxjs/dist/cjs/Observable';
Observable.prototype.map = map;
Observable.prototype.filter = filter; |
Also, @vsavkin made the valid point that we should include I'm going to chat with @IgorMinar about this PR, because he said he has some thoughts. |
a68fed5
to
12f9357
Compare
@robwormald LGTM once you remove the last commit and finish the cleanup comments. You could also wait until ReactiveX/rxjs#751 and ReactiveX/rxjs#750 land if you'd like. |
@@ -3,9 +3,18 @@ import {global, isPresent} from 'angular2/src/facade/lang'; | |||
// without depending on rxjs. | |||
import {PromiseWrapper, Promise, PromiseCompleter} from 'angular2/src/facade/promise'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove this unused import in a separate commit? I'd do it, but then I'd create a conflict for you
the rest looks good |
12f9357
to
93a35fa
Compare
ObservableWrapper.fromPromise / .toPromise are gonna fail now. Thoughts? |
let's go with barebones first and then create PRs that add these things and On Sat, Nov 21, 2015 at 2:50 AM Rob Wormald notifications@github.com
|
barebones = what's in this PR now On Sat, Nov 21, 2015 at 2:51 AM Igor Minar igor@angularjs.org wrote:
|
@robwormald CI is failing...can you take a look? |
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'`
482f38f
to
81a8602
Compare
alllllright, big changes. new version of rxjs in, minimal API surface
@jeffbcross @IgorMinar plz discuss |
81a8602
to
904b838
Compare
will need to add following operators:
|
@@ -13268,33 +13268,6 @@ | |||
} | |||
} | |||
}, | |||
"source-map-loader": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the source-map-loader
removed? It looks like something went wrong with the shrinkwrap process (npm install not executed?)
IMO shrinkwrap is broken in this PR. It needs to be corrected as it might break source maps for bundles. |
} else { | ||
return source; | ||
} | ||
var n = source.indexOf('System.register("rxjs/Subject"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't omit the license. What is the underlying problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't ship in the new repo. I can grab it from the old I guess.
TODOs:
Regarding I'll take care of all of the todos except the last one for now. @robwormald do you want to try to correct the license issue upstream and convince @Blesh to cut another RxJS release? |
@jeffbcross I filed an issue for the newline-at-EOF, I don't think that's supported yet. |
Thanks @mprobst! |
Is this to say that the new packages are missing the LICENSE file?... that's not good. lol
The beta release is coming this week (hopefully in a couple of days). Does it need to be before that? |
I'll fix the Rx stuff over there first, and in the interim can just grab
|
Bundle size measurements (using the reported numbers from
*these are the operators included in the "8 operators" import 'rxjs/operators/map';
import 'rxjs/operators/mergeMap'; //aka flatMap
import 'rxjs/operators/filter';
import 'rxjs/operators/reduce';
import 'rxjs/operators/toPromise';
import 'rxjs/observable/from';
import 'rxjs/observable/fromArray'; //Observable.of
import 'rxjs/observable/fromPromise'; **these are the operators included in the "4 operators" import 'rxjs/operators/map';
import 'rxjs/operators/mergeMap'; //aka flatMap
import 'rxjs/operators/filter';
import 'rxjs/operators/reduce'; CC @IgorMinar |
FWIW, |
FYI I opened #5533 to fix some of the remaining issues here (everything except the license issue) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
change RxJS implementation to use bare Observable and Subject with no included operators.