Changelog History
Page 3
-
v7.0.0-beta.8 Changes
October 15, 2020๐ Bug Fixes
- audit, auditTime: audit and auditTime emit last value after source completes (#5799) (643bc85), closes #5730
- No longer allow invalid "Subscribable" type as valid observable source in
from
and others. (258dddd), closes #4532 - bindNodeCallback: ensure underlying function is not called twice during subscription (#5780) (74aa4b2)
- delay: Now properly handles Date and negative numbers (#5719) (868c02b), closes #5232
- delayWhen: only deprecates when subscriptionDelay presents (#5797) (43d1731)
- every: index properly increments in predicate (5686f83)
- firstValueFrom: now unsubscribes from source after first value is received (#5813) (a321516), closes #5811
- from: objects that are thennable that happen to have a subscribe method will no longer error. (789d6e3)
- fromEvent: now properly types JQuery event targets (b5aa15a)
- ๐ mergeScan: no longer emits state again upon completion. (#5805) (68c2894), closes #5372
- throttle: now supports synchronous duration selectors (55e953e), closes #5658
- throttle: trailing values will now emit after source completes (d5fd69c)
- โฑ timeout: allows synchronous observable as a source (84c5c0b), closes #5746
- zip: zip now accepts an array of arguments like its counterparts (3123b67)
๐จ Code Refactoring
๐ Features
- ajax: now supports passing custom XSRF cookies in a custom header (#5702) (1a2c2e4), closes #4003
- switchScan: add switchScan() operator (#4442) (73fa910), closes #2931
๐ฅ BREAKING CHANGES
- ๐ mergeScan:
mergeScan
will no longer emit its inner state again upon completion. - pairs:
pairs
will no longer function in IE without a polyfill forObject.entries
.pairs
itself is also deprecated in favor of users just usingfrom(Object.entries(obj))
. - zip: Zipping a single array will now have a different result. This is an extreme corner-case, because it is very unlikely that anyone would want to zip an array with nothing at all. The workaround would be to wrap the array in another array
zip([[1,2,3]])
. But again, that's pretty weird. - count: No longer passes
source
observable as a third argument to the predicate. That feature was rarely used, and of limited value. The workaround is to simply close over the source inside of the function if you need to access it in there.
-
v7.0.0-beta.7 Changes
September 23, 2020๐ Bug Fixes
- multicast: and other publish variants will handle errors thrown in a selector appropriately (bde8eda)
๐จ Code Refactoring
- tap: reduce the size of the implementation (1222d5a)
- Subscriber: Massively untangle Subscriber and SafeSubscriber (07902ca)
๐ฅ BREAKING CHANGES
- Subscriber:
new Subscriber
no longer takes 0-3 arguments. To create aSubscriber
with 0-3 arguments, useSubscriber.create
. However, please note that there is little to no reason that you should be creatingSubscriber
references directly, andSubscriber.create
andnew Subscriber
are both deprecated.
-
v7.0.0-beta.6 Changes
September 23, 2020๐ Bug Fixes
- AsyncSubject: fixed reentrancy issue in complete (9e00f11), closes /github.com/ReactiveX/rxjs/pull/5729/files/30d429cf1b791db15c04a61f6a683e189b53fb3e#r492314703
- delay: proper handling of absolute time (
Date
) passed as an argument (8ae89b1) - fromEvent: properly teardown for ArrayLike targets (066de74)
- ReplaySubject: no longer buffers additional values after it's already stopped (#5696) (a08232b)
- scan: proper indexes when seed is not supplied (f93fb9c), closes #4348 #3879
- windowTime: Passing no creation interval will now properly open new window when old one closes (cbd0ac0)
๐จ Code Refactoring
- Massive Size Reduction: reduced the size of all operator implementations as well as other utilities and types (#5729) (4d3fc23)
๐ Features
- onUnhandledError: configuration point added for unhandled errors (#5681) (3485dd5)
- skipLast: counts zero or less will mirror the source (02e113b)
๐ฅ BREAKING CHANGES
- skipLast:
skipLast
will no longer error when passed a negative number, rather it will simply return the source, as though0
was passed. - map:
thisArg
will now default toundefined
. The previous default ofMapSubscriber
never made any sense. This will only affect code that calls map with afunction
and referencesthis
like so:source.pipe(map(function () { console.log(this); }))
. There wasn't anything useful about doing this, so the breakage is expected to be very minimal. If anything we're no longer leaking an implementation detail. - onUnhandledError: Errors that occur during setup of an observable subscription after the subscription has emitted an error or completed will now throw in their own call stack. Before it would call
console.warn
. This is potentially breaking in edge cases for node applications, which may be configured to terminate for unhandled exceptions. In the unlikely event this affects you, you can configure the behavior toconsole.warn
in the new configuration setting like so:import { config } from 'rxjs'; config.onUnhandledError = (err) => console.warn(err);
-
v7.0.0-beta.5 Changes
September 03, 2020๐ Bug Fixes
- ajax: Allow XHR to perform body serialization and set content-type where possible (d8657ed), closes #2837
- ajax: Do not mutate headers passed as arguments (0d66ba4), closes #2801
- bindCallback: now emits errors that happen after callback (2bddd31)
- bindNodeCallback: now emits errors that happen after callback (edc28cf)
- buffer: Ensure notifier is subscribed after source (#5654) (c088b0e), closes #2195 #1754
- catchError: ensure proper handling of async return for synchronous source error handling (#5627) (1b29d4b), closes #5115
- catchError: inner synchronous observables will properly terminate (#5655) (d3fd2fb)
- errors: Custom RxJS errors now all have a call stack (#5686) (9bb046c), closes #4250
- onErrorResumeNext: observables always finalized before moving to next source (#5650) (ff68ad2)
- ๐ฆ package.json: change homepage setting to official docs site. (#5669) (e57c402)
- repeat: Ensure teardown happens between repeated synchronous obsโฆ (#5620) (0ca8a65)
- repeatWhen: Ensure teardown happens between repeat subscriptions (#5625) (98356f4)
- retry: Ensure teardown happens before resubscription with synchronous observables (6f90597), closes #5620
- retryWhen: Ensure subscription tears down between retries (#5623) (6752af7)
- throttleTime: ensure the spacing between throttles is always at least the throttled amount (#5687) (ea84fc4), closes #3712 #4864 #2727 #4727 #4429
- zip: zip operators and functions are now able to zip all iterable sources (#5688) (02c3a1b), closes #4304
switchMap
andexhaustMap
behave correctly with re-entrant code. (c289688)- webSocket: close websocket connection attempt on unsubscribe (e1a671c), closes #4446
๐จ Code Refactoring
- ajax: Use simple Observable (17b9add)
- Subscriber: remove _unsubscribeAndRecycle (d879c3f)
- โฑ VirtualTimeScheduler: remove sortActions from public API (#5657) (a468f88)
๐ Features
- โ combineLatest: add N-args signature for observable inputs (#5488) (fcc47e7)
- Subscription:
add
no longer returns unnecessary Subscription reference (#5656) (4de604e) - Subscription:
remove
will now remove any teardown by reference (#5659) (1531152) - throwError: now accepts a factory to create the error (#5647) (dad270a), closes #5617
- ๐ useDeprecatedNextContext: Puts deprecated next context behavior behind a flag (dfdef5d)
- ๐ support schedulers within run (#5619) (c63de0d)
๐ Performance Improvements
- SafeSubscriber: avoid using
Object.create
(40a9e77)
๐ฅ BREAKING CHANGES
ajax:
ajax
body serialization will now use default XHR behavior in all cases. If the body is aBlob
,ArrayBuffer
, any array buffer view (like a byte sequence, e.g.Uint8Array
, etc),FormData
,URLSearchParams
,string
, orReadableStream
, default handling is use. If thebody
is otherwisetypeof
"object"
, then it will be converted to JSON viaJSON.stringify
, and theContent-Type
header will be set toapplication/json;charset=utf-8
. All other types will emit an error.- The
Content-Type
header passed toajax
configuration no longer has any effect on the serialization behavior of the AJAX request. - For TypeScript users,
AjaxRequest
is no longer the type that should be explicitly used to create anajax
. It is nowAjaxConfig
, although the two types are compatible, onlyAjaxConfig
hasprogressSubscriber
andcreateXHR
.
zip:
zip
operators will no longer iterate provided iterables "as needed", instead the iterables will be treated as push-streams just like they would be everywhere else in RxJS. This means that passing an endless iterable will result in the thread locking up, as it will endlessly try to read from that iterable. This puts us in-line with all other Rx implementations. To work around this, it is probably best to usemap
or some combination ofmap
andzip
. For example,zip(source$, iterator)
could besource$.pipe(map(value => [value, iterator.next().value]))
.Subscription:
add
no longer returns an unnecessary Subscription reference. This was done to prevent confusion caused by a legacy behavior. You can now add and remove functions and Subscriptions as teardowns to and from aSubscription
usingadd
andremove
directly. Before this,remove
only accepted subscriptions.RxJS Error types Tests that are written with naive expectations against errors may fail now that errors have a proper
stack
property. In some testing frameworks, a deep equality check on two error instances will check the values instack
, which could be different.๐ Undocumented Behaviors/APIs Removed:
unsubscribe
no longer available via thethis
context of observer functions. To reenable, setconfig.useDeprecatedNextContext = true
on the rxjsconfig
found atimport { config } from 'rxjs';
. Note that enabling this will result in a performance penalty for all consumer subscriptions.- Leaked implementation detail
_unsubscribeAndRecycle
ofSubscriber
has been removed. Just use newSubscription
objects - Removed an undocumented behavior where passing a negative count argument to
retry
would result in an observable that repeats forever. - An undocumented behavior where passing a negative count argument to
repeat
would result in an observable that repeats forever. - The static
sortActions
method onVirtualTimeScheduler
is no longer publicly exposed by our TS types.
throwError: In an extreme corner case for usage,
throwError
is no longer able to emit a function as an error directly. If you need to push a function as an error, you will have to use the factory function to return the function like so:throwError(() => functionToEmit)
, in other wordsthrowError(() => () => console.log('called later'))
.
-
v7.0.0-beta.4 Changes
August 02, 2020๐ Bug Fixes
- ajax: Partial observers passed to
progressSubscriber
will no longer error (25d279f) - ajax: Unparsable responses will no longer prevent full AjaxError from being thrown (605ee55)
- animationFrames: emit the timestamp from the rAF's callback (#5438) (c980ae6)
- Ensure unsubscriptions/teardowns on internal subscribers are idempotent (#5465) (3e39749), closes #5464
- โฑ timeout: defer error creation until timeout occurs (#5497) (3be9840), closes #5491
๐จ Code Refactoring
- ajax: Drop support for IE10 and lower (0eaadd6)
- Observable: Update property and method types (#5572) (144b626)
๐ Features
- โ combineLatest: support for observable dictionaries (#5022) (#5363) (f5278aa)
- โฑ TestScheduler: add an animate "run mode" helper (#5607) (edd6731)
- โฑ timeout: One timeout to rule them all (def1d34)
๐ฅ BREAKING CHANGES
- ajax: In an extreme corner-case... If an error occurs, the responseType is
"json"
, we're in IE, and theresponseType
is not valid JSON, theajax
observable will no longer emit a syntax error, rather it will emit a fullAjaxError
with more details. - ajax: Ajax implementation drops support for IE10 and lower. This puts us in-line with other implementations and helps clean up code in this area
- Observable:
lift
no longer exposed. It was NEVER documented that end users of the library should be creating operators usinglift
. Lift has a variety of issues and was always an internal implementation detail of rxjs that might have been used by a few power users in the early days when it had the most value. The value oflift
, originally, was that subclassedObservable
s would compose through all operators that implemented lift. The reality is that feature is not widely known, used, or supported, and it was never documented as it was very experimental when it was first added. Until the end of v7,lift
will remain on Observable. Standard JavaScript users will notice no difference. However, TypeScript users might see complaints aboutlift
not being a member of observable. To workaround this issue there are two things you can do: 1. Rewrite your operators as outlined in the documentation, such that they returnnew Observable
. or 2. cast your observable asany
and accesslift
that way. Method 1 is recommended if you do not want things to break when we move to version 8.
- ajax: Partial observers passed to
-
v7.0.0-beta.3 Changes
July 30, 2020๐ Bug Fixes
- perf: Ensure unsubscriptions/teardowns on internal subscribers are idempotent (#5465) (3e39749), closes #5464
- โฑ timeout: defer error creation until timeout occurs (#5497) (3be9840), closes #5491
๐จ Code Refactoring
- perf: Reduce memory pressure by no longer retaining outer values across the majority of operators. (#5610) (bff1827)
- Observable: Update property and method types (#5572) (144b626)
๐ Features
๐ฅ BREAKING CHANGES
- Observable:
lift
no longer exposed. It was never documented that end users of the library should be creating operators usinglift
. Lift has a variety of issues and was always an internal implementation detail of rxjs that might have been used by a few power users in the early days when it had the most value. The value oflift
, originally, was that subclassedObservable
s would compose through all operators that implemented lift. The reality is that feature is not widely known, used, or supported, and it was never documented as it was very experimental when it was first added. Until the end of v7,lift
will remain on Observable. Standard JavaScript users will notice no difference. However, TypeScript users might see complaints aboutlift
not being a member of observable. To workaround this issue there are two things you can do: 1. Rewrite your operators as outlined in the documentation, such that they returnnew Observable
. or 2. cast your observable asany
and accesslift
that way. It is recommended that operators be implemented in terms of functions that return(sourcc: Observable<T>) => new Observable<R>(...)
, per the documentation/guide.
-
v7.0.0-beta.2 Changes
July 03, 2020 -
v7.0.0-beta.15 Changes
March 31, 2021 -
v7.0.0-beta.14 Changes
March 30, 2021๐ Bug Fixes
๐ Features
- ajax: Now allows configuration of query string parameters, via a
params
option in the request configuration (#6174) (980f4d4) - esm: Added exports within package.json to enable scoped package loading. (#6192) (33a9f06), closes sveltejs/kit#612 nodejs/node#27408
- ReadableStreams: RxJS now supports conversions for ReadableStreams e.g.
from(readableStream)
. (#6163) (19d6502)
- ajax: Now allows configuration of query string parameters, via a
-
v7.0.0-beta.13 Changes
March 15, 2021๐ Bug Fixes
- fromEvent: throw if passed invalid target (#6136) (317ba0c), closes #5823
- โ remove misused type parameter from static pipe (#6119) (8dc7d17), closes #5557
- Subscriber: don't leak destination (#6116) (5bba36c)
- โ combineLatest: POJO signature should match only ObservableInput values (#6103) (d633494)
- forkJoin: POJO signature should match only ObservableInput values (#6095) (566427e)
- predicates that return
any
will now behave property with findIndex (#6097) (c6f73d6) - โ remove misused type parameter from isObservable (#6083) (f16b634)
- โฑ unhandled errors in observers correctly scheduled (#6118) (c02ceb7)
- 0๏ธโฃ defaultIfEmpty: Allow
undefined
as an argument, require an argument (4983760), closes #6064 - elementAt: Allow
defaultValue
ofundefined
. (5bc1b3e) - first: Allow
defaultValue
ofundefined
. (62a6bbe) - last: Allow
defaultValue
ofundefined
. (ef3e721)
๐ Features
- โ
rename and alias
combineLatest
ascombineLatestAll
for consistency (#6079) (42cee80), closes #4590
๐ฅ BREAKING CHANGES
- 0๏ธโฃ defaultIfEmpty:
defaultIfEmpty
requires a value be passed. Will no longer convertundefined
tonull
for no good reason.