Closed alexeybondarenko closed 5 years ago
Thanks, looks fine to me. However, have you come across rxjs-compat? I think it might help you decrease your bundle size and save you the trouble of manually changing your package.lock
.
I didn't try, because It's difficult to fully migrate my app to v6. I'm using Ionic3 with Angular 5. Ionic4 uses Angular >6 and it would be easy to use Akita with it. But Ionic3 -> Ionic4 migration is too time costly (they have re-written all components from scratch and I have to re-assemble app with new components).
That's the whole point of the library. It provides you with the ability to have both RxJS v5 and v6 in the application.
Yes, I know. But I've seen that they don't have the full compatibility using rxjs-compat. That is why I didn't even try to use it. You know, my main framework (angular) is using rxjs@5 and several libraries are using v6. I don't want to risk using v6 with rxjs-compat. As I said, bundle size is not critical for my mobile app)
No problem 😃. Feel free to join Akita's Gitter channel for any question you have.
@alexeybondarenko can you please share the folder structure of your project with examples in git?
It's not a bug or feature request. :)
I've created this issue to describe how to run Akita 3 with Angular 5 (Ionic 3). This solution works fine for me, and I would be grateful for your feedback.
The trouble is in RxJS version: Angular 5 is using RxJS@5, then Akita 3 requires RxJS@6. RxJS is a utility library, and I can use two versions for different modules at the same time. The cons are that the bundle size will increase. But I'm creating a mobile app and size is not so important as for websites.
Examples are for package-lock.json.
My builder is using fesm5 version. So I've patched
node_modules/@datorama/akita/fesm5/datorama-akita.js
file.Let's save the patch to apply for other collaborators https://www.npmjs.com/package/patch-package
After generating state module with Akita CLI you have to remove { provideIn: 'root' } from Injector declarations and add your state providers to imports. I'm creating a module for each store and I have stores.module.js that integrates them in the single module.
I'm happy that I can use Akita in my app. It's super easy to use, and I like the approach that you use creating it.