sangte icon indicating copy to clipboard operation
sangte copied to clipboard

Should we rename APIs? sangte -> atom

Open velopert opened this issue 3 years ago • 7 comments

As a Korean, I really liked the name sangte since it just makes sense.

However, after putting myself into foreign developers' shoes, I thought that they might not like it because they are not used to this word.

Thus, I am planning to change the name as below. I need some feedback! Should I go for it? Or stick with the current naming?

sangte -> atom
useSangte -> useAtom
useSangteActions -> useAtomActions
useSangteValue -> useAtomValue
useSetSangte -> useSetAtom
useSangteStore -> useAtomStore
useSangteCallback -> useAtomCallback
useResetSangte -> useResetAtom
useResetAllSangte -> useResetAllAtoms

velopert avatar Sep 11 '22 18:09 velopert

In my opinion, current name sangte is okay and maybe(?) acceptable for foreign developers. (I'm korean though :)) But Following Recoil's case, they provide hooks like useRecoilState, useRecoilValue, we can do something like useSangteState, useSangteValue. Or re-export everything like radix-ui's approach is worth considering :)

export function sangte () {...};
export const atom = sangte;

lifeisegg123 avatar Sep 12 '22 14:09 lifeisegg123

Jotai means a state in Japanese. I guess you have already known this. From the same perspective, The name Sangte looks okay.

kyun avatar Sep 12 '22 15:09 kyun

In my opinion, current name sangte is okay and maybe(?) acceptable for foreign developers. (I'm korean though :)) But Following Recoil's case, they provide hooks like useRecoilState, useRecoilValue, we can do something like useSangteState, useSangteValue. Or re-export everything like radix-ui's approach is worth considering :)

export function sangte () {...};
export const atom = sangte;

@lifeisegg123

Thank you for good suggestions! It seems like it would be nice to rename useSangte to useSangteState, because non-korean people might find it confusing.

I am planning to make these aliases by re-exporting!

  • atom -> sangte
  • useSangteState -> useSangte

velopert avatar Sep 13 '22 01:09 velopert

Jotai means a state in Japanese. I guess you have already known this. From the same perspective, The name Sangte looks okay.

@kyun

Agreed, but jotai does not have name 'jotai' in their apis.

velopert avatar Sep 13 '22 01:09 velopert

Jotai means a state in Japanese. I guess you have already known this. From the same perspective, The name Sangte looks okay.

@kyun

Agreed, but jotai does not have name 'jotai' in their apis.

Agree to change names to some extent. Zustand and Jotai each have the meaning of state, but they are not found in apis. Such as useSangte seem quite interesting to Koreans, but people in other countries may not.

I think function names seem to be more important to describe which way it uses(Atomic or Flux or something).

CO0Ki3 avatar Sep 13 '22 09:09 CO0Ki3

useJotai()
useJotaiState()
...

What if jotai used the "Jotai" to their APIs, it is okay to me. Because I have already known what "Jotai" is. (I didn't know that meaning before knowing "Jotai")

Almost of developers who try to use "Sangte", they may know what "Sangte" is. so, I don't think "Sangte" makes them confused.

kyun avatar Sep 14 '22 04:09 kyun

Thank you for sharing your thoughts everyone!

My current plan is:

Create alias atom for sangte, useSangteState for useSangte and keep all the API name as is.

There might be some changes after getting more feedbacks from other developers later on. By the way I am planning to make a video about this library (in English) sooner or later!

velopert avatar Sep 17 '22 07:09 velopert