app-ui-migration
Freeapp 側のページ実装を `@playlistwizard/ui` へページ単位で移行するための方針。`@/components/ui/*` import の置換、共通コンポーネント化、既存表示差分の抑制、packages/ui 側の variant 設計を伴う作業で参照すること。
The English summary is being prepared. Showing the original description.
Next.js AppRouter における、データフェッチング、データベースへのクエリ発行のベストプラクティス。データフェッチを伴う処理を実装、変更する場合はこのドキュメントを参照すること。
The English summary is being prepared. Showing the original description.
See how to installReview the instructions the agent will receive before you install.
ここでのデータフェッチは以下のようなものを含む。
サーバーサイドでのデータフェッチングは以下のようなコードで行う。 要点:
import { Suspense } from "react";
export function SomePage() {
return (
<>
<Header />
<Suspense fallback={<BarLoading />}>
<Bar />
</Suspense>
</>
);
}
export function BarLoading() {
return <div>Loading...</div>;
}
export async function Bar() {
const res = await fetch("https://example.com");
const data = await res.json();
return <div>{data}</div>;
}
サーバーコンポーネントでのデータフェッチにおける Suspense の仕様に関しては、 Server-side Data Fetching セクションを参照。
以下ではクライアントサイドにおける Suspense の使用のガイドラインを示す。 要点は以下:
クライアントサイドでの Tanstack Query を使用したデータフェッチで、ページ読み込み時にもデータが必要な場合は、サーバーサイドで prefetch することが推奨される。 これにより、ユーザー操作の伴わない Tanstack Query のデータフェッチをサーバーサイドで行うことができ、クライアントに比べ比較的ネットワーク環境が安定しているサーバーサイドでデータフェッチを行うことで、パフォーマンスの向上につながる。
// page.tsx(サーバーコンポーネント)
import {
dehydrate,
HydrationBoundary,
QueryClient,
} from "@tanstack/react-query";
export default async function Page() {
const queryClient = new QueryClient();
await queryClient.prefetchQuery({
queryKey: ["posts"],
queryFn: fetchPosts,
});
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<Posts />
</HydrationBoundary>
);
}
// Posts.tsx
'use client';
export function Posts() {
const { data } = useQuery({
queryKey: ["posts"],
queryFn: fetchPosts,
});
return <div>{data}</div>;
}
No reviews yet. Tell others what you thought.
No login needed. Share how it worked for you, ask a question, or note where it did not run.
No comments yet. Be the first to write one.
app 側のページ実装を `@playlistwizard/ui` へページ単位で移行するための方針。`@/components/ui/*` import の置換、共通コンポーネント化、既存表示差分の抑制、packages/ui 側の variant 設計を伴う作業で参照すること。
The English summary is being prepared. Showing the original description.
Skill for integrating Better Auth - the comprehensive TypeScript authentication framework.
The English summary is being prepared. Showing the original description.
Skill for creating auth layers in TypeScript/JavaScript apps using Better Auth.
The English summary is being prepared. Showing the original description.
ユーザーと対話しながら機能仕様を策定し、Notion に自動でドキュメント化するスキル。「仕様を作ろう」「スペックを書いて」「仕様を詰めよう」などの指示で呼び出される。
The English summary is being prepared. Showing the original description.
git に関する全ての操作やこのプロジェクトのgitに関する情報が欲しい時に呼び出されるスキル(branch, commit, push, pull, merge ...)
The English summary is being prepared. Showing the original description.
GitHub に関する全ての操作やこのプロジェクトの GitHub に関する情報が欲しい時に呼び出されるスキル(PR, Issue)
The English summary is being prepared. Showing the original description.