Skip to content
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

rxjs version bump to 6? #139

Closed
fijas opened this issue May 7, 2018 · 10 comments
Closed

rxjs version bump to 6? #139

fijas opened this issue May 7, 2018 · 10 comments

Comments

@fijas
Copy link

fijas commented May 7, 2018

Not able to update app to angular 6 as ng-dynamic-component depends on ^5.0.0 whereas angular 6 now depends on rxjs ^6.0.0...

@p3root
Copy link

p3root commented May 7, 2018

I would also need your module for angular 6 :)

@gund
Copy link
Owner

gund commented May 7, 2018

I think you can still safely update to v6 ignoring the npm warning. It's basically just a cosmetic thing in the package.json.

But yeah it's a good idea to update the version range =)

@gund
Copy link
Owner

gund commented May 7, 2018

Oh also all angular dependencies should be bumped to v6 range along with typescript version.

And that means that it should be published as a major release (as a breaking change).

@fijas
Copy link
Author

fijas commented May 8, 2018

Yes, you are right, it was just a warning that I was able to ignore. ng update was throwing out random errors which I thought was caused by this. In the end I had to update to version 6 manually. I used the instructions found here for that.

Yeah this will definitely require a major version release as that also keeps in line with your versioning scheme of having a new major release corresponding with each Angular major release...

@snowyu
Copy link

snowyu commented May 8, 2018

Get rid of npm warning is simple:

  "peerDependencies": {
    "@angular/common": ">=5.0.0",
    "@angular/core": ">=5.0.0",
    "rxjs": ">=5.0.0",
    "tslib": ">=1.0.0"
  },
 

But you should read this first RxJS v5.x to v6 Update Guide

Change from:

//rx5.x 
import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs/Subject';

TO:

//rx6.x 
import { takeUntil } from 'rxjs';
import { Subject } from 'rxjs';

@gund
Copy link
Owner

gund commented May 8, 2018

@snowyu thanks for sharing a link regarding rxjs.

Small note: pipeable operators should be still imported from rxjs/operators and not directly from rxjs.

Second, once I upgraded to Angular 6, tests that test dynamic attributes with ngComponentOutlet started to fail with weird error:

TypeError: Cannot read property 'ngInjectableDef' of null

      at resolveNgModuleDep (../../../../execroot/angular/packages/core/src/view/ng_module.ts:107:29)
      at NgModuleRef_.Object.<anonymous>.NgModuleRef_.get (../../../../execroot/angular/packages/core/src/view/refs.ts:502:12)
      at Object.resolveDep (../../../../execroot/angular/packages/core/src/view/provider.ts:416:43)
      at Injector_.Object.<anonymous>.Injector_.get (../../../../execroot/angular/packages/core/src/view/refs.ts:337:21)
      at new DynamicAttributesDirective (src/dynamic/dynamic-attributes.directive.ts:36:65)
      at createClass (../../../../execroot/angular/packages/core/src/view/provider.ts:278:7)
      at createDirectiveInstance (../../../../execroot/angular/packages/core/src/view/provider.ts:135:20)
      at createViewNodes (../../../../execroot/angular/packages/core/src/view/view.ts:303:28)
      at callViewAction (../../../../execroot/angular/packages/core/src/view/view.ts:636:7)
      at execComponentViewsAction (../../../../execroot/angular/packages/core/src/view/view.ts:559:7)
      at createViewNodes (../../../../execroot/angular/packages/core/src/view/view.ts:331:3)
      at createRootView (../../../../execroot/angular/packages/core/src/view/view.ts:210:3)
      at callWithDebugContext (../../../../execroot/angular/packages/core/src/view/services.ts:639:23)
      at Object.debugCreateRootView [as createRootView] (../../../../execroot/angular/packages/core/src/view/services.ts:121:10)
      at ComponentFactory_.Object.<anonymous>.ComponentFactory_.create (../../../../execroot/angular/packages/core/src/view/refs.ts:92:27)
      at initComponent (../../../../execroot/packages/core/testing/src/test_bed.ts:568:28)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:388:26)
      at AsyncTestZoneSpec.Object.<anonymous>.AsyncTestZoneSpec.onInvoke (node_modules/zone.js/dist/async-test.js:106:39)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/proxy.js:125:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:387:32)
      at Object.onInvoke (../../../../execroot/angular/packages/core/src/zone/ng_zone.ts:275:25)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:387:32)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/dist/zone.js:138:43)
      at NgZone.Object.<anonymous>.NgZone.run (../../../../execroot/angular/packages/core/src/zone/ng_zone.ts:173:50)
      at TestBed.Object.<anonymous>.TestBed.createComponent (../../../../execroot/packages/core/testing/src/test_bed.ts:572:56)
      at Function.Object.<anonymous>.TestBed.createComponent (../../../../execroot/packages/core/testing/src/test_bed.ts:201:25)
      at src/dynamic/dynamic-attributes.directive.spec.ts:48:25
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:388:26)
      at AsyncTestZoneSpec.Object.<anonymous>.AsyncTestZoneSpec.onInvoke (node_modules/zone.js/dist/async-test.js:106:39)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/proxy.js:125:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:387:32)
      at Zone.Object.<anonymous>.Zone.runGuarded (node_modules/zone.js/dist/zone.js:151:47)
      at runInTestZone (node_modules/zone.js/dist/async-test.js:234:29)
      at node_modules/zone.js/dist/async-test.js:168:17
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:388:26)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/dist/proxy.js:128:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:387:32)
      at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/dist/zone.js:138:43)
      at Object.testBody.length.done (node_modules/jest-zone-patch/index.js:51:29)

All other pieces of unit tests are passing so it's kind of a blocker...

It feels like something have changed in the angular internals and now modules used in tests are breaking when used with ngCoponentOutlet even though the directive itself did not change in angular.

Does anybody have any ideas what might be the cause?

@snowyu
Copy link

snowyu commented May 9, 2018

Here are: The Angular 6 Upgrade Guide.

@gund
Copy link
Owner

gund commented May 9, 2018

@snowyu thanks for the link, however I don't think there is something related to this error...

I think it is only happening in unit test but will have to verify by running in ng6 test app to be sure.

@kamilkisiela
Copy link
Contributor

Doing some work here, feel free to help

@gund gund closed this as completed in 393b739 May 16, 2018
@gund
Copy link
Owner

gund commented May 16, 2018

🎉 This issue has been resolved in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants