angular-redux / store

Angular 2+ bindings for Redux
MIT License
1.34k stars 205 forks source link

Does a support for Angular 6 is planned ? #525

Closed Blair2004 closed 6 years ago

Blair2004 commented 6 years ago

This is a...

What toolchain are you using for transpilation/bundling?

Environment

NodeJS Version: 8.11.1 Typescript Version: 2.7.2 Angular Version: 6.0.0 ngular-redux/store version: 7.1.1 @angular/cli version: 6.0.0 OS: Windows 10

Link to repo showing the issus

(optional, but helps a lot)

Expected Behaviour:

I'm wondering if the support of Angular 6 is planned. It seems like the version 7.1.1 as a compatibility issue with RxJS 6.0

Actual Behaviour:

There are some various errors.

ERROR in node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(37,14): error TS2416: Property 'dispatch' in type 'NgRedux<RootState>' is not assignable to the same property in base type 'ObservableStore<RootSta>' is not assignable to the same property in base type 'ObservableStore<RootState>'.
  Type 'Dispatch<RootState>' is not assignable to type 'Dispatch<AnyAction>'.
    Type 'RootState' is not assignable to type 'AnyAction'.
node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(37,33): error TS2344: Type 'RootState' does not satisfy the constraint 'Action<any>'.n<any>'.                                                                                                                                        ion<any>'.
node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(18,24): error TS2344: Type 'RootState' does not satisfy the constraint 'Act; }>'. Did you mean 'subscribe'?ion<any>'.

Stack Trace/Error Message:

Additional Notes:

(optional)

stochris commented 6 years ago

That error comes from using redux v4, not from angular 6. However, due to the new rxjs version, which changes the import paths, this doesn't work with the angular version.

Are there any plans to support it ? ( I could work on a PR if yes )

Blair2004 commented 6 years ago

@stochris i wasn't saying that the error comes from Angular 6, but using the currently version of angular-redux/store 7.1.1 actually crash with Angular 6. I was also planning to check if i can have the issue solved from my end (Forked already). I'll see first if somebody has yet been working on that.

stochris commented 6 years ago

@Blair2004 I can confirm it crashed with angular 6, but the error you posted is due to types differences between redux 3 and 4 šŸ˜„. You can fix it by downgrading redux to v3.

Blair2004 commented 6 years ago

hummm... here is what i got :

TypeError: f is not a function
    at compose.js:20
    at Array.reduceRight (<anonymous>)
    at compose.js:19
    at RootStore._this.configureStore (root-store.js:37)
    at new AppModule (app.module.ts:102)
    at _createClass (core.js:9277)
    at _createProviderInstance$1 (core.js:9255)
    at initNgModule (core.js:9191)
    at new NgModuleRef_ (core.js:9907)
    at createNgModuleRef (core.js:9896)
stochris commented 6 years ago

Oh, ok. When I tried using angular 6, I got some errors about observables and their operators being undefined

Blair2004 commented 6 years ago

Lol... i just wanted to test Angular Element... bad move... anyway, i'll try to fix on the package (maybe updating the syntax for RxJS )

actra-gschuster commented 6 years ago

https://github.com/angular-redux/store/pull/527

@SethDavenport @e-schultz @wbuchwalter

shinigamiCZ commented 6 years ago

Workaround for using it with Angular 6: Just install rxjs-compat package next to angular-redux. It will add neccessary import paths for modules dependent on rxjs@5

iici-vsimha commented 6 years ago

We are moving to Angular 6.0 and Angular-cli and use @angular-redux/store. Please consider officially supporting the latest release of Angular 6.x. Thanks!

actra-gschuster commented 6 years ago

@iici-vsimha There's already a PR supporting ng6 waiting for review.

SethDavenport commented 6 years ago

Hi - I'll try to take a look this weekend. Thanks.

ckrasi-old commented 6 years ago

Any progress on making it work with Redux 4 (and thus ng 6) ?

alaindeurveilher commented 6 years ago

@ckrasi-acx Can't you see that there is already the PR #527 attached to this issue? :-)

ckrasi-old commented 6 years ago

Yes, I see, but it failed on tests 9 days ago. I wasn't asking whether any work has started on it, I was asking about progress. It would be great if someone could finish this PR and release new version.

actra-gschuster commented 6 years ago

OK, spent some time digging into it and CI finally passes, had to downgrade several deps and remove type hints due to those downgrades. Waiting for review by the maintainers @SethDavenport @e-schultz @wbuchwalter

SethDavenport commented 6 years ago

I have released @angular-redux/store@9.0.0-beta.0 with support for Angular 6. Give that a try and let me know if you run into any issues. This is based on actra-gschuster's PR, big thanks for that.

I am currently looking at how affected the sister packages (router, form) are by the Angular and RxJS changes; once I have a handle on that I'll publish v9 for real.

mircowidmer commented 6 years ago

Just tried out @angular-redux/store@9.0.0-beta.0 and it seems to be throwing some errors:

[2] ERROR in node_modules/@angular-redux/store/lib/src/components/fractal-reducer-map.d.ts(9,60): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/fractal-reducer-map.d.ts(9,86): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/fractal-reducer-map.d.ts(11,86): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/fractal-reducer-map.d.ts(13,87): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(25,44): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(40,44): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(42,82): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/observable-store.d.ts(37,73): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(13,35): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(13,101): error TS2315: Type 'Middleware' is not generic. [2] node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(13,157): error TS2314: Generic type 'StoreEnhancer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(14,27): error TS2314: Generic type 'Store<S>' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(17,35): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(20,80): error TS2314: Generic type 'Reducer' requires 1 type argument(s). [2] node_modules/@angular-redux/store/lib/src/decorators/helpers.d.ts(21,19): error TS2314: Generic type 'Reducer' requires 1 type argument(s).

I'm not raising a bug or anything, just wanted to point out that in my setup it doesn't work yet. Thanks for your work!

SethDavenport commented 6 years ago

@mircowidmer what version of redux are you using? One of the things store@9 adapts to is updated typedefs in redux v4

mircowidmer commented 6 years ago

I was using redux v3.7.2. After updating it to 4.0.0 and using @angular-redux/store@9.0.0-beta.0 everything worked perfectly, thanks!

iici-vsimha commented 6 years ago

Thank you very much for getting this done we will upgrade to 6 this weekend. Will let you know if we encounter any problems Regards, Vikram

Vikram Simha Founder & CEO, Informatics In Context, Inc. Ph : (781) 696-0827 One Boston Place, Suite 2600 Web: http://informaticsincontext.com/ Boston, MA 02108

This e-mail message, including any attachment, is privileged and confidential and is intended only for the recipient(s) listed above. If you are neither the intended recipient(s) nor a person responsible for the delivery of this email to the intended recipient(s), you are hereby notified that any unauthorized distribution or copying of this email is prohibited. If you receive this email in error, please notify Informatics In Context, Inc. immediately via email at info@informaticsincontext.commailto:info@informaticsincontext.com or by phone at (857) 400-8990.

On May 25, 2018, at 9:56 AM, Seth Davenport notifications@github.com<mailto:notifications@github.com> wrote:

@mircowidmerhttps://github.com/mircowidmer what version of redux are you using? One of the things store@9 adapts to is updated typedefs in redux v4

ā€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/angular-redux/store/issues/525#issuecomment-392065839, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AG7X5SIOBfKmRTM6Ti0wYV0kWjmqr437ks5t2A2TgaJpZM4T0gWN.

floschnell commented 6 years ago

I can confirm, upgrade to version 9.0 worked flawlessly.

SethDavenport commented 6 years ago

OK I'll move it out of beta tonight

GopinathKaliappan commented 6 years ago

Try This one https://github.com/GopinathKaliappan/angular6-redux