-
Notifications
You must be signed in to change notification settings - Fork 3
Feature: JSON-LD 추가 #76
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 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
06ff8c1
✨ feat: add JSON-LD
guesung d1d607e
Merge remote-tracking branch 'origin/develop' into feat/add-json-ld
guesung 9e319a6
refactor: Analytics를 둘러싼 Suspense 제거
guesung a478e44
♻️ refactor : 컴포넌트 구조 컨벤션처럼
seondal 054d253
Merge remote-tracking branch 'origin/develop' into feat/add-json-ld
guesung 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
File renamed without changes.
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,15 @@ | ||
import Script from 'next/script'; | ||
|
||
import { JSON_LD } from '@/constants'; | ||
|
||
export default function JsonLD() { | ||
return ( | ||
<Script | ||
id="faq-schema" | ||
type="application/ld+json" | ||
dangerouslySetInnerHTML={{ | ||
__html: JSON.stringify(JSON_LD), | ||
}} | ||
/> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import './globals.css'; | ||
|
||
import { Suspense } from 'react'; | ||
|
||
import { Analytics } from '@/components/Analytics'; | ||
import Analytics from './Analytics'; | ||
import JsonLD from './JsonLD'; | ||
import { OverlayProvider } from '@/components/Overlay/OverlayProvider'; | ||
import METADATA from '@/constants/meta'; | ||
import QueryProvider from '@/provider/QueryProvider'; | ||
|
@@ -16,11 +15,10 @@ export const metadata: Metadata = METADATA; | |
export default function RootLayout({ children }: PropsWithChildren) { | ||
return ( | ||
<html lang="ko"> | ||
<body className="flex justify-center w-screen touch-none bg-slate-100"> | ||
<div className="w-full overflow-scroll bg-white max-w-layout text-primary"> | ||
<Suspense> | ||
<Analytics /> | ||
</Suspense> | ||
<body className="flex w-screen touch-none justify-center bg-slate-100"> | ||
<div className="w-full max-w-layout overflow-scroll bg-white text-primary"> | ||
<Analytics /> | ||
<JsonLD /> | ||
<QueryProvider> | ||
<RecoilProvider> | ||
<OverlayProvider>{children}</OverlayProvider> | ||
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. 이 코드 패치는 대부분 좋아 보입니다. 개선 제안은 다음과 같습니다:
|
||
|
This file was deleted.
Oops, something went wrong.
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 @@ | ||
export * from './JsonLD'; |
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 @@ | ||
export * from './meta'; |
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
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.
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.
JsonLD
컴포넌트를 가져오기 위해 새로운 import 문이 추가되었습니다. 이 코드 변경은 기능적인 면에서 안전합니다.RootLayout
함수 내에서<JsonLD />
컴포넌트가 Suspense 컴포넌트로 감싸여 있지 않습니다. 만약JsonLD
컴포넌트가 데이터를 비동기적으로 로드한다면, Suspense로 감쌀 것을 고려해 볼 수 있습니다.코드 리뷰에는 주로 더 많은 context나 페이지 전반의 처리 방식이 필요하지만, 해당 코드 조각 자체가 작아서 뚜렷한 문제점이 나타나지는 않습니다.
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.
React Suspense는 주로 비동기 작업(데이터 패칭, 지연 로딩 컴포넌트)을 처리하기 위해 사용합니다. JSON-LD스크립트는 정적 메타 데이터로, 비동기 로딩이 필요하지 않습니다.
또한, Suspense로 감싸면 서버에서 렌더링을 하지 않기 때문에 내부 컴포넌트의 렌더링에 있어서 지연이 발생해 SEO에 부정적인 영향을 미칠 수 있습니다.