Skip to content

Commit

Permalink
Merge branch 'next' into buffer-subscription-order
Browse files Browse the repository at this point in the history
  • Loading branch information
jayphelps authored Feb 15, 2017
2 parents 425aca5 + a102b3c commit 15d5ac9
Show file tree
Hide file tree
Showing 250 changed files with 3,487 additions and 1,402 deletions.
2 changes: 0 additions & 2 deletions .lgtm

This file was deleted.

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
40 changes: 18 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
language: node_js
sudo: false
node_js:
- '4.2.2'
- '6'

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
sauce_connect:
# Update SAUCE_USERNAME / SAUCE_ACCESS_KEY in travis if necessary
# https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
sauce_connect: true
sauce_connect:
# Update SAUCE_USERNAME / SAUCE_ACCESS_KEY in travis if necessary
# https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
sauce_connect: true

cache:
directories:
- node_modules

env:
global:
- CXX=g++-4.8
- alias grunt=./node_modules/grunt-cli/bin/grunt
matrix:
- NODE_VER=4 FULL_VALIDATE=false
- 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

before_install:
- npm install -g npm@3 && npm install [email protected] grunt-cli grunt-contrib-connect grunt-run
- 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 && npm run lint
- npm install
- if [ "$FULL_VALIDATE" == "true" ]; then npm run lint && npm run check_circular_dependencies; fi

script:
- npm run build_spec && npm run test_mocha && node ./node_modules/markdown-doctest/bin/cmd.js
- npm run check_circular_dependencies

after_success:
- npm run cover
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ -n "${SAUCE_ACCESS_KEY}" ] && npm run build_spec_browser && grunt --gruntfile spec/support/mocha.sauce.gruntfile.js || false'
- if [ "$FULL_VALIDATE" == "true" ]; then npm run cover && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js; fi
- if [ "$FULL_VALIDATE" == "true" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ -n "$SAUCE_ACCESS_KEY" ]; then npm run build_spec_browser && grunt --gruntfile spec/support/mocha.sauce.gruntfile.js; fi
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
<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)


### Bug Fixes

* **observeOn:** seal memory leak involving old notifications ([9664a38](https:/ReactiveX/RxJS/commit/9664a38)), closes [#2244](https:/ReactiveX/RxJS/issues/2244)
* **Subscription:** `add` will return Subscription that `remove`s itself when unsubscribed ([375d4a5](https:/ReactiveX/RxJS/commit/375d4a5))
* **TypeScript:** interfaces that accepted `Scheduler` now accept `IScheduler` interface ([a0d28a8](https:/ReactiveX/RxJS/commit/a0d28a8))



<a name="5.0.2"></a>
## [5.0.2](https:/ReactiveX/RxJS/compare/5.0.1...v5.0.2) (2016-12-23)


### Bug Fixes

* **ajax:** upload progress is now set correctly ([#2200](https:/ReactiveX/RxJS/issues/2200)) ([1a83041](https:/ReactiveX/RxJS/commit/1a83041))
* **groupBy:** Fix groupBy to dispose of outer subscription. ([#2201](https:/ReactiveX/RxJS/issues/2201)) ([2269618](https:/ReactiveX/RxJS/commit/2269618))



<a name="5.0.1"></a>
## [5.0.1](https:/ReactiveX/RxJS/compare/5.0.0...v5.0.1) (2016-12-13)

Expand Down
9 changes: 9 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ To reduce polymorphism and get better performance out of operators, some operato
<td><code>timeout(dueTime: number | Date, other?: Observable | Promise, scheduler?: Scheduler)</code></td>
<td><code>timeoutWith(due: number | Date, withObservable: ObservableInput, scheduler: Scheduler)</code></td>
</tr>
<tr>
<td rowspan="2"><code>sample</code></td>
<td><code>sample(interval: number, scheduler?: Scheduler)</code></td>
<td><code>sampleTime(interval: number, scheduler?: Scheduler)</code></td>
</tr>
<tr>
<td><code>sample(notifier: Observable)</code></td>
<td><code>sample(notifier: Observable)</code></td>
</tr>
</tbody>
</table>

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Exten
- [Migrating From RxJS 4 to RxJS 5](MIGRATION.md)
- [API Documentation (WIP)](http://reactivex.io/rxjs)

## Versions In This Repository

- [master](https:/ReactiveX/rxjs/commits/master) - commits that will be included in the next _minor_ or _patch_ release
- [next](https:/ReactiveX/rxjs/commits/next) - commits that will be included in the next _major_ release (breaking changes)

Most PRs should be made to **master**, unless you know it is a breaking change.

## Important

By contributing or commenting on issues in this repository, whether you've read them or not, you're agreeing to the [Contributor Code of Conduct](CODE_OF_CONDUCT.md). Much like traffic laws, ignorance doesn't grant you immunity.
Expand Down Expand Up @@ -114,15 +121,8 @@ npm install @reactivex/[email protected]
### CDN

For CDN, you can use [unpkg](https://unpkg.com/):

5.0.0-beta.1 - 5.0.0-beta.11:

https://unpkg.com/@reactivex/rxjs/dist/global/Rx.umd.js


5.0.0-beta.12 or higher:

https://unpkg.com/@reactivex/rxjs/dist/global/Rx.js

https://unpkg.com/rxjs/bundles/Rx.min.js

#### Node.js Usage:

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.');
}
3 changes: 2 additions & 1 deletion doc/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ var lastClick = Date.now() - rate;
var button = document.querySelector('button');
button.addEventListener('click', (event) => {
if (Date.now() - lastClick >= rate) {
console.log(++count + event.clientX)
count += event.clientX;
console.log(count)
lastClick = Date.now();
}
});
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial/applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ class MyComponent extends ObservableComponent {
}
componentDidMount() {
this.messages = messages
// Let accumulate our messages in an array
// Accumulate our messages in an array
.scan((messages, message) => [message].concat(messages), [])
// And render whenever we get a new message
.forEach(messages => this.setState({messages: messages}));
.subscribe(messages => this.setState({messages: messages}));
}
componentWillUnmount() {
this.messages.unsubscribe();
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Which one you choose depends on the scenario. The normal **Observable** is great
## Controlling the flow
```js
// typing "hello world"
var input = Rx.Observable.fromEvent(document.querySelector('input'), 'keypress');
var input = Rx.Observable.fromEvent(document.querySelector('input'), 'input');

// Filter out target values less than 3 characters long
input.filter(event => event.target.value.length > 2)
Expand Down Expand Up @@ -79,7 +79,7 @@ input.takeUntil(stopStream)
## Producing values
```js
// typing "hello world"
var input = Rx.Observable.fromEvent(document.querySelector('input'), 'keypress');
var input = Rx.Observable.fromEvent(document.querySelector('input'), 'input');

// Pass on a new value
input.map(event => event.target.value)
Expand Down
Loading

0 comments on commit 15d5ac9

Please sign in to comment.