From 5691aa143c72cc9ad2b03e9f2b891810a95fd60a Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Tue, 12 Sep 2023 10:36:14 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20(#556)=20lazy=20import=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=ED=8A=B8=EB=A6=AC=EC=89=90=EC=9D=B4?= =?UTF-8?q?=ED=82=B9=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 6 +++++- frontend/src/routes/router.tsx | 20 +++++++++++--------- frontend/webpack.common.js | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index bb8b11cc5..0d7708033 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,3 +1,4 @@ +import { Suspense } from 'react'; import { RouterProvider } from 'react-router-dom'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; @@ -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'; @@ -29,7 +31,9 @@ const App = () => ( - + }> + + diff --git a/frontend/src/routes/router.tsx b/frontend/src/routes/router.tsx index f473cea1c..f4c86c22b 100644 --- a/frontend/src/routes/router.tsx +++ b/frontend/src/routes/router.tsx @@ -1,17 +1,9 @@ +import { lazy } from 'react'; import { createBrowserRouter } from 'react-router-dom'; -import Login from '@pages/auth/Login'; import Redirection from '@pages/auth/Redirection'; import Error from '@pages/Error'; -import Home from '@pages/Home'; -import MyInfo from '@pages/MyInfo'; import NotFound from '@pages/NotFound'; -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'; @@ -19,6 +11,16 @@ import { PATH } from '@constants/path'; import PrivateRoute from './PrivateRoute'; +const Login = lazy(() => import('@pages/auth/Login')); +const Home = lazy(() => import('@pages/Home')); +const MyInfo = lazy(() => import('@pages/MyInfo')); +const CreatePostPage = lazy(() => import('@pages/post/CreatePostPage')); +const EditPostPage = lazy(() => import('@pages/post/EditPostPage')); +const PostDetailPage = lazy(() => import('@pages/post/PostDetail')); +const Ranking = lazy(() => import('@pages/Ranking')); +const RegisterPersonalInfo = lazy(() => import('@pages/user/RegisterPersonalInfo')); +const VoteStatisticsPage = lazy(() => import('@pages/VoteStatisticsPage')); + const router = createBrowserRouter([ { path: PATH.HOME, diff --git a/frontend/webpack.common.js b/frontend/webpack.common.js index a005684df..fae48c76f 100644 --- a/frontend/webpack.common.js +++ b/frontend/webpack.common.js @@ -12,7 +12,7 @@ module.exports = { mode: 'development', entry: './src/index.tsx', output: { - filename: 'bundle.js', + filename: '[name].bundle.js', path: path.resolve(__dirname, 'dist'), clean: true, publicPath: '/', From 2eb5a26b3862333affa8957b4704b0ba7b08b498 Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Tue, 12 Sep 2023 15:38:57 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20(#556)=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8,=20=ED=88=AC=ED=91=9C=20=ED=86=B5=EA=B3=84,=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=EC=A0=95=EB=B3=B4=20=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20lazy=20import=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/routes/router.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/routes/router.tsx b/frontend/src/routes/router.tsx index f4c86c22b..a21adacfd 100644 --- a/frontend/src/routes/router.tsx +++ b/frontend/src/routes/router.tsx @@ -3,7 +3,13 @@ import { createBrowserRouter } from 'react-router-dom'; import Redirection from '@pages/auth/Redirection'; import Error from '@pages/Error'; +import Home from '@pages/Home'; +import MyInfo from '@pages/MyInfo'; import NotFound from '@pages/NotFound'; +import CreatePostPage from '@pages/post/CreatePostPage'; +import EditPostPage from '@pages/post/EditPostPage'; +import PostDetailPage from '@pages/post/PostDetail'; +import Ranking from '@pages/Ranking'; import ScrollToTop from '@components/common/ScrollToTop'; @@ -12,12 +18,6 @@ import { PATH } from '@constants/path'; import PrivateRoute from './PrivateRoute'; const Login = lazy(() => import('@pages/auth/Login')); -const Home = lazy(() => import('@pages/Home')); -const MyInfo = lazy(() => import('@pages/MyInfo')); -const CreatePostPage = lazy(() => import('@pages/post/CreatePostPage')); -const EditPostPage = lazy(() => import('@pages/post/EditPostPage')); -const PostDetailPage = lazy(() => import('@pages/post/PostDetail')); -const Ranking = lazy(() => import('@pages/Ranking')); const RegisterPersonalInfo = lazy(() => import('@pages/user/RegisterPersonalInfo')); const VoteStatisticsPage = lazy(() => import('@pages/VoteStatisticsPage')); From 75adef78e4266d2b73061f48ee76a20755635de7 Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Thu, 14 Sep 2023 15:07:25 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20(#556)=20=EB=B2=88=EB=93=A4=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=A7=A4=EB=B2=88=20=EB=B0=94=EB=80=8C?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EB=90=98=EC=97=88=EB=8D=98=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/public/seo/sitemap.xml | 6 +++--- frontend/src/App.tsx | 4 +++- frontend/src/routes/router.tsx | 1 - frontend/webpack.common.js | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/public/seo/sitemap.xml b/frontend/public/seo/sitemap.xml index 33657e5c2..7f4f6d631 100644 --- a/frontend/public/seo/sitemap.xml +++ b/frontend/public/seo/sitemap.xml @@ -6,16 +6,16 @@ > https://votogether.com/ - 2023-09-13T04:22:25.347Z + 2023-09-14T06:06:57.224Z https://votogether.com/login - 2023-09-13T04:22:25.347Z + 2023-09-14T06:06:57.224Z https://votogether.com/ranking - 2023-09-13T04:22:25.347Z + 2023-09-14T06:06:57.224Z diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index fdb744b1e..7eef1d523 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -33,7 +33,9 @@ const App = () => ( - + }> + + diff --git a/frontend/src/routes/router.tsx b/frontend/src/routes/router.tsx index 7b9790719..e552438e3 100644 --- a/frontend/src/routes/router.tsx +++ b/frontend/src/routes/router.tsx @@ -2,7 +2,6 @@ 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'; diff --git a/frontend/webpack.common.js b/frontend/webpack.common.js index 9ab67185f..7ac442629 100644 --- a/frontend/webpack.common.js +++ b/frontend/webpack.common.js @@ -11,7 +11,7 @@ module.exports = { mode: 'development', entry: './src/index.tsx', output: { - filename: '[name].bundle.js', + filename: '[contenthash].bundle.js', path: path.resolve(__dirname, 'dist'), clean: true, publicPath: '/', From 55f91351b5ef627c83f0f653482ce111fa9e4ec0 Mon Sep 17 00:00:00 2001 From: Gilpop8663 Date: Thu, 14 Sep 2023 15:18:19 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20(#556)=20Suspense=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index bb8b11cc5..0d7708033 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,3 +1,4 @@ +import { Suspense } from 'react'; import { RouterProvider } from 'react-router-dom'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; @@ -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'; @@ -29,7 +31,9 @@ const App = () => ( - + }> + +