Skip to content

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented May 17, 2017

Breaking Changes!!

  • Updates to TS 2.1
  • Eliminates duplicate class helpers in every CJS output file
  • adds tslib
  • No longer exporting any Error subclasses, rather there are utility functions to create Errors, and to test if an error is a specific type.
  • Requires that Symbol is properly shimmed

@benlesh
Copy link
Member Author

benlesh commented May 17, 2017

I'm honestly not entirely sure I did this properly, but the tests are running okay, and I don't see the duplicate __extends methods in the build output.

cc @IgorMinar @kwonoj

@kwonoj
Copy link
Member

kwonoj commented May 17, 2017

In my blur memory our global build did manually import tslib something similar while bundling via rollup, not sure if it still exists and need to be updated?

@coveralls
Copy link

coveralls commented May 17, 2017

Coverage Status

Coverage increased (+0.0003%) to 97.735% when pulling 74a875d on benlesh:noEmitHelpers into cf88a20 on ReactiveX:master.

@benlesh
Copy link
Member Author

benlesh commented May 17, 2017

@kwonoj are you talking about this?

I honestly don't remember what that's doing or why. :\ If no one remembers, I guess I'll have to dig in.

@kwonoj
Copy link
Member

kwonoj commented May 17, 2017

@benlesh yes, these 3 are history of those .

#2064
#2093
#2121

kwonoj
kwonoj previously requested changes May 18, 2017
Copy link
Member

@kwonoj kwonoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benlesh so looking basically it looks harmless to global build (it was using tslib already) but only need to update https://github.com/benlesh/RxJS/blob/74a875d15ca5d3d89588dba94b6f47e1b772fc07/package.json#L192 this, should remove duplication as new change makes tslib to dependencies.

@@ -1,4 +1,6 @@
/* tslint:disable:no-unused-variable */
import 'tslib';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this just so that we bring in the helpers for the umd file?

tsconfig.json Outdated
{
"compilerOptions": {
"importHelpers": true,
"noEmitHelpers": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that you need noEmitHelpers, importHelpers should be sufficient.

package.json Outdated
"compile_dist_es6_for_docs": "tsc ./dist/es6/src/Rx.ts ./dist/es6/src/add/observable/of.ts ./dist/es6/src/MiscJSDoc.ts -m es2015 --sourceMap --outDir ./dist/es6 --target ES6 -d --diagnostics --pretty --noImplicitAny --noImplicitReturns --noImplicitThis --suppressImplicitAnyIndexErrors --moduleResolution node",
"cover": "shx rm -rf dist/cjs && tsc src/Rx.ts src/add/observable/of.ts -m commonjs --lib es5,es2015.iterable,es2015.collection,es2015.promise,dom --outDir dist/cjs --sourceMap --target ES5 -d && nyc --reporter=lcov --reporter=html --exclude=spec/support/**/* --exclude=spec-js/**/* --exclude=node_modules mocha --opts spec/support/default.opts spec-js",
"compile_dist_cjs": "tsc ./dist/cjs/src/Rx.ts ./dist/cjs/src/add/observable/of.ts -m commonjs --lib es5,es2015.iterable,es2015.collection,es2015.promise,dom --noEmitHelpers --sourceMap --outDir ./dist/cjs --target ES5 -d --diagnostics --pretty --noImplicitAny --noImplicitReturns --noImplicitThis --suppressImplicitAnyIndexErrors --moduleResolution node",
"compile_module_es6": "tsc ./dist/es6/src/Rx.ts ./dist/es6/src/add/observable/of.ts -m es2015 --noEmitHelpers --sourceMap --outDir ./dist/es6 --target ES5 -d --diagnostics --pretty --noImplicitAny --noImplicitReturns --noImplicitThis --suppressImplicitAnyIndexErrors --moduleResolution node --noEmitHelpers --lib es5,es2015.iterable,es2015.collection,es2015.promise,dom ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this right? shouldn't this be importHelpers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️

What I found online said noEmitHelpers. I'll try it the other way around.

@@ -1,5 +1,7 @@
{
"compilerOptions": {
"importHelpers": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importHelpers requires TypeScript v2.1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, thanks... I'm going to attempt to update TS...

Sadly, that makes this a breaking change. :(

@rxjs-bot
Copy link

rxjs-bot commented May 24, 2017

Fails
🚫 missing type definition import in tests (skipLast-spec.ts) (1)

(1) : It seems updated test cases uses test scheduler interface hot, cold but miss to import type signature for those.

Generated by 🚫 dangerJS

@staltz
Copy link
Member

staltz commented May 24, 2017

Don't fear the major number ;)

- adds `tslib` import to `Rx.ts`
- adds `--noEmitHelpers` to build output

closes #2605
benlesh added 2 commits May 24, 2017 13:24
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
@benlesh benlesh dismissed kwonoj’s stale review May 24, 2017 20:26

tslib updated to 1.7

@benlesh
Copy link
Member Author

benlesh commented May 24, 2017

FWIW: I move that this can be the first RxJS 6 alpha or beta once merged, and we can start looking at merging some of the other changes for the next major sitting in our queue. As long as the breaking changes aren't too fast.

@benlesh benlesh changed the title refactor(Rx): stop duplicating TS class helpers in each CJS file Update to TypeScript 2.1, Update Errors, Breaking Changes! May 24, 2017
@benlesh
Copy link
Member Author

benlesh commented May 25, 2017

Closing in favor of #2614

@benlesh benlesh closed this May 25, 2017
@lock
Copy link

lock bot commented Jun 6, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants