feat: msw 기반으로 next.js에서 mock service worker 추가 #33
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.
진행한 것
packages
폴더로 이동 시도문제점
첫 렌더링시 서비스 워커 등록이 되지 않아 네트워크 오류가 발생하는 문제가 있음
그것을
useEffect
와shouldRender
상태를 이용해 해결함하지만 렌더링 자체를 막음으로써
msw
기반의 상태에서Suspense
를 이용하기 어려워보임 (초기 렌더링의 경우에 해당할 듯)연결 이슈
top-level-await관련 babel 설정 넣어서
initMocks
를 기다리게 하는 방법이 있는 것 같았지만 axios 관련 버그가 또 터지네.서버 개발 전에 잠깐 쓰는거니 그냥 그대로 쓰는 것도 좋을듯~!