fix: 릴리즈 빌드에서 console 로깅과 DevTools 제거 - #215
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
관련 이슈
없음. #213 위에 쌓은 PR이라 베이스가
feat/tracking-path-downsampling입니다. 테스트 환경(jest-expo)이 #213에 들어 있어서 그 위에 올렸고, #213이 머지되면 베이스를main으로 바꾸겠습니다. 코드상 겹치는 파일은 없습니다.작업 내용
릴리즈 빌드에
console.*호출 74개가 그대로 실려 있었습니다. Hermes에서console.*은 동기 호출이라, 트래킹처럼 초당 여러 번 도는 경로에서는 비용이 그대로 드러납니다. 소켓 메시지 수신 로그,publishGps경고, 푸시 포어그라운드 수신 로그가 모두 여기 해당합니다.babel.config.js에env.production으로transform-remove-console을 걸었습니다.console.error와console.warn은 남깁니다. Sentry로 올라가는 경로와 실제 장애 진단에 필요한 로그라 지우지 않았습니다.STOMP 클라이언트의
debug콜백은 송수신 프레임 전체를 문자열로 받습니다. GPS publish까지 포함되므로 개발 빌드에서만 로깅하도록 바꿨습니다.React Query DevTools 훅이 프로덕션에서도 실행되고 있었습니다. 개발 빌드에서만 마운트되는 컴포넌트로 옮겼습니다.
이 세 가지는 예전에
fix/production-logging브랜치(92efc86)에서 이미 작업된 내용인데 머지되지 않은 채origin/main대비 94커밋 뒤처져 있었습니다. 그 브랜치의 접근을 현재 main에 맞춰 다시 적용했습니다.확인 방법
npm test로__tests__/babel-config.test.js가 통과하는지 봐주세요. 실제babel.config.js를envName: "production"으로 돌려서console.log가 사라지고console.warn과console.error는 남는지 검증합니다.릴리즈 빌드에서는 트래킹을 시작했을 때 Xcode 콘솔이나 logcat에
[STOMP],[Push],[Tracking]로그가 찍히지 않아야 합니다. 개발 빌드에서는 종전대로 다 보여야 합니다.리뷰 포인트
원래 브랜치(92efc86)에는 Sentry
tracesSampleRate를 1.0에서 0.2로 낮추는 변경도 함께 있었습니다. 계측 오버헤드와 쿼터에 영향이 있어서 성능과 무관하지 않지만, 관측성을 줄이는 결정이라 이 PR에서는 빼뒀습니다. 필요하면 별도로 올리겠습니다.transform-remove-console은 호출 자체를 지우므로 인자 계산도 함께 사라집니다.Object.keys(...).join(",")같은 인자를 넘기던 로그가 몇 군데 있어서 그 계산도 릴리즈에서는 없어집니다. 의도한 동작입니다.STOMP
debug를 no-op으로 바꿔도 stompjs가 프레임 문자열을 만들어 콜백에 넘기는 것 자체는 막지 못합니다. 라이브러리를 건드리지 않고 줄일 수 있는 선은 여기까지입니다..js테스트 파일에서 jest 전역이no-undef로 잡혀서eslint.config.js에 테스트 파일용 전역 설정을 추가했습니다.체크리스트
className(NativeWind)으로 작성했고, 토큰에 있는 값을 하드코딩하지 않았습니다boxShadow를 사용했습니다 (shadow*/elevation미사용)tokens/**,tokens.cjs,typography-plugin.cjs,css/variables.css,css/typography.css)을 직접 수정하지 않았습니다npm run typegen결과를 반영했거나, 반영하지 않은 이유를 적었습니다 — 스펙 변경 없음