-
Notifications
You must be signed in to change notification settings - Fork 0
[PERF] 성능 리포트 측정 오류 및 LCP 이미지 최적화 수정 #126
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
Changes from all commits
b7d127c
e219f62
1eac69b
c89a6a2
d092ac8
96c6d05
1ed63af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,16 +4,15 @@ | |
| module.exports = { | ||
| ci: { | ||
| collect: { | ||
| // "/en", "/en/onboarding", and the "/en/settings*" routes are still | ||
| // placeholder pages (`return <></>`) with no content to paint, so | ||
| // Lighthouse always times out with NO_FCP there — omit them until | ||
| // they're implemented. | ||
| url: [ | ||
| "http://localhost:3000", | ||
| "http://localhost:3000/home", | ||
| "http://localhost:3000/today", | ||
| "http://localhost:3000/focus", | ||
| "http://localhost:3000/statistics", | ||
| "http://localhost:3000/onboarding", | ||
| "http://localhost:3000/settings", | ||
| "http://localhost:3000/settings/account", | ||
| "http://localhost:3000/settings/term", | ||
| "http://localhost:3000/en/home", | ||
| "http://localhost:3000/en/today", | ||
| "http://localhost:3000/en/focus", | ||
| "http://localhost:3000/en/statistics", | ||
|
Comment on lines
+12
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR 설명에 존재하지 않던 /settings/term을 실제 라우트 /settings/policy로 수정했습니다" 라고 적어주셨는데 해당 페이지가 아직 머지되지않아 의도적으로 뺴두신게 맞을까요?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 옙`~~ 페이지 내부에 아무 콘텐츠가 없으면 CI가 실패하는 문제가 있어서, 퍼블리싱 시작되는 대로 추가해야 할 것 같아요. |
||
| ], | ||
| numberOfRuns: 3, | ||
| settings: { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
정규식 파싱의 안정성 개선을 권장합니다
extractClientReferenceManifest의 정규식"\]\s*=\s*(\{[\s\S]*\});\s*$에서[\s\S]*가 greedy하게 동작합니다. 매니페스트 파일에 여러 할당문이 존재할 경우, 첫 번째{부터 마지막}까지 모두 캡처하여 중간 할당문 내용이 포함되고JSON.parse가 실패합니다. 실패 시null이 반환되어 해당 라우트의 크기가 0바이트로 보고되는 침묵 오류가 발생합니다.lastIndexOf를 활용한 방식이 더 견고합니다.♻️ 제안하는 리팩터
const extractClientReferenceManifest = (jsFilePath) => { if (!jsFilePath || !fs.existsSync(jsFilePath)) return null; try { const content = fs.readFileSync(jsFilePath, 'utf8'); - const match = content.match(/"\]\s*=\s*(\{[\s\S]*\});\s*$/); - return match ? JSON.parse(match[1]) : null; + const lastAssign = content.lastIndexOf('"]'); + if (lastAssign === -1) return null; + const jsonStart = content.indexOf('{', lastAssign); + const jsonEnd = content.lastIndexOf('}'); + if (jsonStart === -1 || jsonEnd === -1 || jsonStart > jsonEnd) return null; + return JSON.parse(content.slice(jsonStart, jsonEnd + 1)); } catch { return null; } };📝 Committable suggestion
🧰 Tools
🪛 ast-grep (0.44.1)
[warning] 37-37: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(jsFilePath, 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
(detect-non-literal-fs-filename)
🤖 Prompt for AI Agents