Skip to content
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

Bring next branch up to date #2376

Merged
merged 41 commits into from
Feb 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
37b6e39
chore(*): correctly scope disabled `max-line-length` tslint rule
gkalpak Jan 23, 2017
41489eb
fix(Subject): ensure subject properly throws ObjectUnsubscribedError …
benlesh Feb 1, 2017
faabd3e
chore(publish): 5.1.0
benlesh Feb 1, 2017
cb91c76
fix(bindCallback): input function context can now be properly set via…
mpodlasin Feb 2, 2017
3ec315d
fix(bindNodeCallback): input function context can now be properly set…
mpodlasin Feb 2, 2017
2aaa8f1
test(filter): enable type inference in marble diagram
kwonoj Dec 20, 2016
716377d
chore(danger): setup initial dangerfile
kwonoj Feb 4, 2017
e338ca6
style(tslint): update code lint, hint friendly
kwonoj Feb 4, 2017
2889519
Merge pull request #2202 from kwonoj/fix-test-type-inference
jayphelps Feb 5, 2017
7eb5015
chore(dangerfile): fix test for hot and cold usages without types
mpodlasin Feb 5, 2017
6ce4773
Merge pull request #2330 from Podlas29/danger-hot-and-cold-match
kwonoj Feb 5, 2017
8b81fc6
fix(bindNodeCallback): emit undefined when callback has no success ar…
mpodlasin Feb 5, 2017
915a2a8
fix(bindCallback): emit undefined when callback is without arguments
mpodlasin Feb 5, 2017
01a2d15
test(all): enable type inference to marble diagram
kwonoj Feb 9, 2017
25d3f4a
chore(danger): update dangerfile to validate commit message
kwonoj Feb 9, 2017
31dfc73
Merge pull request #2346 from kwonoj/chore-enable-type-test
jayphelps Feb 9, 2017
46c954a
feat(AjaxObservable) : support 'PATCH' request type
herflis Feb 10, 2017
7983b91
fix(forkJoin): add type signature for single observable with selector
mpodlasin Feb 10, 2017
86acbd1
feat(webSocket): Add binaryType to config object
mpodlasin Feb 10, 2017
85752eb
fix(merge): return Observable when called with single lowerCaseO
mpodlasin Feb 12, 2017
14685ba
fix(subscribeToResult): accept array-like as result
mpodlasin Feb 12, 2017
22e4c17
fix(Subscription): fold ChildSubscription logic into Subscriber to pr…
trxcllnt Feb 13, 2017
996bf6d
chore(publish): 5.1.1
benlesh Feb 13, 2017
9d8ac3a
Ignore coverage
timruffles Feb 13, 2017
de6a8f4
Merge pull request #2367 from timruffles/patch-1
kwonoj Feb 13, 2017
3f01114
Merge pull request #2364 from Podlas29/observable-input-as-array-like
jayphelps Feb 13, 2017
1821519
chore(ajax.patch): Adds test for ajax.patch
jayphelps Feb 13, 2017
9c1f793
Merge pull request #2354 from herflis/my-fix-branch
jayphelps Feb 14, 2017
7b38d19
Merge pull request #2363 from Podlas29/static-merge-with-one-observab…
jayphelps Feb 14, 2017
e8f8153
Merge pull request #2357 from Podlas29/web-socket-binary-type
jayphelps Feb 14, 2017
71704b2
Merge pull request #2356 from Podlas29/fork-join-test-case-type-defin…
jayphelps Feb 14, 2017
d23add0
Merge pull request #2349 from kwonoj/chore-danger-changelog
jayphelps Feb 14, 2017
589b7f6
Merge pull request #2329 from Podlas29/bind-node-callback-no-callback…
jayphelps Feb 14, 2017
1d27ea2
Merge pull request #2328 from Podlas29/bind-callback-no-callback-argu…
jayphelps Feb 14, 2017
25ee5b3
Merge pull request #2308 from gkalpak/patch-5
jayphelps Feb 14, 2017
656f2b3
fix(mergeAll): introduce variant support <T, R> for mergeMap
kwonoj Feb 14, 2017
02cbda6
Merge pull request #2374 from kwonoj/style-mergeall
kwonoj Feb 14, 2017
9c018b5
docs(ObservableInput): add ObservableInput and SubscribableOrPromise …
mpodlasin Feb 6, 2017
381be3f
feat(windowTime): maxWindowSize parameter in windowTime operator
mpodlasin Dec 12, 2016
db8dc77
Merge pull request #2187 from Podlas29/window-time-with-max-size
jayphelps Feb 15, 2017
7839002
Merge pull request #2373 from Podlas29/observable-input-docs
jayphelps Feb 15, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
perf
spec
.git
yarn.lock
yarn.lock
coverage
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cache:
env:
matrix:
- NODE_VER=4 FULL_VALIDATE=false
- NODE_VER=6 FULL_VALIDATE=true alias grunt=./node_modules/grunt-cli/bin/grunt
- NODE_VER=6 FULL_VALIDATE=true alias grunt=./node_modules/grunt-cli/bin/grunt danger=./node_modules/danger/distribution/danger
- NODE_VER=7 FULL_VALIDATE=false
matrix:
fast_finish: true
Expand All @@ -23,6 +23,7 @@ before_install:
- nvm install $NODE_VER
- npm install -g npm@4 && node -v && npm -v
- if [ "$FULL_VALIDATE" == "true" ]; then npm install [email protected] grunt-cli grunt-contrib-connect grunt-run; fi
- if [ "$FULL_VALIDATE" == "true" ] && [ -n "DANGER_GITHUB_API_TOKEN" ]; then npm install danger && danger; fi

install:
- npm install
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
<a name="5.1.1"></a>
## [5.1.1](https:/ReactiveX/RxJS/compare/5.1.0...v5.1.1) (2017-02-13)


### Bug Fixes

* **bindCallback:** input function context can now be properly set via output function ([#2319](https:/ReactiveX/RxJS/issues/2319)) ([cb91c76](https:/ReactiveX/RxJS/commit/cb91c76))
* **bindNodeCallback:** input function context can now be properly set via output function ([#2320](https:/ReactiveX/RxJS/issues/2320)) ([3ec315d](https:/ReactiveX/RxJS/commit/3ec315d))
* **Subscription:** fold ChildSubscription logic into Subscriber to prevent operators from leaking ChildSubscriptions. ([#2360](https:/ReactiveX/RxJS/issues/2360)) ([22e4c17](https:/ReactiveX/RxJS/commit/22e4c17)), closes [#2244](https:/ReactiveX/RxJS/issues/2244) [#2355](https:/ReactiveX/RxJS/issues/2355)



<a name="5.1.0"></a>
# [5.1.0](https:/ReactiveX/RxJS/compare/5.0.3...v5.1.0) (2017-02-01)


### Bug Fixes

* **catch:** update the catch operator to dispose inner subscriptions if the catch subscription is di ([#2271](https:/ReactiveX/RxJS/issues/2271)) ([8a1e089](https:/ReactiveX/RxJS/commit/8a1e089))
* **combineLatest:** Don't mutate array of observables passed to ([#2276](https:/ReactiveX/RxJS/issues/2276)) ([9b73c46](https:/ReactiveX/RxJS/commit/9b73c46))
* **ISubscription:** update type definition of ISubscription::closed ([#2249](https:/ReactiveX/RxJS/issues/2249)) ([0c304a2](https:/ReactiveX/RxJS/commit/0c304a2))
* **Observable:** Ensure the generic type of the Observer passed to Observable's initializer function is the same. ([51a0bc1](https:/ReactiveX/RxJS/commit/51a0bc1)), closes [#2166](https:/ReactiveX/RxJS/issues/2166)
* **Observable:** errors thrown during subscription are now properly sent down error channel ([#2313](https:/ReactiveX/RxJS/issues/2313)) ([d4a9aac](https:/ReactiveX/RxJS/commit/d4a9aac)), closes [#1833](https:/ReactiveX/RxJS/issues/1833)
* **reduce:** index will properly start at 1 if no seed is provided, to match native Array reduce behavior ([30a4ca4](https:/ReactiveX/RxJS/commit/30a4ca4)), closes [#2290](https:/ReactiveX/RxJS/issues/2290)
* **repeatWhen:** resulting observable will wait for the source to complete, even if a hot notifier completes first. ([#2209](https:/ReactiveX/RxJS/issues/2209)) ([c65a098](https:/ReactiveX/RxJS/commit/c65a098)), closes [#2054](https:/ReactiveX/RxJS/issues/2054)
* **Subject:** ensure subject properly throws ObjectUnsubscribedError when unsubscribed then resubscribed to ([#2318](https:/ReactiveX/RxJS/issues/2318)) ([41489eb](https:/ReactiveX/RxJS/commit/41489eb))
* **TestScheduler:** helper methods return proper types, `HotObservable` and `ColdObservable` instead of Observable ([#2305](https:/ReactiveX/RxJS/issues/2305)) ([758aae9](https:/ReactiveX/RxJS/commit/758aae9))
* **windowTime:** ensure windows created when only a timespan is passed are closed and cleaned up properly. ([#2278](https:/ReactiveX/RxJS/issues/2278)) ([d4533c4](https:/ReactiveX/RxJS/commit/d4533c4))


### Features

* **fromEventPattern:** support optional removeHandler ([86960c2](https:/ReactiveX/RxJS/commit/86960c2))
* **fromEventPattern:** support pass signal from addHandler to removeHandler ([01d0622](https:/ReactiveX/RxJS/commit/01d0622))



<a name="5.0.3"></a>
## [5.0.3](https:/ReactiveX/RxJS/compare/5.0.2...v5.0.3) (2017-01-05)

Expand Down
68 changes: 68 additions & 0 deletions dangerfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var validateMessage = require('validate-commit-msg');

//simple regex matcher to detect usage of helper function and its type signature
var hotMatch = /\bhot\(/gi;
var hotSignatureMatch = /\bdeclare const hot: typeof/gi;

var coldMatch = /\bcold\(/gi;
var coldSignatureMatch = /\bdeclare const cold: typeof/gi;

var errorCount = 0;

// Warn when PR size is large
var bigPRThreshold = 600;
if (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) {
warn(':exclamation: Big PR (' + ++errorCount + ')');
markdown('> (' + errorCount + ') : Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.');
}

// Check test exclusion (.only) is included
var modifiedSpecFiles = danger.git.modified_files.filter(function (filePath) {
return filePath.match(/-spec.(js|jsx|ts|tsx)$/gi);
});

var testFilesIncludeExclusion = modifiedSpecFiles.reduce(function (acc, value) {
var content = fs.readFileSync(value).toString();
var invalid = _.includes(content, 'it.only') || _.includes(content, 'describe.only');
if (invalid) {
acc.push(path.basename(value));
}
return acc;
}, []);

if (testFilesIncludeExclusion.length > 0) {
fail('an \`only\` was left in tests (' + testFilesIncludeExclusion + ')');
}

// Check test cases missing type signature import for test marble helper functions
var testFilesMissingTypes = modifiedSpecFiles.reduce(function (acc, value) {
var content = fs.readFileSync(value).toString();

var hotFnMatchesWithoutTypes = content.match(hotMatch) && !content.match(hotSignatureMatch);
var coldFnMatchesWithoutTypes = content.match(coldMatch) && !content.match(coldSignatureMatch);

if (hotFnMatchesWithoutTypes || coldFnMatchesWithoutTypes) {
acc.push(path.basename(value));
}

return acc;
}, []);

if (testFilesMissingTypes.length > 0) {
fail('missing type definition import in tests (' + testFilesMissingTypes + ') (' + ++errorCount + ')');
markdown('> (' + errorCount + ') : It seems updated test cases uses test scheduler interface `hot`, `cold` but miss to import type signature for those.');
}

//validate commit message in PR if it conforms conventional change log, notify if it doesn't.
var messageConventionValid = danger.git.commits.reduce(function (acc, value) {
var valid = validateMessage(value.message);
return valid && acc;
}, true);

if (!messageConventionValid) {
fail('commit message does not follows conventional change log (' + ++errorCount + ')');
markdown('> (' + errorCount + ') : RxJS uses conventional change log to generate changelog automatically. It seems some of commit messages are not following those, please check [contributing guideline](https:/ReactiveX/rxjs/blob/master/CONTRIBUTING.md#commit-message-format) and update commit messages.');
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reactivex/rxjs",
"version": "5.0.3",
"version": "5.1.1",
"description": "Reactive Extensions for modern JavaScript",
"main": "index.js",
"config": {
Expand Down Expand Up @@ -189,7 +189,7 @@
"sinon-chai": "^2.8.0",
"source-map-support": "^0.4.0",
"tslib": "^1.5.0",
"tslint": "^4.2.0",
"tslint": "^4.4.2",
"typescript": "~2.0.6",
"typings": "^2.0.0",
"validate-commit-msg": "^2.3.1",
Expand Down
7 changes: 6 additions & 1 deletion spec/Observable-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ import {expect} from 'chai';
import * as sinon from 'sinon';
import * as Rx from '../dist/cjs/Rx';
import {TeardownLogic} from '../dist/cjs/Subscription';
import marbleTestingSignature = require('./helpers/marble-testing'); // tslint:disable-line:no-require-imports

declare const { asDiagram, rxTestScheduler };
declare const cold: typeof marbleTestingSignature.cold;
declare const expectObservable: typeof marbleTestingSignature.expectObservable;
declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions;

declare const {asDiagram, expectObservable, rxTestScheduler};
const Subscriber = Rx.Subscriber;
const Observable = Rx.Observable;

Expand Down
8 changes: 7 additions & 1 deletion spec/Subject-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {expect} from 'chai';
import * as Rx from '../dist/cjs/Rx';
import marbleTestingSignature = require('./helpers/marble-testing'); // tslint:disable-line:no-require-imports

declare const {hot, expectObservable};
declare const { time };
declare const hot: typeof marbleTestingSignature.hot;
declare const expectObservable: typeof marbleTestingSignature.expectObservable;

const Subject = Rx.Subject;
const Observable = Rx.Observable;
Expand Down Expand Up @@ -261,6 +264,9 @@ describe('Subject', () => {
expect(() => {
subject.subscribe(
function (x) { results3.push(x); },
function (err) {
expect(false).to.equal('should not throw error: ' + err.toString());
}
);
}).to.throw(Rx.ObjectUnsubscribedError);

Expand Down
3 changes: 1 addition & 2 deletions spec/helpers/test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import {$$iterator} from '../../dist/cjs/symbol/iterator';
import $$symbolObservable from 'symbol-observable';

export function lowerCaseO<T>(...args): Rx.Observable<T> {
const values = [].slice.apply(arguments);

const o = {
subscribe: function (observer) {
values.forEach(function (v) {
args.forEach(function (v) {
observer.next(v);
});
observer.complete();
Expand Down
5 changes: 4 additions & 1 deletion spec/observables/SubscribeOnObservable-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import {expect} from 'chai';
import * as sinon from 'sinon';
import * as Rx from '../../dist/cjs/Rx';
import {SubscribeOnObservable} from '../../dist/cjs/observable/SubscribeOnObservable';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports

declare const {hot, expectObservable, expectSubscriptions};
declare const hot: typeof marbleTestingSignature.hot;
declare const expectObservable: typeof marbleTestingSignature.expectObservable;
declare const expectSubscriptions: typeof marbleTestingSignature.expectSubscriptions;
declare const rxTestScheduler: Rx.TestScheduler;

describe('SubscribeOnObservable', () => {
Expand Down
74 changes: 74 additions & 0 deletions spec/observables/bindCallback-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ const Observable = Rx.Observable;
/** @test {bindCallback} */
describe('Observable.bindCallback', () => {
describe('when not scheduled', () => {
it('should emit undefined from a callback without arguments', () => {
function callback(cb) {
cb();
}
const boundCallback = Observable.bindCallback(callback);
const results = [];

boundCallback()
.subscribe((x: any) => {
results.push(typeof x);
}, null, () => {
results.push('done');
});

expect(results).to.deep.equal(['undefined', 'done']);
});

it('should emit one value from a callback', () => {
function callback(datum, cb) {
cb(datum);
Expand All @@ -25,6 +42,24 @@ describe('Observable.bindCallback', () => {
expect(results).to.deep.equal([42, 'done']);
});

it('should set callback function context to context of returned function', () => {
function callback(cb) {
cb(this.datum);
}

const boundCallback = Observable.bindCallback(callback);
const results = [];

boundCallback.apply({datum: 5})
.subscribe(
(x: number) => results.push(x),
null,
() => results.push('done')
);

expect(results).to.deep.equal([5, 'done']);
});

it('should emit one value chosen by a selector', () => {
function callback(datum, cb) {
cb(datum);
Expand Down Expand Up @@ -86,6 +121,25 @@ describe('Observable.bindCallback', () => {
});

describe('when scheduled', () => {
it('should emit undefined from a callback without arguments', () => {
function callback(cb) {
cb();
}
const boundCallback = Observable.bindCallback(callback, null, rxTestScheduler);
const results = [];

boundCallback()
.subscribe((x: any) => {
results.push(typeof x);
}, null, () => {
results.push('done');
});

rxTestScheduler.flush();

expect(results).to.deep.equal(['undefined', 'done']);
});

it('should emit one value from a callback', () => {
function callback(datum, cb) {
cb(datum);
Expand All @@ -105,6 +159,26 @@ describe('Observable.bindCallback', () => {
expect(results).to.deep.equal([42, 'done']);
});

it('should set callback function context to context of returned function', () => {
function callback(cb) {
cb(this.datum);
}

const boundCallback = Observable.bindCallback(callback, null, rxTestScheduler);
const results = [];

boundCallback.apply({datum: 5})
.subscribe(
(x: number) => results.push(x),
null,
() => results.push('done')
);

rxTestScheduler.flush();

expect(results).to.deep.equal([5, 'done']);
});

it('should error if callback throws', () => {
const expected = new Error('haha no callback for you');
function callback(datum, cb) {
Expand Down
Loading