Skip to content

docs: define PPR and cache components policy - #94

Merged
sakatai11 merged 2 commits into
developfrom
docs/issue-92-ppr-cache-components-policy
Jul 27, 2026
Merged

sakatai11 merged 2 commits into
developfrom
docs/issue-92-ppr-cache-components-policy

Conversation

@sakatai11

@sakatai11 sakatai11 commented Jul 27, 2026

Copy link
Copy Markdown
Owner

概要

Issue #92#78 のフェーズ0)として、Next.js Cache Components / PPR の導入方針を設計文書に確定します。
将来の対象ルート、安全なユーザー固有データの扱い、OpenNext既知制約と有効化条件を明文化しました。

主な変更点

  • cacheComponents の将来対象を //review に限定
  • ユーザー固有データには 'use cache' を使わず、静的シェルと非キャッシュの動的領域を <Suspense> で分離
  • /learn/.../quiz/... は content 由来の SSG/RSC を維持
  • OpenNext issue 1130 / issue 1225 と、preview / production相当での検証を含む有効化条件を記録
  • docs/frontend-architecture.html を一次ソースの docs/design.md と同期

関連 Issue

refs #92
refs #78

スクリーンショット(必要に応じて)

UI変更なし

変更の種類

  • 🐛 バグ修正 (Bug fix)
  • ✨ 新機能 (New feature)
  • 💄 UI/スタイル変更 (UI/Style changes)
  • ⚡ パフォーマンス改善 (Performance improvement)
  • ♻️ リファクタリング (Refactoring)
  • 📝 ドキュメント更新 (Documentation)
  • 🧪 テスト追加・修正 (Tests)
  • 🔧 設定・ツール変更 (Configuration/Tools)
  • 🚀 デプロイ・インフラ (Deploy/Infrastructure)

テスト

  • pnpm typecheck
  • pnpm biome check .(126 files)
  • pnpm test(91 passed)
  • git diff --check

チェックリスト

  • コードレビューの準備ができている
  • 関連するドキュメントを更新した
  • 破壊的変更がある場合、適切に文書化した
  • セキュリティ上の問題がないことを確認した
  • 既存のテストが通ることを確認した
  • コーディングガイドラインに従っている
  • 動作確認済み(主要ブラウザ・画面サイズも確認)
  • 警告が発生していない
  • console.log や debugger が残っていない
  • 機密情報や API キーが含まれていない
  • 不要な再レンダリングが発生していない(ドキュメントのみ)
  • 冗長なコードを避け、関数やコンポーネントを再利用している(ドキュメントのみ)
  • ドキュメントが更新されている
  • PR の説明が分かりやすく書かれている

追加の注意事項

初期レビューの指摘6件(ローカル1件、CodeRabbit 5件)は 5035af6 で修正済みです。
修正増分はローカルreviewer 2件がapproveし、CodeRabbit Appの増分レビューでも
追加のactionable commentはありませんでした。

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Cache Components / PPR の対象ルートと制約を文書化し、/review の静的シェルとユーザー固有処理を Suspense で分離する設計例・図解を更新した。OpenNext の検証完了まで本機能を有効化しない前提も追加した。

Changes

Cache Components / PPR 方針

Layer / File(s) Summary
ルート別キャッシュ方針
docs/design.md, docs/frontend-architecture.html
PPR 対象を //review に限定し、API-backed page の force-dynamic、キャッシュディレクティブを使わない方針、OpenNext 検証条件を追加した。
/review の Suspense 分離
docs/design.md, docs/frontend-architecture.html
静的シェルとユーザー固有の非キャッシュ Server Component を Suspense で分離し、レビューキュー取得から content index への結合までの例と図解を更新した。
レビュー loader 実装例
docs/frontend-architecture.html
loadReview による API 取得と content index への join、および ReviewPageShellSuspense を使うページ構成にコード例を更新した。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed 変更内容の中心である Next.js の Cache Components / PPR 方針確定を簡潔に表しており、PR内容と一致しています。
Description check ✅ Passed 概要、主な変更点、関連Issue、テスト、チェックリストが揃っており、テンプレート要件をほぼ満たしています。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sakatai11

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/design.md`:
- Line 1472: Update the date in the `@opennextjs/cloudflare` upstream issue
statement to 2026-07-27 or remove the date entirely, and recheck the issue
status at merge time.
- Around line 509-516: docs/design.md の ReviewUserContent コード例に、使用している
ReviewRunner と loadReview をそれぞれ client/components/review-runner および
server/load-review から明示的に import する記述を追加し、TypeScript でコンパイル可能にしてください。
- Around line 1474-1475: Update the OpenNext issue summaries at docs/design.md
lines 1474-1475 and docs/frontend-architecture.html lines 562-563: describe
`#1130` as the production-only SyntaxError/crash with Suspense rendering failure,
and `#1225` as the Suspense streaming issue that results in “Connection closed.”

In `@docs/frontend-architecture.html`:
- Around line 1064-1069:
統一されていないレビューキューのローダー名を、docs/design.mdで定義された正式名称に合わせる。ReviewUserContentのloadReviewQueue参照と関連するimportをloadReviewへ変更し、補助資料内でもload-review.tsのloadReview()契約を一貫して使用する。
- Line 769: Update the Mermaid diagram flow line containing page, userContent,
serverLoader, rpcWrapper, and endpoint so every Mermaid arrow greater-than
character is HTML-escaped as --&gt;. Preserve the rendered Mermaid text and
diagram behavior while satisfying HTMLHint spec-char-escape.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c134a80-4796-49e7-9936-c753f226fd6e

📥 Commits

Reviewing files that changed from the base of the PR and between 5659f09 and c9da71e.

📒 Files selected for processing (2)
  • docs/design.md
  • docs/frontend-architecture.html

Comment thread docs/design.md
Comment thread docs/design.md Outdated
Comment thread docs/design.md Outdated
Comment thread docs/frontend-architecture.html Outdated
Comment thread docs/frontend-architecture.html Outdated
@sakatai11

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sakatai11

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sakatai11
sakatai11 marked this pull request as ready for review July 27, 2026 23:00
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@sakatai11
sakatai11 merged commit b47ebf9 into develop Jul 27, 2026
2 checks passed
@sakatai11
sakatai11 deleted the docs/issue-92-ppr-cache-components-policy branch July 27, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant