feat(dmm-tv): DMM ロビーページ + 全サービス表記/統計 + hydration 修正#17
Open
Uno-Takashi wants to merge 5 commits into
Open
Conversation
- lobby: /dmm-tv/lobby/[roomId] を追加(anime-store/lobby のミラー)。REST
api/v1/dmm-tv/lobby/{room_id} で再生ページ URL を解決し、拡張機能の互換判定
(.chrome_extension_field)を待って /vod/playback/on-demand/?...&party=join へ
リダイレクト。未インストール/非対応はインストール導線(DMM タイマーは後続)。
- env: DMM_LOBBY_RESOLVE_ENDPOINT を追加。
- 表記: ランディング/メタデータ/Footer/Features/OG を「dアニメストア・DMM TV」併記へ。
- stats: バックエンドを全サービス合算にしたため、統計ダッシュボードは無改修で
dアニメ + DMM の合計を表示する。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ロビーの `.chrome_extension_field` は拡張機能が hydration 前に innerText を 書き換えるため、SSR とクライアントで内容が食い違い hydration mismatch が出ていた。 React 標準の suppressHydrationWarning を付与(DOM 契約・クラス名・ポーリングは不変)。 anime-store と dmm-tv の両ロビーへ適用。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
拡張機能が hydration 前に `.chrome_extension_field` の innerText を書き換えるため、 suppressHydrationWarning でも hydration mismatch が残りルーム遷移でエラーしていた。 useSyncExternalStore(server=false / client=true)でクライアント限定描画にし、 SSR HTML に一切含めない(拡張は 1 秒間隔でポーリングするのでマウント直後に現れれば 検出される)。anime-store / dmm-tv 両ロビーへ適用。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pnpm 10 は package.json の "pnpm" フィールドを読まなくなり警告が出ていた。設定を pnpm-workspace.yaml へ移し、package.json の pnpm フィールドを削除する。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
feat(dmm-tv): DMM ロビーページ + 全サービス表記/統計 + hydration 修正
概要
DMM TV 対応に伴うユーザー向けフロントエンドの変更です。DMM のルーム遷移ロビーを追加し、
ランディング/メタデータ等の表記を「dアニメストア・DMM TV」併記へ更新、ロビーの hydration
不具合を修正します。
変更点(ファイル別・変更理由)
DMM ロビー
src/app/dmm-tv/lobby/[roomId]/page.tsx(新規) — dアニメのanime-store/lobbyのミラー。GET /api/v1/dmm-tv/lobby/{room_id}(backend)で再生ページ URL を解決し、拡張機能の互換判定(
.chrome_extension_field)を 1 秒間隔でポーリングして/vod/playback/on-demand/?...&party=joinへリダイレクト。未インストール/非対応時はインストール導線。src/infrastructure/env.ts—DMM_LOBBY_RESOLVE_ENDPOINTを追加。hydration 修正(拡張機能との DOM 契約)
.chrome_extension_fieldのinnerTextを書き換えるため、SSR 出力すると必ず hydration mismatch になり、
suppressHydrationWarningでも消えずルーム遷移でエラーしていた。useSyncExternalStore(server=false / client=true)でこの要素をクライアント限定描画にし、SSR HTML に一切含めない方式へ変更(
anime-store/dmm-tv両ロビー)。拡張機能は 1 秒間隔でポーリングするのでマウント直後に現れれば検出される。
※
setState-in-effect 版はreact-hooks/set-state-in-effectlint で落ちるため不採用。表記の併記(dアニメストア・DMM TV)
layout.tsx(メタデータ/keywords)・page.tsx(Hero/CTA/手順)・components/landing/{Hero,Features}・components/layout/Footer・OG 画像(components/og/RoomOgImage・lib/og/renderRoomImage)を併記へ更新。統計(無改修で合算表示)
フロント側は無改修で両サービスの合計を表示します(この PR にダッシュボードのロジック変更は含みません)。
DX
pnpm-workspace.yaml(新規) /package.json— pnpm 10 で無視されるpnpmフィールドのonlyBuiltDependenciesをpnpm-workspace.yamlへ移設(警告解消)。検証
pnpm typecheck/pnpm lint: green。pnpm build(Turbopack, standalone):/dmm-tv/lobby/[roomId]ルートが生成されることを確認。依存関係
d-party/backend):GET /api/v1/dmm-tv/lobby/{room_id}が必要。d-party/chrome-extension): ロビーの.chrome_extension_fieldDOM 契約と対。d-party/d-party): nginx が/dmm-tv/lobby/をフロントへ、/apiを django へ振り分け。ロビーの DOM 契約(変更厳禁の要点)
.chrome_extension_fieldのクラス名・1 秒ポーリング挙動は不変(拡張機能が判定を書き込む)。