-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: 네트워크 요청 최적화 및 Prefetch 추가 (#313) #316
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
76599cf
refactor: 영상 캐시 키와 진입 prefetch 정리 (#313)
PeraSite f117e3d
refactor: useSlides 폴링 옵션을 분리 적용 (#313)
PeraSite 32ec3fb
refactor: 대본 캐시 재사용으로 상세 요청 축소 (#313)
PeraSite 893968f
refactor: 공유 댓글 조회를 쿼리로 통합 (#313)
PeraSite b6fd79d
refactor: 대본 일괄수정 scripts 재요청 방지 (#313)
PeraSite 2104261
design: 대본 패널 active/컨트롤 스타일 정리 (#313)
PeraSite 2a45d20
test: API 최적화 회귀 가드 추가 (#313)
PeraSite 35b60af
fix: Update src/pages/feedback/useFeedbackSlide.ts
PeraSite edd2172
test: 401 에러 핸들러 기대값 정리 (#313)
PeraSite bfdfcc7
fix: Lint 오류 수정 (#313)
PeraSite f139069
Update src/pages/VideoListPage.tsx
PeraSite f87ee36
Update src/pages/VideoListPage.tsx
PeraSite ee58f5a
Update src/hooks/queries/useScript.ts
PeraSite 8099f34
refactor: 비디오 목록 캐시 업데이트 헬퍼 추출 (#313)
PeraSite 0f57231
fix: 공유 영상 제목 누락 시 상세 조회 보정 (#313)
PeraSite f3f0abe
refactor: 대본 저장 캐시를 프로젝트 단위로 갱신 (#313)
PeraSite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { useEffect, useRef } from 'react'; | ||
|
|
||
| import { useQueryClient } from '@tanstack/react-query'; | ||
|
|
||
| import { getProjectScripts } from '@/api/endpoints/scripts'; | ||
| import { getSlides } from '@/api/endpoints/slides'; | ||
| import { queryKeys } from '@/api/queryClient'; | ||
|
|
||
| /** | ||
| * 프로젝트 진입 시 슬라이드/대본 데이터를 한 번 미리 적재합니다. | ||
| */ | ||
| export function useProjectEntryPrefetch(projectId?: string) { | ||
| const queryClient = useQueryClient(); | ||
| const prefetchedProjectIdsRef = useRef<Set<string>>(new Set()); | ||
|
|
||
| useEffect(() => { | ||
| if (!projectId) return; | ||
| if (prefetchedProjectIdsRef.current.has(projectId)) return; | ||
|
|
||
| prefetchedProjectIdsRef.current.add(projectId); | ||
|
|
||
| void Promise.all([ | ||
| queryClient.prefetchQuery({ | ||
| queryKey: queryKeys.slides.list(projectId), | ||
| queryFn: () => getSlides(projectId), | ||
| }), | ||
| queryClient.prefetchQuery({ | ||
| queryKey: queryKeys.scripts.project(projectId), | ||
| queryFn: () => getProjectScripts(projectId), | ||
| }), | ||
| ]).catch(() => { | ||
| // 실패 시 재시도 가능하도록 가드를 해제합니다. | ||
| prefetchedProjectIdsRef.current.delete(projectId); | ||
| }); | ||
| }, [projectId, queryClient]); | ||
PeraSite marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.