-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Update TS: Alternative Error Fix #2614
Conversation
- adds `tslib` import to `Rx.ts` - adds `--noEmitHelpers` to build output closes #2605
BREAKING CHANGE: The following types no longer exist: `EmptyError`, `UnsubscriptionError`, `ArgumentOutOfRangeError`, `ObjectUnsubcribedError`, `TimeoutError`, `AjaxError`, `AjaxTimeoutError`. There are now utilities for creating and testing under `Rx.Util` for example: `Rx.Util.createTimeoutError()` and `Rx.Util.isTimeoutError(err)` etc. closes #2612 related #2582
This reverts commit 13767c3.
BREAKING CHANGE: IE10 and lower will need to polyfill `Object.setPrototypeOf`
Generated by 🚫 dangerJS |
- updates `responseType` in ajax observable area to be `XMLHttpRequestResponseType` BREAKING CHANGE: TypeScript 2.3 now required BREAKING CHANGE: `AjaxRequest`'s `responseType` property is now `XMLHttpRequestResponseType` rather than `string` to support TS 2.3
TypeScript now distributes typings via npm.
Fix buffer operator not emitting the last buffer when the source completes. This is closer to rxjs v4* behaviour and matches the behaviour of the other buffer operators. The _complete method is very similar to thoses in bufferCount, bufferTime and bufferWhen. *rxjs v4 will always emit the buffer if the source completes even if the buffer is empty. This fix only emits if the buffer is non empty. BREAKING CHANGE: The `buffer()` operator now emits what's partially buffered when the source completes. This is closer to rxjs v4* behaviour and matches the v5 behaviour of the other buffer operators.
@@ -5,6 +5,7 @@ import { Observable } from '../../Observable'; | |||
import { Subscriber } from '../../Subscriber'; | |||
import { TeardownLogic } from '../../Subscription'; | |||
import { MapOperator } from '../../operator/map'; | |||
import 'tslib'; |
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.
don't need this
@@ -1,4 +1,6 @@ | |||
/* tslint:disable:no-unused-variable */ | |||
import 'tslib'; |
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.
don't need this either
The failure from It's failing when trying to This is the example from the README that's failing: import Rx from 'rxjs/Rx';
Rx.Observable.of(1,2,3) After being compiled by babel this is how it looks: var _Rx = require('rxjs/Rx');
var _Rx2 = _interopRequireDefault(_Rx);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_Rx2.default.Observable.of(1, 2, 3); This started breaking with TypeScript 2.3 because now This line now appears at the top of the compiled output: Object.defineProperty(exports, "__esModule", { value: true }); Arguably this is reasonable behaviour, as I'm unsure why One possible fix is to change Another would be to export a default, but that seems like it would be a lot of duplication. I think this failure is indicative of a problem that could impact real users. I know TypeScript is strict about importing using that syntax from modules with no default. I think in the past |
Thanks @Widdershin ... I think we can actually just make that change. It's only in two spots I believe. |
- had to had new tslint rules specific for tests to disable no-unused-expression because it didn't like the chai assertions such as `expect(foo).to.be.true`, as it wanted `true` to be set or called as a function
Error.stack can potentially trigger expensive prepareStackTrace calls, Observable.timeout would crate a TimeoutError on use, before the actual error occurs. This eases tracing the location of the timeout, but with the current implementation, slows down the application when using many .timeout operators throughout the code. Manual cherry-pick of ReactiveX#2614 commit d242156
Error.stack can potentially trigger expensive prepareStackTrace calls, Observable.timeout would crate a TimeoutError on use, before the actual error occurs. This eases tracing the location of the timeout, but with the current implementation, slows down the application when using many .timeout operators throughout the code. Manual cherry-pick of ReactiveX#2614 commit d242156
Error.stack can potentially trigger expensive prepareStackTrace calls, Observable.timeout would crate a TimeoutError on use, before the actual error occurs. This eases tracing the location of the timeout, but with the current implementation, slows down the application when using many .timeout operators throughout the code. Manual cherry-pick of ReactiveX#2614 commit d242156
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is the same as #2606, but updates the custom error classes to use
setPrototypeOf
Pros:
instanceof
still worksCons:
Object.setPrototypeOf
polyfill.setPrototypeOf
creates a "slow object" in V8... deoptimized as a hashtable, to my understanding.Other things:
The
Object.setPrototypeOf
polyfill is trivial:cc @trxcllnt