mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-05 16:37:43 +00:00
⚡️(frontend) remove auth barrel file to improve code splitting
Auth-related code is used across the codebase and imported by many different features. The barrel file, while convenient for importing utilities, was harming code splitting by pulling unrelated modules into shared chunks. Verified by running `npm run build:debug` before and after: chunking and code splitting are better without the barrel.
This commit is contained in:
committed by
aleb_the_flash
parent
f8f2ce145b
commit
1b35e3acd9
@@ -2,7 +2,7 @@ import { silenceLiveKitLogs } from '@/utils/livekit'
|
||||
import { useConfig } from '@/api/useConfig'
|
||||
import { useAnalytics } from '@/features/analytics/hooks/useAnalytics'
|
||||
import { useSupport } from '@/features/support/hooks/useSupport'
|
||||
import { useSyncUserPreferencesWithBackend } from '@/features/auth'
|
||||
import { useSyncUserPreferencesWithBackend } from '@/features/auth/api/useSyncUserPreferencesWithBackend'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const AppInitialization = () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { LinkButton } from '@/primitives'
|
||||
import { authUrl } from '@/features/auth'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useConfig } from '@/api/useConfig'
|
||||
import { ProConnectButton } from './ProConnectButton'
|
||||
import { authUrl } from '@/features/auth/utils/authUrl'
|
||||
|
||||
type LoginButtonProps = {
|
||||
proConnectHint?: boolean // Hide hint in layouts where space doesn't allow it.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Link as RALink } from 'react-aria-components'
|
||||
import { authUrl } from '@/features/auth'
|
||||
import { authUrl } from '@/features/auth/utils/authUrl'
|
||||
import { cva } from '@/styled-system/css'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { VStack } from '@/styled-system/jsx'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '../api/useUser'
|
||||
import { LoadingScreen } from '@/components/LoadingScreen'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export { useUser } from './api/useUser'
|
||||
export { useSyncUserPreferencesWithBackend } from './api/useSyncUserPreferencesWithBackend'
|
||||
export { authUrl } from './utils/authUrl'
|
||||
export { UserAware } from './components/UserAware'
|
||||
@@ -1,4 +1,4 @@
|
||||
import { authUrl } from '@/features/auth'
|
||||
import { authUrl } from './authUrl'
|
||||
|
||||
const SILENT_LOGIN_RETRY_KEY = 'silent-login-retry'
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
ApiFileType,
|
||||
ApiFileUploadState,
|
||||
} from '@/features/files/api/types.ts'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { useConfig } from '@/api/useConfig.ts'
|
||||
|
||||
type ListFilesResponse = {
|
||||
|
||||
@@ -5,7 +5,8 @@ import { styled } from '@/styled-system/jsx'
|
||||
import { navigateTo } from '@/navigation/navigateTo'
|
||||
import { Screen } from '@/layout/Screen'
|
||||
import { generateRoomId, useCreateRoom } from '@/features/rooms'
|
||||
import { useUser, UserAware } from '@/features/auth'
|
||||
import { UserAware } from '@/features/auth/components/UserAware'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { JoinMeetingDialog } from '../components/JoinMeetingDialog'
|
||||
import { RiAddLine, RiLink } from '@remixicon/react'
|
||||
import { LaterMeetingDialog } from '@/features/home/components/LaterMeetingDialog'
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Text } from '@/primitives'
|
||||
import { StyledToastContainer, type ToastProps } from './Toast'
|
||||
import { HStack } from '@/styled-system/jsx'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { css } from '@/styled-system/css'
|
||||
import { RecordingMode } from '@/features/recording'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { css } from '@/styled-system/css'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { LoginPrompt } from './LoginPrompt'
|
||||
import { RequestRecording } from './RequestRecording'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { HStack, VStack } from '@/styled-system/jsx'
|
||||
|
||||
const Divider = ({ label }: { label: string }) => (
|
||||
|
||||
@@ -6,7 +6,8 @@ import { useTranslation } from 'react-i18next'
|
||||
import { useTitle } from 'hoofd'
|
||||
import { useMemo } from 'react'
|
||||
import { mediaUrl } from '@/api/mediaUrl'
|
||||
import { UserAware, useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { UserAware } from '@/features/auth/components/UserAware'
|
||||
import { Screen } from '@/layout/Screen'
|
||||
import { H, LinkButton, Text } from '@/primitives'
|
||||
import { formatDate } from '@/utils/formatDate'
|
||||
|
||||
@@ -27,7 +27,7 @@ import { useCreateFile } from '@/features/files/api/createFile.ts'
|
||||
import { FileTrigger } from 'react-aria-components'
|
||||
import { RiDeleteBinLine, RiImageAddFill } from '@remixicon/react'
|
||||
import { useDeleteFile } from '@/features/files/api/deleteFile.ts'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { ApiFileItem } from '@/features/files/api/types.ts'
|
||||
import { useConfig } from '@/api/useConfig.ts'
|
||||
import { usePersistentUserChoices } from '@/features/rooms/livekit/hooks/usePersistentUserChoices.ts'
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { ReactNode, useEffect, useState } from 'react'
|
||||
import { useLocation, useParams } from 'wouter'
|
||||
import { ErrorScreen } from '@/components/ErrorScreen'
|
||||
import { useUser, UserAware } from '@/features/auth'
|
||||
import { UserAware } from '@/features/auth/components/UserAware'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { Conference } from '../components/Conference'
|
||||
import { Join } from '../components/Join'
|
||||
import { Permissions } from '../components/Permissions'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useMemo } from 'react'
|
||||
import { css } from '@/styled-system/css'
|
||||
import { generateRoomId, useCreateRoom } from '../../rooms'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { Spinner } from '@/primitives/Spinner'
|
||||
import { CallbackIdHandler } from '../utils/CallbackIdHandler'
|
||||
import { PopupWindow } from '../utils/PopupWindow'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { authUrl } from '@/features/auth'
|
||||
import { authUrl } from '@/features/auth/utils/authUrl'
|
||||
import { PopupMessageType, CallbackCreationRoomData } from './types'
|
||||
|
||||
export class PopupWindow {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useLanguageLabels } from '@/i18n/useLanguageLabels'
|
||||
import { A, Badge, Dialog, type DialogProps, Field, H, P } from '@/primitives'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { LoginButton } from '@/components/LoginButton'
|
||||
|
||||
export type SettingsDialogProps = Pick<DialogProps, 'isOpen' | 'onOpenChange'>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { A, Badge, Button, DialogProps, Field, H, P } from '@/primitives'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { useRoomContext } from '@livekit/components-react'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { css } from '@/styled-system/css'
|
||||
import { TabPanel, TabPanelProps } from '@/primitives/Tabs'
|
||||
import { HStack } from '@/styled-system/jsx'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useSnapshot } from 'valtio'
|
||||
import { hintsStore } from '@/stores/hints'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const useLoginHint = () => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { HStack, Stack } from '@/styled-system/jsx'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button, Text } from '@/primitives'
|
||||
import { SettingsButton } from '@/features/settings'
|
||||
import { useUser } from '@/features/auth'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { useMatchesRoute } from '@/navigation/useMatchesRoute'
|
||||
import { FeedbackBanner } from '@/components/FeedbackBanner'
|
||||
import { Menu } from '@/primitives/Menu'
|
||||
|
||||
Reference in New Issue
Block a user