Masthash

#Jotai

Daishi Kato
2 days ago

Did you know? You can use Jotai in Deno.

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
1 month ago

Just released jotai-trpc v0.5.1! https://github.com/jotaijs/jotai-trpc
It's an integration library for Jotai and tRPC.
This version supports a way to disable query depending on some atom values.

#ReactJS #React #JavaScript #TypeScript #Jotai #tRPC

Daishi Kato
2 months ago

Just published Why You Don't Need Signals in React. Because we have Jotai.
https://blog.axlight.com/posts/why-you-dont-need-signals-in-react/

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
2 months ago

If you are using Jotai (or maybe Recoil) and run into limitations when creating atoms with props, consider checking out jotai-molecules. It allows you to create more complex states for your app.

https://jotai.org/docs/integrations/molecules

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
2 months ago

jotai-urql v0.7.0 is published! https://github.com/jotaijs/jotai-urql

This is breaking change. The API is completely redesigned.

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
2 months ago

jotai-urql v0.6.0 is released! https://github.com/jotaijs/jotai-urql

Work done by a contributor.

We need more contributors! It's not only about jotai-urql, but for most jotaijs/* projects.

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
3 months ago

Just released jotai-redux v0.2.1! https://github.com/jotaijs/jotai-redux

Someone filed a PR and it's merged. Super nice to see this integration library being used.

#ReactJS #React #JavaScript #TypeScript #Jotai #Redux

Daishi Kato
3 months ago

To recap, the goal of signals as I understand, is a) reactive source and b) skipping diffing.

I have been experimenting jotai-signal and some others and the outcome so far is kind of interesting with "best effort" approach: https://fosstodon.org/@daishi/109725073102409114

However, from Jotai's perspective, atom and useAtom do already good job for a) reactive source.

jotai-signal does too much in a sense. But still, it can't replace all useAtom use cases.

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
3 months ago

Just published Demystifying Create React Signals Internals. How jotai-signal, valtio-signal and zustand-signal work. https://blog.axlight.com/posts/demystifying-create-react-signals-internals/

#ReactJS #React #JavaScript #TypeScript #Jotai #Valtio #Zustand #Signals

Daishi Kato
3 months ago

There was a regression in jotai/valtio/zustand-signal in the previous releases. Just pushed a fix and released patches.

#ReactJS #React #JavaScript #TypeScript #Jotai #Valtio #Zustand

Daishi Kato
3 months ago

jotai-signal is now v0.8.0! https://github.com/jotaijs/jotai-signal

This includes a proof-of-concept `atomSignal`, which is a combination of atom and signal. I really don't recommend this pattern because atom is just a definition, but a signal holds a value. Would love to hear how people think.

Demo: https://codesandbox.io/s/github/jotaijs/jotai-signal/tree/main/examples/07_atomsignal

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
3 months ago

Just released a new library jotai-recoil v0.1.0! https://github.com/jotaijs/jotai-recoil

Today, I developed it to see if it works. I learned some Recoil APIs.
Guess what it can be used?

Demo: https://codesandbox.io/s/github/jotaijs/jotai-recoil/tree/main/examples/01_typescript

#ReactJS #React #JavaScript #TypeScript #Jotai #Recoil

Daishi Kato
4 months ago

So, from what I re-learned from React Documentary, React is conceptually to render from the top. Only conceptually? Well, we can do that _really_, using Jotai. This is possible because Jotai store caches atom values.

Full demo: https://codesandbox.io/s/full-jotai-app-demo-cv58w0?file=/src/App.tsx

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
4 months ago

Jotai v2.0.0 is smaller than v1.10.0 because I removed experimental code. It's about the same as v1.0.0.

What's more important is application bundle would become smaller with Jotai, thanks to code minification and code splitting.

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
4 months ago

Just published You Might Not Need React Query for Jotai
Explore data fetching solution with atoms

https://blog.axlight.com/posts/you-might-not-need-react-query-for-jotai/

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
4 months ago

jotai-optics v0.2.1 is released! https://github.com/jotaijs/jotai-optics

Some type definitions are improved.

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
4 months ago

jotai-signal v0.7.3 is released. https://github.com/jotai-labs/jotai-signal

This is an experimental library to provide an alternative approach to use Jotai atom store. Please give it a try. The repo contains some examples.

#ReactJS #React #JavaScript #TypeScript #Jotai

Here's a comparison:

Daishi Kato
5 months ago

One note about create-react-signals https://github.com/dai-shi/create-react-signals/ family is that it only accepts signals in JSX. So, how can we do show&hide feature? Here's how it's like. I might began to understand how SolidJS is designed.

Demo: https://codesandbox.io/s/upbeat-banach-49k515?file=/src/App.tsx

We released create-react-signals v0.6.1 and jotai-signal https://github.com/jotai-labs/jotai-signal v0.7.2 to fix some bugs.

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
5 months ago

jotai-signal v0.7.0 is released! https://github.com/jotai-labs/jotai-signal

This is the first library I developed, inspired by preactjs/signals-react. This version has a new capability, which is to use `callback ref` to manipulate DOM directly if possible. We took the idea from another project jotai-uncontrolled https://github.com/jotai-labs/jotai-uncontrolled/. It's best effort and falls back to react rendering.

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
5 months ago
Daishi Kato
5 months ago

In 2023, TypeScript typing would be more important than rare name conflicting.

I just fixed create-react-signals and release v0.2.0. Followed by three dependent package releases: jotai-signal v0.6.0, valtio-signal v0.3.0, and zustand-signal v0.3.0.

https://github.com/dai-shi/create-react-signals/

#ReactJS #React #JavaScript #TypeScript #Jotai #Valtio #Zustand

Daishi Kato
5 months ago

jotai-signal v0.5.0 is released! https://github.com/jotai-labs/jotai-signal

Based on Jotai v2 API (pre-release), it allows using atoms without hooks. Usually, atoms are small, so `useAtom` should be enough. This is kind of PoC, but it's usable. It's handy especially if it's no Context use case.

Demos are in the example folder, for instance: https://codesandbox.io/s/github/jotai-labs/jotai-signal/tree/main/examples/05_setvalue

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
5 months ago

Hi Jotai users, have you ever wanted better developer experience with Jotai?

A new project is being started!

Full video 👉 https://www.youtube.com/watch?v=N06JCILDFFQ

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
5 months ago

Does anyone use atomWithLocation from jotai-location library? Or, interested in it? Or, has some experience with atomWithHash?

We have a nice discussion going on for possible improvements. Please come and join.

https://github.com/jotai-labs/jotai-location/issues/9

#ReactJS #React #JavaScript #TypeScript #Jotai

Daishi Kato
5 months ago

jotai-location v0.3.3 is released! https://github.com/jotai-labs/jotai-location

So happy to see people using `atomWithLocation` which syncs to `window.location`, and reporting bugs! More contributions are welcome. (I actually look for library maintainers in all https://labs.jotai.org projects.)

#ReactJS #Jotai #JavaScript #TypeScript

Daishi Kato
5 months ago

Recently, I have released jotai-signal, valtio-signal and zustand-signal, using the same technique with proxies and custom jsx transform. I extracted the common part and released create-react-signals v0.1.0!

https://github.com/dai-shi/create-react-signals/

PRs are open for the three projects:
https://github.com/dai-shi/zustand-signal/pull/1
https://github.com/dai-shi/valtio-signal/pull/1
https://github.com/jotai-labs/jotai-signal/pull/4

#ReactJS #Jotai #Valtio #Zustand #StateManagement #JavaScript #TypeScript

Daishi Kato
5 months ago

jotai-location v0.3.2 is released! https://github.com/jotai-labs/jotai-location

It has a util called `atomWithHash` to sync atom value with `location.hash`.

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
5 months ago

With upcoming Jotai v2, you can read/update atom values outside React. Check out this counter example. This is called v2 API and already pre-released in jotai v1.11.0.

CodeSandbox: https://codesandbox.io/s/kind-silence-hw8res?file=/src/App.tsx

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
5 months ago

Just released jotai-uncontrolled v0.4.0 with Jotai v2 API. It no longer depends on React experimental features. This library allows to use string atoms without components re-rendering. Just use <uncontrolled.span> instead of <span>.

https://github.com/jotai-labs/jotai-uncontrolled

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
6 months ago

How does Jotai help eliminating useMemo in React? Here's a comparison with simple ToDo example app.

I tried various approaches. Some advanced ones are technically interesting but not so convincing. This is the jotai-basic one. See full code at: https://codesandbox.io/s/jotai-approaches-to-without-memo-xdc1rp

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Tiberiu Ichim
6 months ago

Somehow I ended up with an "unstable" chain of #react components, where I see unmounts in the chain, due to failing dependency check in useCallback, useMemo and such. Nasty, but a bit out of my control due to the third-party library I'm using (which relies on renderprops). #jotai is a band-aid I'm happy to apply.

Daishi Kato
6 months ago

Jotai atomic updates can eliminate "memo". Which approach do you prefer? Black one or white one?

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
6 months ago

jotai-signal v0.3.0 is out! It's originally developed to experiment new "use" hook. However, it turns out the use of "use" is very limited. Thanks to Jotai v2 API, I re-designed jotai oriented signals. It no longer depends on experimental features. Let's make it stable!

https://github.com/jotai-labs/jotai-signal

I think it's a novel API. Would require a blog post to explain, but for now just check out TODOs example.

https://codesandbox.io/s/github/jotai-labs/jotai-signal/tree/main/examples/04_todos

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
6 months ago

There will be a new capability in Jotai v2 API. A derived atom can return an infinite promise. This wasn't possible in Jotai v1. There's a small caveat in usage, but it works mostly as expected.

https://codesandbox.io/s/gifted-currying-rll16l?file=/src/App.tsx

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
6 months ago

We have some ideas to improve Jotai ecosystem. Unfortunately, I don't have enough time for them. Hence, just opened two discussions to look for project leaders.

[Help Wanted] Dedicated Devtools https://github.com/pmndrs/jotai/discussions/1637

[Help Wanted] Jotai Tutorial https://github.com/pmndrs/jotai/discussions/1638

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
6 months ago

Maybe I don't need a blog post to explain. Just a toot would work.

"""
Jotai is inspired by Recoil, and its API is mostly compatible.
Jotai v2 API will be _incompatible_ with Recoil.
"""

The blog post 👉 https://blog.axlight.com/posts/why-we-need-jotai-v2-api/

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
6 months ago

Hello Jotai users!
I believe the Jotai library is getting better and v2 will be available soonish. Though, I'd admit that docs have room for improvement.
I would like to ask for volunteers who are willing to work on docs.

Call for document contributors

https://github.com/pmndrs/jotai/discussions/1627

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript

Daishi Kato
6 months ago

Just released jotai-jsx v0.2.0! https://github.com/jotai-labs/jotai-jsx

This is an experimental library to run Jotai https://jotai.org apps _without_ React. It replaces `react` and `react-dom`. Thanks to Jotai v2 API (pre-release), we can use vanilla part of the Jotai library.

You can play with an example: https://codesandbox.io/s/github/jotai-labs/jotai-jsx/tree/main/examples/02_typescript

#ReactJS #Jotai #StateManagement #ReactHooks #JavaScript #TypeScript