klis87 / redux-requests

Declarative AJAX requests and automatic network state management for single-page applications
https://redux-requests.klisiczynski.com/
MIT License
367 stars 51 forks source link

ROADMAP #306

Open klis87 opened 4 years ago

klis87 commented 4 years ago

Below you can see the plan for this library, the plan starts with creating a very big release, after which API should be more stable. Then releases will be smaller until we reach 1.0. Why is next release so big? Because I did not want to make breaking changes all the time and I designed everything in my head first so that I could fit most/all breaking changes only in the next release, then focusing only on adding stuff.

Tasks for the next release:

Tasks before 1.0:

Help wanted:

Advice wanted:

Other tasks:

Tasks after 1.0:

Help wanted:

Advice wanted:

Other tasks:

strdr4605 commented 4 years ago

@klis87 would be nice if you will create PRs and mentions people to comment or review. As this will make room for other contributors to understand the code and help.

Also creating simple issues that can be resolved by others will let you think more about the architecture of the packages.

One thing that I noticed while trying to debug some issues is that some functions are very complex and hard to understand. In that case, I think that probably some comments and jsdoc will be useful to keep the codebase clear for others.

Let me know if I or other contributors can help you.

klis87 commented 4 years ago

@strdr4605 thx for the feedback

For now this is very hard as first I need to finish next release. Next release will be almost like a new major version and many features will need to be implemented with complete picture which is in my head for now. Later I think it will be possible to do things as quite independent and small tasks. Then I will think how people could help, I really appreciate the offer btw!

Could you please give me some examples of complex functions? I try to write things in the way understandable by others, but I will try to simplify those harder parts of the system but I need to know which are those.

One thing which comes to my mind is that maybe u tried to debug sagas in runtime or without sourcemaps? This is my suspicion as in another issue https://github.com/klis87/redux-saga-requests/issues/311 you pasted below snippet which really is not source code but the code already compiled by Babel.

case 44:
  _context.prev = 44;
  _context.t0 = _context["catch"](28);
  // Here the eror is catched and responseError is a Error Object
  console.log({error: _context.t0});

  responseError = _context.t0;

...
...

case 57:
  // I log here the response and it is an object
  console.log({response});

  // So this "if" will break and call driver.getErrorPayload, will not be triggered
  if (response) {
     _context.next = 65;
     break;
  }

  _context.next = 60;
  return (0, _effects.call)(driver.getErrorPayload, responseError);
strdr4605 commented 4 years ago

@klis87, I was looking at source file in Github to understand where to put logs in the compiled version. But still functions like https://github.com/klis87/redux-saga-requests/blob/master/packages/redux-saga-requests/src/sagas/send-request.js are way too complex. Probably because it is a generator function it is hard to divide, but a least some "why" and "how" should be provided as comments.

klis87 commented 4 years ago

@strdr4605 yes, I agree sendRequest could be a little simplified. I will make it better when trying to get rid of sagas totally, probably by replacing it with several cooperating middlewares. In the meantime after I finish next release, I will try to think of tasks I could delegate to volunteers with some hints etc.

Another way to help is to ask questions about API where it is confusing etc, I designed API so it is perfect for me, but not necessarily to others.

strdr4605 commented 4 years ago

@klis87 As I see at this state. The package is almost ready for the next release. When it is expected? I want to see the new API. Will it be +- stable after v1.0?!

klis87 commented 4 years ago

@strdr4605 next release will not be 1.0, but API for 1.0 will probably be mostly the same. It is possible that handleRequests won't contain sagas anymore, but actions api and driver should remain mostly similar. Thats why next release is taking so much time as I wanted this to become stable.

After 1.0 I won't do any breaking changes unless version 2.0.

Regarding time for the next release, I guess no more than 2 weeks, there is no much work to be done but I need to test everything in real apps and I am very busy with daily job.

For now, see https://github.com/klis87/redux-saga-requests/tree/dev/examples as most examples were rewritten to new API. I will let you know once TS types and docs are updated.

After next release, I will tag tasks with some hints which other people could help me with to faster release 1.0.

klis87 commented 4 years ago

@strdr4605 new version published. Next tasks divided as help wanted, guidance wanted and others, so this is the way to help me, thx!

strdr4605 commented 4 years ago

I will take a look and see if I have time to work on promise driver.

How about moving docs to Docusaurus. (As for example for my teammates (even I after 4+ months) will be easier to read and understand docs from Docusaurus). I use v1 for our project and it's really nice. But maybe we can go with v2 as https://reactnavigation.org/ and others are already using alpha version.

klis87 commented 4 years ago

@strdr4605 good idea with Docasaurus. If v2 is working, I would prefer that, especially that If I remember correctly it supports MDX

If you need some guidance with promise driver, I will gladly help too

strdr4605 commented 4 years ago

How about also creating an npm org. Not sure about naming as you want to remove redux-saga but would be better to have:

@redux-saga-requests/core
@redux-saga-requests/axios-driver
@redux-saga-requests/fetch-driver
@redux-saga-requests/promise-driver
@redux-saga-requests/graphql-driver
@redux-saga-requests/react
klis87 commented 4 years ago

@strdr4605 I already created redux-requests npm org several months ago :) my next step is an attempt to get rid of sagas, so I could move to @redux-requests/core etc

strdr4605 commented 4 years ago

I would suggest adding some jsdocs that may help contributors to understand the flow of the package and the purpose of some files/functions.

Another great idea is maybe to create a diagram like Redux one. Which will explain to users and contributors how redux-requests works.

klis87 commented 4 years ago

@strdr4605 good ideas. What about Typescript instead of jsdocs? Personally I am not fan of types as comments, I just prefer typed language.

strdr4605 commented 4 years ago

jsdocs not for typing but for explanations, (why this function/approach).

Have you thought about moving to TypeScript? Now I work mostly with TypeScript (annotating everything some times is hard) and now hard to work on a big JS codebase.

Also making types during development is easier than after everything is done.

When we will move completely to redux-saga-requests I will try to improve some types but I would still suggest moving to TypeScript.

klis87 commented 4 years ago

@strdr4605 Yes I did but for now I am focusing to release 1.0 ASAP, which TS wont help with as I have complete API in my head anyway, we could do that afterwards. The job which is left I split into tasks which could be done in isolation, like promise driver, but others will be just faster for me to finish than explaining the whole library to other people, documenting it and creating internal types. I would like to do everything later though.

Anyway this library has very good tests coverage, so it is quite easy to understand how things work just by looking at tests, at least I hope so :)

strdr4605 commented 4 years ago

@klis87 I asked a friend to create a logo for this package:

image

klis87 commented 4 years ago

@strdr4605 That's look awesome, thx! I cannot wait for removing sagas and changing package name, when I will add it to README.md!

strdr4605 commented 4 years ago

blog series on Medium introducing problems this library tries to solve

why not a separate site under klisiczynski.com or blog.klisiczynski.com?! Own your platform!!!

I created https://strdr4605.github.io/ using gatsbyjs starter in 2 days. + with google analytics, you may track people's interests!

klis87 commented 4 years ago

@strdr4605 Thx for the advice. I thought about it, but I wanna kind of advertise this library and I expect huge amount of visitors on medium and close to 0 on my site :)

strdr4605 commented 4 years ago

@strdr4605 Thx for the advice. I thought about it, but I wanna kind of advertise this library and I expect huge amount of visitors on medium and close to 0 on my site :)

You may also try to write a post on https://dev.to/

iwan-uschka commented 3 years ago

@klis87 Do you mean "polling" at Tasks after 1.0 > Other tasks:? If not:

klis87 commented 3 years ago

@iwan-uschka it was just a typo :) I meant polling, edited already.

It is on the roadmap and this will be declarative short polling. It will work like that, probably new meta.pool: integer will be added, so that request action will be repeated according to passed meta.pool.

Additionally I guess we will have stopPolling action, working like abortRequests but to cancel pollings. Probably also resetRequests will stop relevant pollings automatically (with extra flag to enable/disable this)

iwan-uschka commented 3 years ago

Nice! Like that :)

"polling" is part of "other tasks" and not of "Help wanted" or "Advice wanted". If you think that getting support would help in this case nevertheless, let me know.

klis87 commented 3 years ago

@iwan-uschka Actually, when I think about it, this could really be implemented as a totally different middleware, thx for the suggestion! Hence, this is a perfect candidate for Help wanted! See https://github.com/klis87/redux-requests/issues/418 for details