Kollect 0.1 - Mirrors Fetch redesign - #14
Conversation
Co-Authored-By: JorgeCastilloPrz <jorge.castillo.prz@gmail.com>
Co-Authored-By: JorgeCastilloPrz <jorge.castillo.prz@gmail.com>
|
Addressed all your comments @nomisRev. Thanks 👍 |
|
Addressed all your comments now @nomisRev. Sorry for missing those out, seems like GitHub is hiding some comments inside the diff and not exposing them front page. |
|
@purrgrammer , after applying @nomisRev suggestion on 5d54554, I got The thing is that tests got broken because I wasn't implementing Now I'm clueless about how to implement |
We've discussed this privately on Slack,
|
|
Alright, |
Please read this description before stepping in:
DataSourceCachetype class parametric to F #2Here you have a complete 1 to 1 port of Fetch redesign. All the features are present, also the tests. This is completely functional and should be production ready, assuming Fetch also is.
Added every single test on Fetch to this code base also, so we have tests covering batching, de-duplication, asynchrony, concurrency, error handling, syntax, and much more.
Also, sorry for the huge PR! 😅 it was much easier to do it like this, since before this point the repo just had some basic scaffoldings, nothing complete or working. I followed @purrgrammer's Fetch redesign PR style to try to shortcut a lot of intermediate discussions that could arise without a final runnable version.
My advice for reviewing this would be:
Structure
Segregated the lib into different modules:
kollect-core,kollect-extensions,kollect-typeclasses, mostly because of extensions requiring to be on a separate module to work. There's also akollect-testwith all the tests. That pushed me to pull out typeclasses too, so all the three modules can use them. Still, typeclasses areTimerandClock, which will eventually be moved to Arrow.The structure kind of mimics what we've been doing for arrow, more or less.
Caveats
I(index) andA(result) types are typed asAny. I tried to move those types to be actual gneric type args but that crawled the whole hierarchy up to the client call sites, where you'd be enforced to doKollect.run<F, I, A>(concurrentF), which looked a bit verbose to me. Still, I'm totally open for suggestions there, and I would love to know why it's done inFetchthe way it is.I'd love to get review from: