merisbahti / klyva

A state management library that follows the React component model
MIT License
55 stars 4 forks source link

Does Suspense and Error boundries work with klyva? Also does it work with concurrent mode? They quite stressed this when introducing recoil #30

Open sesam opened 3 years ago

sesam commented 3 years ago

☝️ asking for a friend :) cc @kkogovsek

merisbahti commented 3 years ago

Heya :D

Regarding suspense...

Well, depends on what you're asking. But for suspense, I've explicitly decided to not implement any support for that. I think if you should fetch data, use react-query or something honestly, you can generate the "keys" and "parameters" for the query in atoms of course... I know jotai has support for suspense, but I've never used it.

I honestly don't think suspense brings that much joy to the dev experience anyways? Have you tried it? It made me feel way less secure about my code.

Regarding error boundaries:

Hmm, how do you mean?

Regarding CM...

I honestly don't know? Is there any information about this? (I mean, will your code-bases custom hook work with CM?)

Yes I have CM anxiety and I'm not even sure the code I write today will be usable when CM rolls out, and we haven't gotten that much info regarding this from the react team. Mostly some talks and no definite tools or experience around CM that makes easy to assert a good answer to your question.

I've put klyva in this table here: https://github.com/dai-shi/will-this-react-global-state-work-in-concurrent-mode#results and it looks like there are very few state management solutions that pass the "No-tearing" test. Note that recoil does not pass the test.

sesam commented 3 years ago

klyva was added in https://github.com/dai-shi/will-this-react-global-state-work-in-concurrent-rendering/pull/28 and I don't see it n the table now, but don't see in https://github.com/dai-shi/will-this-react-global-state-work-in-concurrent-rendering/commits/master any other PR removing klyva. Hm.

merisbahti commented 3 years ago

I think I found the one removing klyva, here:

https://github.com/dai-shi/will-this-react-global-state-work-in-concurrent-rendering/commit/46187ce6ee0920ba8b35b5c572436f449b4982e9

merisbahti commented 3 years ago

I should make a PR when I get off work :P

sesam commented 3 years ago

Perfect. Yes - it looks like an oversight in the reorg :) Also, this https://github.com/dai-shi/will-this-react-global-state-work-in-concurrent-rendering/commit/68c445f3198481549858aa7d2f1fef08bd8cf8ab removed a lot of libs and code+deps related to klyva too.