ObaidUrRehman / ng-drag-drop

Drag & Drop for Angular - based on HTML5 with no external dependencies. :tada:
MIT License
239 stars 123 forks source link

Errors with Angular v6 and RxJS v6 #132

Closed Kiougar closed 6 years ago

Kiougar commented 6 years ago

Issue

When upgrading to Angular v6 (which uses RxJS v6) the following errors appear because of breaking changes introduced with RxJS v6.

ERROR in ./node_modules/ng-drag-drop/src/directives/droppable.directive.js
Module not found: Error: Can't resolve 'rxjs/Observable' in './node_modules/ng-drag-drop/src/directives'
ERROR in ./node_modules/ng-drag-drop/src/services/ng-drag-drop.service.js
Module not found: Error: Can't resolve 'rxjs/Subject' in './node_modules/ng-drag-drop/src/services'
ERROR in ./node_modules/ng-drag-drop/src/directives/droppable.directive.js
Module not found: Error: Can't resolve 'rxjs/add/observable/of' in './node_modules/ng-drag-drop/src/directives'
ERROR in ./node_modules/ng-drag-drop/src/directives/droppable.directive.js
Module not found: Error: Can't resolve 'rxjs/add/operator/map' in './node_modules/ng-drag-drop/src/directives'

Workaround

Install a temporary compatibility library:

npm install rxjs@6 rxjs-compat@6 --save

Solution

Use rxjs-tslint to refactor TypeScript code so that it doesn't depend on rxjs-compat:

npm i -g rxjs-tslint
rxjs-5-to-6-migrate -p [path/to/tsconfig.json]

Here is the complete migration guide from rxjs v5.x to v6: https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md#rxjs-v5x-to-v6-update-guide

Contribution

Let me know if you need help doing the necessary changes.


Angular version: 6.0.0 Angular CLI Version: 6.0.0 RxJS version: 6.1.0 Typescript version: 2.7.2

scic commented 6 years ago

Since the PR is merged. Is there anything left for a release of the Angular 6 support without rxjs-compat?

nazarioa commented 6 years ago

what @scic said, I would like to help move this along

cole21771 commented 6 years ago

Anybody know when this will be merged to master / released?

ObaidUrRehman commented 6 years ago

Sorry for the delay on this. I will build by end of the week. In the meantime, if anyone wants to take a stab at it I'll be happy to add him as a collaborator.

cole21771 commented 6 years ago

@ObaidUrRehman oof ^

cole21771 commented 6 years ago

@ObaidUrRehman Come on man, it's been 8 days since you said you'd get to merging to master. I would really like to use your library in my project!

ObaidUrRehman commented 6 years ago

Sorry for the delay on this one Guys. Just published v5.0.0