logux / logux

Issues and roadmap
https://logux.org/
102 stars 3 forks source link

Angular support #18

Open mrdimidium opened 4 years ago

mrdimidium commented 4 years ago

Based on the this tweet.

I need support for Angular projects. You have already taken the first step by creating bindings for TypeScript.

Unlike React and Vue, the Angular ecosystem does not have a recognized state library. However, we can say that the most popular solution is NgRx. A few numbers:

library weekly downloads
NgRx 265,219
NGXS 36,081
angular-mobx 24,153
Akita 22,211
angular-redux 16,829

To start using logux in angular projects, you need at least:

  1. Make a wrapper over ngrx;
  2. Add a decorator for subscribing to channels;
  3. Add schematic for `@angular/cli'.

It would also be incredibly cool to have integration with Angular Augury (SSR platform) and NativeScript (mobile apps, like RN).

--

What do you think about this?

ai commented 4 years ago

Do we have time travel in NgRx like we have in Redux?

mrdimidium commented 4 years ago

Yeah. For example, it uses NgRx store devtools.

mrdimidium commented 4 years ago

In general, ngrx is a "redux-like" library, with approximately the same functionality but additional reactive wrappers.

Do you have any additional requirements for the store?

ai commented 4 years ago

Nope. Now we need to copy-paste tests and time-travel to NgRx. We can create something like logux/ngrx.

mrdimidium commented 4 years ago

Yes, logux/ngrx looks good.

We also need to talk about technology. For angular tools, the home language is TS — angular is almost not used in vanilla JS. The code base of angular libraries is traditionally developed on TS — including angular, ngrx, angular-material, nx, protractor, compodoc and other.

Do you think we should follow this rule, or develop on JS with typings?

ai commented 4 years ago

I do not like any compilers because:

  1. It does not allow you to use the version from GitHub. It is very useful to test a fix.
  2. Bigger bundle size. Compilers insert a lot of unnecessary polyfills and it will require a lot of attention.
  3. It makes project maintenance much harder. Everything works in simple cases, but in edge cases, you always have some problems.

For the logux/ngrx which will be a tiny wrap, I think JS + .d.ts is fine.

mrdimidium commented 4 years ago

Okay. Then what should we do next?

ai commented 4 years ago

Do you want to start the project and maintain it later?

Start the project in your GitHub and when I will be ready for 0.1 we will move it to logux/ org.

mrdimidium commented 4 years ago

Well. I created it, come in: nikolay-govorov/logux-ngrx. What is required for v0.1 release?

ai commented 4 years ago

Step 1:

  1. Full Ngrx compatibility.
  2. Time travel backported from Logux Redux.
  3. Tests.
  4. Types.

Step 2:

  1. Moving to logux org
  2. Release
  3. Adding examples to logux.io
  4. Adding API page to logux.io
mrdimidium commented 4 years ago

I understand correctly that now we just copy the test suite for CRDT between @logux/redux/@logux/vuex and do the same for the new driver?

ai commented 4 years ago

Logux Redux doesn't have CRDT support. Only time travel (which is useful for CRDT, not CRDT will be on the level above the Logux Redux).

Yeap, you need to copy Logux Redux code.

ai commented 3 years ago

Logux State is a better option than supporting many state managers.

We may need Angular integration in Logux State.

mrdimidium commented 3 years ago

Do I understand correctly that Logux State is already a self-sufficient state manager, and it does not need Redux/Vuex/NgRx to work?

ai commented 3 years ago

Yeap. It just needs bindings like we have in logux/state/react or logux/state/vue.