Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

로그인, 투표 통계, 회원정보 페이지 lazy import 적용 #571

Merged
merged 6 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontend/public/seo/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
>
<url>
<loc>https://votogether.com/</loc>
<lastmod>2023-09-13T04:22:25.347Z</lastmod>
<lastmod>2023-09-14T06:06:57.224Z</lastmod>
</url>

<url>
<loc>https://votogether.com/login</loc>
<lastmod>2023-09-13T04:22:25.347Z</lastmod>
<lastmod>2023-09-14T06:06:57.224Z</lastmod>
</url>

<url>
<loc>https://votogether.com/ranking</loc>
<lastmod>2023-09-13T04:22:25.347Z</lastmod>
<lastmod>2023-09-14T06:06:57.224Z</lastmod>
</url>
</urlset>
6 changes: 5 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Suspense } from 'react';
import { RouterProvider } from 'react-router-dom';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
Expand All @@ -11,6 +12,7 @@ import router from '@routes/router';
import ErrorBoundaryForTopClass from '@pages/ErrorBoundaryForTopClass';

import ChannelTalk from '@components/ChannelTalk';
import Skeleton from '@components/common/Skeleton';

import { GlobalStyle } from '@styles/globalStyle';
import { theme } from '@styles/theme';
Expand All @@ -29,7 +31,9 @@ const App = () => (
<GlobalStyle />
<PostOptionProvider>
<AuthProvider>
<RouterProvider router={router} />
<Suspense fallback={<Skeleton isLarge />}>
<RouterProvider router={router} />
</Suspense>
</AuthProvider>
</PostOptionProvider>
</ThemeProvider>
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/routes/router.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { lazy } from 'react';
import { createBrowserRouter } from 'react-router-dom';

import Announcement from '@pages/Announcement';
import Login from '@pages/auth/Login';
import Redirection from '@pages/auth/Redirection';
import Error from '@pages/Error';
import Home from '@pages/Home';
Expand All @@ -11,8 +11,6 @@ import CreatePostPage from '@pages/post/CreatePostPage';
import EditPostPage from '@pages/post/EditPostPage';
import PostDetailPage from '@pages/post/PostDetail';
import Ranking from '@pages/Ranking';
import RegisterPersonalInfo from '@pages/user/RegisterPersonalInfo';
import VoteStatisticsPage from '@pages/VoteStatisticsPage';

import ScrollToTop from '@components/common/ScrollToTop';
import RouteChangeTracker from '@components/RouteChangeTracker';
Expand All @@ -21,6 +19,10 @@ import { PATH } from '@constants/path';

import PrivateRoute from './PrivateRoute';

const Login = lazy(() => import('@pages/auth/Login'));
const RegisterPersonalInfo = lazy(() => import('@pages/user/RegisterPersonalInfo'));
const VoteStatisticsPage = lazy(() => import('@pages/VoteStatisticsPage'));

const router = createBrowserRouter([
{
path: PATH.HOME,
Expand Down
2 changes: 1 addition & 1 deletion frontend/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
mode: 'development',
entry: './src/index.tsx',
output: {
filename: 'bundle.js',
filename: '[contenthash].bundle.js',
path: path.resolve(__dirname, 'dist'),
clean: true,
publicPath: '/',
Expand Down
Loading