Kendo-angular: RFC: Upgrade to RxJS 5.5

Created on 22 Jan 2018  路  8Comments  路  Source: telerik/kendo-angular

RxJS 5.5 introduces a new way to import operators, namely pipeable operators n茅e lettable operators. This new way to import operators improves module isolation and helps reduce bundle size.

Pipeable operators are only partially compatible with previous versions, particularly static methods like Obserbable.merge can lead to build errors when imported globally. See ReactiveX/rxjs#3222, #1214, #1230, #1236.

To remedy this situation, I propose to:

  1. Update the peer dependencies of affected @progress/kendo-* packages to require "rxjs": "<5.5.0"
  2. Release a major version of affected @progress/kendo-* packages that require "rxjs": "^5.5.0" and utilize pipeable operators.
  3. Tag all Angular 4 LTS compatible package versions. You will be able to get the latest LTS-compatible version by specifying "ng4" as a version. _Edit: No tags needed, packages remain compatible with Angular LTS, you just need to use rxjs > 5.5_

Please note:

  • Affected packages can be seen in the issue labels
  • The previous major version will not receive updates and users are urged to update to rxjs 5.5 before updating to new Kendo UI package versions.

/cc @rusev @rkonstantinov @gyoshev @ggkrustev @tapopov @valchev @danielkaradachki @raisolution


_white space reserved for a rant on breaking changes in minor releases_

Breaking Change Enhancement buttons charts date-inputs dialog dropdowns grid inputs layout popup resize-sensor treeview upload

Most helpful comment

All packages have been updated to use the new pipeable operators from RxJS 5.5+

This is a full list of the updated packages and their current version:

| Package | Versions
| ------- | --------
| kendo-angular-buttons | ^3.0.1
| kendo-angular-charts | ^2.0.0
| kendo-angular-dateinputs | ^2.0.0
| kendo-angular-dialog | ^3.0.0
| kendo-angular-dropdowns | ^2.0.0
| kendo-angular-grid | ^2.0.0
| kendo-angular-inputs | ^2.0.0
| kendo-angular-layout | ^2.0.0
| kendo-angular-popup | ^2.0.0
| kendo-angular-resize-sensor | ^3.0.0
| kendo-angular-treeview | ^2.0.0
| kendo-angular-upload | ^3.0.0

It's highly recommended that you update to these versions if your project is already on the latest rxjs. In addition, older versions will output a warning when used with RxJS 5.5:

WARN xxxx requires a peer of rxjs@^5 <5.5 but none is installed. You must install peer dependencies yourself.

As always, you can use npm outdated to inspect your project dependencies for updates.

All 8 comments

I do believe that upgrading to rxjs@^5.5.x is inevitable. I suppose that we can introduce a breaking change along with the Angular@6 release.

I am not sure how we should proceed with the Angular LTS release. Probably we should also have 2 versions of the packages. What do you think?

The Angular 6 release will lead to another major version bump for all packages, but this is not directly related to the RxJS issue.

We need a fix for Angular 5.x LTS. It has been using RxJS 5.5 since it became available, but we didn't notice the issues as they only pop up when the build optimizer is enabled. The Angular CLI enables the build-optimizer by default in version 1.6.1 and later.

More bad news. Due to angular/angular-cli#9069, pipeable operators will include the full RxJS library.

Depending on your use case the difference can be quite significant. In my test project this adds around 100kB to the download size:

With global operators, RxJS ~ 52kB gzipped
image

With pipeable operators, RxJS ~ 125kB gzipped
image

With this in mind, the benefit from migrating to pipeable operators is lost. It makes more sense to wait for the bundling issue to be resolved. This might defer this fix to the Angular 6 release time frame.

My recommendation is to disable the build optimizer for the time being:
ng build --prod --build-optimizer=false

EDIT: See following response

Okay, so that was a bit rushed. The solution was to import individual operators:

import { map } from 'rxjs/operators/map'; instead of
import { map } from 'rxjs/operators';

image

Definitely following this one closely :-) #goteamtelerik

Is this being done as a break fix or is there a work around for the current kendo release? We implemented the latest kendo library and have a prod production date with it, but cannot do our prod build.

What previous version of the library will work?

@mikemwalsh it will be a breaking change, resulting in a major version bump. Otherwise we'll break users with rxjs < 5.5 that don't have pipeable operators.

The workaround is to disable the build optimizer:
ng build --prod --build-optimizer=false

All packages have been updated to use the new pipeable operators from RxJS 5.5+

This is a full list of the updated packages and their current version:

| Package | Versions
| ------- | --------
| kendo-angular-buttons | ^3.0.1
| kendo-angular-charts | ^2.0.0
| kendo-angular-dateinputs | ^2.0.0
| kendo-angular-dialog | ^3.0.0
| kendo-angular-dropdowns | ^2.0.0
| kendo-angular-grid | ^2.0.0
| kendo-angular-inputs | ^2.0.0
| kendo-angular-layout | ^2.0.0
| kendo-angular-popup | ^2.0.0
| kendo-angular-resize-sensor | ^3.0.0
| kendo-angular-treeview | ^2.0.0
| kendo-angular-upload | ^3.0.0

It's highly recommended that you update to these versions if your project is already on the latest rxjs. In addition, older versions will output a warning when used with RxJS 5.5:

WARN xxxx requires a peer of rxjs@^5 <5.5 but none is installed. You must install peer dependencies yourself.

As always, you can use npm outdated to inspect your project dependencies for updates.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tsvetomir picture tsvetomir  路  32Comments

JaapMosselman picture JaapMosselman  路  28Comments

masterjs picture masterjs  路  25Comments

djarekg picture djarekg  路  18Comments

dassjosh picture dassjosh  路  23Comments