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

Support for RxJS 6, Angular 6 #72

Closed
Nosfistis opened this issue May 9, 2018 · 26 comments
Closed

Support for RxJS 6, Angular 6 #72

Nosfistis opened this issue May 9, 2018 · 26 comments
Labels
enhancement important The important task

Comments

@Nosfistis
Copy link

Currently it is not possible to use this with Angular 6 since the rxjs operators follow the old 'rxjs/add/operator/' syntax. It has been deprecated and in RxJS 6 it is now removed, making the migration impossible.

Any chance to update imports? This should be trivial, but might drop some Angular 4 support.

@optimistex
Copy link
Owner

Addon from the user @ChandraTerli
#6 (comment)
And below on the topic...

@Nosfistis
Copy link
Author

I bypassed this issue using rxjs-compat for now, which is supposed to provide migration until RxJS 7.

@optimistex
Copy link
Owner

Cool. You are have the solution and I have more time to put this enhance in my schedule.

@rlefever68
Copy link

rxjs-compat is not working for me, unfortunately. I get " Fatal Error this.subjExternalValue.map is not a function".. using rxjs-compat 6.2.0

@scotteby
Copy link

I get the same error as @rlefever68, but only when I run in production mode.

In dev mode, I don't get any errors with rxjs-compat 6.2.0

@optimistex
Copy link
Owner

optimistex commented Jun 20, 2018

Today I upgraded my general project and I don't note any issues between the ngx-select-ex and Angular 6.
Now I have installed "rxjs-compat": "^6.2.1".

Looks like the issue is not actual. Closed.


If it is still actual let me know how to reproduce it.
Just check the example: https://stackblitz.com/edit/ngx-select-ex-example-formcontrol-ng6?file=app/app.component.ts
Fork it and show the issue.

@Nosfistis
Copy link
Author

The issue is still valid. I have v3.5.9 installed and the imports do not comply with rxjs v6.

rxjs-compat is supposed to be a stepping stone before completely moving to rxjs v6, and it will not work on rxjs v7. You can check more details about the migration here: https://github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/v6/migration.md

If needed I can issue a PR with the required changes.

@scotteby
Copy link

scotteby commented Jun 20, 2018 via email

@optimistex
Copy link
Owner

I build so ng build and already use in production.
All it is ok.

But. The component is still on Angular 5. Little late I'll upgrade it for Angular 6.

Currently, I do not see the issue.

@optimistex optimistex reopened this Jun 20, 2018
@Nosfistis
Copy link
Author

For a quick adjustment (although this is an easy transition) you can list rxjs-compat in the dependencies list of the module in package.json, so that it is installed.

@scotteby
Copy link

@optimistex , I'm using webpack, not ngbuild, and webpack in production mode gives me the error I mentioned earlier. I created a test project using ng build and noticed I don't see the errors.

I will track down the exact webpack configuration issue causing this, but we will still need a code change so that we can eventually remove the rxjs-compat library and have proper rxjs 6 support. Thanks for testing it.

@scotteby
Copy link

Just in case anyone is trying to get this working with Webpack 4, you need to disable the sideEffects optimization in production mode.

optimization: { sideEffects: false }

@galvakojis
Copy link

galvakojis commented Jul 10, 2018

ERROR in node_modules/ngx-select-ex/ngx-select/ngx-select.component.d.ts(4,10): error TS2305: Module '"/frontend/project/node_modules/rxjs/BehaviorSubject"' has no exported member 'BehaviorSubject'.
frontend_1    | node_modules/rxjs/BehaviorSubject.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/BehaviorSubject'.

Maybe any ideas, how to resolve it?
change this
import { BehaviorSubject } from 'rxjs/BehaviorSubject';

to this?
import {BehaviorSubject} from "rxjs/index";

@pktron
Copy link

pktron commented Jul 31, 2018

rxjs compatibility worked for me...
npm install --save rxjs-compat

But is gonna be deprecated on rxjs 7...

@queejie
Copy link

queejie commented Aug 21, 2018

Can you let folks know when it is ready for rxjs 6, without the rxjs-compat module? Thank you.

@ravenwill
Copy link

ravenwill commented Sep 3, 2018

I'm using rxjs-compat module but i have this error in console

ERROR TypeError: rxjs_Observable__WEBPACK_IMPORTED_MODULE_5__.Observable.from is not a function
at MergeMapSubscriber.project (ngx-select-ex.es5.js:250)

@Redlobster74
Copy link

Redlobster74 commented Sep 6, 2018

@optimistex the solution from @galvakojis fixes the compilation issue when rxjs-compat isn't used.
To be more precise I would change that line into:

import {BehaviorSubject} from "rxjs";

Is there any chance you can push this small update so everybody can start use your library without rxjs-compat?

@prikryl
Copy link

prikryl commented Sep 18, 2018

@ravenwill
downgrade compat library. It seems to be broken

    "rxjs": "^6.3.2",
    "rxjs-compat": "6.2.2",

@Disane87
Copy link

@ravenwill
downgrade compat library. It seems to be broken

    "rxjs": "^6.3.2",
    "rxjs-compat": "6.2.2",

This solved our problems with the error ERROR TypeError: rxjs_Observable__WEBPACK_IMPORTED_MODULE_5__.Observable.from is not a function at MergeMapSubscriber.project (ngx-select-ex.es5.js:250) too

@DanniB
Copy link

DanniB commented Sep 18, 2018

Please fix this. I want to get rid of rxjs-compat. Otherwise, I'm forced to switch to ng-select:

https://github.com/ng-select/ng-select

@Stan92
Copy link

Stan92 commented Sep 24, 2018


  "rxjs": "^6.3.2",
  "rxjs-compat": "6.2.2",

Doesn't work for me.

@sabariU
Copy link

sabariU commented Sep 27, 2018

@ravenwill
downgrade compat library. It seems to be broken

    "rxjs": "^6.3.2",
    "rxjs-compat": "6.2.2",

It works for me. Thanks

@optimistex
Copy link
Owner

optimistex commented Oct 28, 2018

The component has upgraded in the 3.6.1 release to the latest Angular: https://github.com/optimistex/ngx-select-ex/releases/tag/3.6.1

@prikryl
Copy link

prikryl commented Oct 28, 2018

you are still using compat package, which you should not, if code is fully migrated to rxjs6.
https://github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/v6/migration.md
"rxjs-compat": "^6.3.3",

this causes:

ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/observable/empty' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/observable/from' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/observable/of' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/combineLatest' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/distinctUntilChanged' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/do' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/filter' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/map' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/merge' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/mergeMap' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/share' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
ERROR in ./node_modules/ngx-select-ex/fesm5/ngx-select-ex.js
Module not found: Error: Can't resolve 'rxjs/add/operator/toArray' in 'C:\dev\workspace\idea\xxxx-slot-4\xxxx\xxxx-static\node_modules\ngx-select-ex\fesm5'
i 「wdm」: Failed to compile.

Could you remove this dependency and migrate code to RxJS6 ?

@optimistex optimistex reopened this Oct 28, 2018
@prikryl
Copy link

prikryl commented Oct 30, 2018

I have tried to create pull request (I don't known if it is correct to use fork and pull request). valor-software#971
Could you check it? I fixed imports and switchted to pipes om few lines and package.json.
Thank you

@optimistex
Copy link
Owner

optimistex commented Oct 30, 2018

@prikryl Fixed in the development version. Soon will be in a release...
Try it: npm i ngx-select-ex@dev

I have tried to create pull request (I don't known if it is correct to use fork and pull request). valor-software#971
Could you check it? I fixed imports and switchted to pipes om few lines and package.json.
Thank you

You have to make a pull request into my fork.
By the way, I did the changes... So, you can check and let me know if something wrong.

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

No branches or pull requests