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

refactor: fcm, msw 서비스 워커 통합 #513

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

bbearcookie
Copy link
Member

@bbearcookie bbearcookie commented Mar 6, 2024

🧩 이슈 번호

✅ 작업 사항

기존에는 fcm을 위한 service worker만 실행하거나, 혹은 msw를 위한 service worker만 실행할 수 있었는데요. 이를 동시에 실행할 수 있도록 작업했어요.

  • MSW 서비스 워커를 FCM 서비스 워커와 통합하는 방식으로 수정 (참고한 공식 문서 레퍼런스)
  • 서비스 워커 파일에서 lint disabled하지 않아도 되도록 self property 사용
  • MSW 서비스 워커가 내부적으로 사용하는 postMessage API와 겹치지 않도록 기존 FCM 서비스 워커의 notificationclick 이벤트에서 postMessage 가 메인 스레드에 전달하는 데이터 형태 변경

👩‍💻 공유 포인트 및 논의 사항

Web Push를 위한 FCM 서비스 워커와 API 모킹을 위한 MSW 서비스 워커가 같이 실행되고 있음을 확인할 수 있어요.
실행 커맨드는 기존과 같아요.

npm run dev # web push를 수신하는 service worker만 실행
npm run dev:msw # web push를 수신 + api를 모킹하는 service worker를 병합해서 실행

image

@bbearcookie bbearcookie added ☁️ FE 프론트 레포지토리에서의 작업 ♻️ refactor 기존의 코드 개선 작업 labels Mar 6, 2024
@bbearcookie bbearcookie self-assigned this Mar 6, 2024
@bbearcookie bbearcookie merged commit f27e84b into dev Mar 8, 2024
2 checks passed
@bbearcookie bbearcookie deleted the refactor/#512/service-worker branch March 8, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☁️ FE 프론트 레포지토리에서의 작업 ♻️ refactor 기존의 코드 개선 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

msw, fcm 서비스 워커 통합
1 participant