Migrate twenty ui to jotai (#17900)
## Remove Recoil from twenty-ui Completely removes the `recoil` dependency from `twenty-ui` by converting all atoms, hooks, and providers to Jotai equivalents. ### twenty-ui - `createState` now returns a Jotai `PrimitiveAtom` instead of a Recoil atom - `iconsState`, `IconsProvider`, `useIcons` converted to Jotai (`useSetAtom`, `useAtomValue`) - `RecoilRootDecorator` now uses Jotai `Provider` (name kept for compat) - Deleted unused `invalidAvatarUrlsState` (Avatar already uses `invalidAvatarUrlsAtomV2`) - Removed `recoil` from `package.json` ### twenty-front - Created local Recoil `createState` at `@/ui/utilities/state/utils/createState` for ~112 state files still on Recoil - Updated all imports accordingly - Removed `iconsState` from Recoil snapshot preservation in `useAuth` (lives in Jotai store now)
This commit is contained in:
@@ -67,7 +67,6 @@ import { i18n } from '@lingui/core';
|
||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||
import { SOURCE_LOCALE } from 'twenty-shared/translations';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { iconsState } from 'twenty-ui/display';
|
||||
import { cookieStorage } from '~/utils/cookie-storage';
|
||||
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
|
||||
|
||||
@@ -132,7 +131,6 @@ export const useAuth = () => {
|
||||
|
||||
const emptySnapshot = snapshot_UNSTABLE();
|
||||
|
||||
const iconsValue = snapshot.getLoadable(iconsState).getValue();
|
||||
const authProvidersValue = snapshot
|
||||
.getLoadable(workspaceAuthProvidersState)
|
||||
.getValue();
|
||||
@@ -164,7 +162,6 @@ export const useAuth = () => {
|
||||
.getValue();
|
||||
|
||||
const initialSnapshot = emptySnapshot.map(({ set }) => {
|
||||
set(iconsState, iconsValue);
|
||||
set(workspaceAuthProvidersState, authProvidersValue);
|
||||
set(billingState, billing);
|
||||
set(
|
||||
|
||||
Reference in New Issue
Block a user