Open
Conversation
Made-with: Cursor
- mise で Bun 1.3.9 を固定(pnpm は削除) - application の workspaces を package.json に集約、overrides/trustedDependencies を移行 - Makefile・Dockerfile・request ワークフローを bun に合わせて更新 - pnpm-lock.yaml を削除し bun.lock を追加 - e2e に playwright:install スクリプトを追加
…/Sequelize)
- Webpack: mode=production, minify+splitChunks有効, devtool=false, jQuery削除
→ main.js: 108MB(unminified) → 245KB+vendors chunk(minified)
→ core-js/regenerator-runtime/jquery-binarytransport をentryから除去
- fetchers.ts: $.ajax(async:false) → fetch() へ全面置き換え
→ メインスレッドのブロッキングを解消
- InfiniteScroll: Array(2**18)ループ → IntersectionObserver へ置き換え
→ スクロール毎の26万要素配列生成とGC負荷を解消
- Post/Comment defaultScope: includeを除去しscope('withAll'/'withUser')化
→ 不要時の関連ロードを防止、各ルートで明示的にscope適用
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- inject:false→inject:'body' + scriptLoading:'defer' に変更 → HtmlWebpackPluginがscripts/959.js + scripts/main.js を自動注入 - index.htmlのハードコードされた<script>/<link>を削除(二重読み込み防止) 以前はscripts/959.js(vendors chunk)がHTMLに含まれず、 React/依存ライブラリが未ロードのためページが真っ白になっていた。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- chore: pnpm → Bun 移行 - perf: Webpack最適化・jQuery→fetch・InfiniteScroll→IntersectionObserver・Post/Comment defaultScope最適化 - fix: splitChunksのvendors chunkをHTMLに正しく注入 - docs: PERFORMANCE.md に技術制約なし追加アプローチを追記 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
publicPath:"auto" だと相対パスになり、SPA でサブルート (/timeline 等) に いるときに scripts/959.js が /timeline/scripts/959.js へ解決されて404になる。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- index.tsx: window.addEventListener("load") → 即時実行
deferスクリプトはHTML parse完了後に実行されるためDOMは既に準備済み
load待ちはリソース読み込み完了まで遅延させ不要なブランクページを招く
- webpack: sideEffects: true → false
パッケージのsideEffectsフィールドによる誤ったtree-shakingを防止
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- development: true → false
本番ReactにはjsxDEVが存在しないためproduction JSX transformに変更
- modules: "commonjs" → false
webpackにESモジュール解析を委ねてtree-shakingを有効化
- targets: "ie 11" → { esmodules: true }
IE11向けpolyfillを廃止しモダンブラウザ向けに最適化
効果: main.js 245KB → 118KB、ビルド時間 20s → 13s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 全コンポーネントの profileImage?.alt / profileImage?.id をオプショナルチェーン化 (AccountMenu, TimelineItem, PostItem, CommentItem, DirectMessageListPage, DirectMessagePage, UserProfileHeader) - fetchers.ts に checkOk ヘルパーを追加して非2xxレスポンスを確実にエラーにする - DM一覧APIを最適化: 全メッセージを全件ロードせず最新メッセージのみ取得 - DM一覧にlatestMessage/hasUnreadフィールドを追加してUI表示に対応 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SSEプロトコル自体は維持しつつ、初回レスポンスまでの3秒待ちと 1文字ごとの10ms遅延を削除。AI応答が即座に開始されるようになる。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Connection: close を削除 → HTTP keep-alive 有効化 - 全レスポンスへの Cache-Control: max-age=0 を削除 - API (/api/v1) に no-store を設定 - scripts/chunk-*.js / fonts に max-age=1年+immutable を設定 - public / upload ファイルに max-age=1日を設定 - etag + lastModified を有効化 → 304 条件付きリクエスト対応 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
画像1枚ごとに発生していた全バイナリダウンロード→EXIF解析→Blob URL生成を廃止。
- useFetch/fetchBinary/sizeOf/piexifjs/URL.createObjectURL を削除
- <img src={src} loading="lazy"> + object-cover で代替
- alt テキストは API の image.alt を prop で受け取る形に変更
- ImageArea.tsx に alt={image.alt} を追加
タイムライン30枚の場合、30回の余分なフェッチ+デコードが完全に不要になる。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
テキスト検索とユーザー名/名前検索を別々に実行していた2クエリを OR条件の1クエリに統合。JS側のマージ・重複排除・ソート・スライスも廃止。 - $user.username$ / $user.name$ でJOIN済みカラムをWHEREで直接参照 - ORDER BY createdAt DESC をDB側で処理 - subQuery: false でlimit/offsetを正しく適用 - 不要なfindAll2回目・Set・merge処理を削除 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CyberAgentHack#11 sequelize.ts: mkdtempを廃止し固定パスへ上書きコピーに変更 → tmpdir に毎回コピーが蓄積する問題を解消 CyberAgentHack#16 GET /posts: limitデフォルトをundefined(全件)→30件に変更 ORDER BY createdAt DESC を追加 CyberAgentHack#17 GET /users/:username/posts: User.findOne+Post.findAll の2クエリを "$user.username$" 条件で1クエリに統合 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CyberAgentHack#13 React.memo でラップし、親の再レンダー時に不要な再レンダーを防止 CyberAgentHack#14 プロフィール画像imgにloading="lazy"を追加し スクロール範囲外の画像をブラウザが遅延ロードするように変更 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Made-with: Cursor
## 変更内容 ### CoveredImage.tsx — 元実装に戻す(VRT修正) - HEAD版: object-cover + src直接表示 + loading=lazy → VRTで写真レイアウトが変化 - 初期コミット版(バイナリフェッチ→blobURL表示)に復元 - ImageArea.tsx: 不要になった alt prop 渡しを削除 ### fetchers.ts — jQuery→fetch移行 + 互換エラーオブジェクト対応 - $.ajax(async:false) → 非同期 fetch() に置き換え - checkOk に responseJSON / status フィールドを追加 (AuthModalContainer が参照する jQuery エラー互換ロジック) ### post.ts — limit/order を初期コミット相当に戻す - GET /posts: limit:30 固定 → undefined (全件)、order:createdAt → id DESC useInfiniteFetch がクライアント側スライスで動作するため ### DirectMessagePage.tsx — スクロール実装をrequestAnimationFrameに改善 - setInterval(1ms) + documentBodyHeight比較 → rAF + scrollHeight 参照 ### DirectMessageContainer.tsx — メッセージソートとクリーンアップを追加 - DM受信後にクライアント側でも createdAt ASC ソートを保証 - タイマーのクリーンアップ useEffect を追加 ### scoring-tool — DM ページの計測安定化 - DM一覧/詳細ページは WebSocket で networkidle にならないため waitUntil:'load' + waitForRequestsComplete:false を設定 ### Makefile — E2Eテスト分割ターゲットを追加 - e2e-core / e2e-auth / e2e-post / e2e-dm / e2e-crok の分割実行 - E2E_SPEC / E2E_GREP 変数でテストを絞り込み可能に Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
height:0のsentinelはChromiumのIntersectionObserverで交差面積=0となり isIntersecting=trueが発火しない問題を修正。 1pxの高さを付与することでスクロール到達時に正しくfetchMoreが呼ばれ 無限スクロールが機能するようになる。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WSイベント送信と afterSave フック処理の遅延を切り分けるために、タイミング情報を出力する。 Made-with: Cursor
- use_search_params: scheduler.postTask無限ポーリング → useLocation() + useMemo - use_has_content_below: scheduler.postTask無限ループ → useLayoutEffect + scroll/resizeにrAFスロットル - CrokPage: isStreamingをuseHasContentBelowに渡しストリーミング終了時に再計測 - Makefile: bun run --filterをbunx playwright directに変更 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sincePattern/untilPatternのネストした量指定子(…+)+$と slowDateLikeの(\d+)+をシンプルな正規表現に置き換え。 採点シナリオの長い不正入力(since:2026-01-06 + 20桁+x)での 指数的バックトラックを解消しTBT/INPを改善。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
limit/offsetと hasMore 制御で、取得しきった後に追加フェッチをしないようにしました。 Made-with: Cursor
Updated the sendJSON function to send raw JSON instead of compressed data, as gzip was deemed unnecessary for server processing. This change simplifies the request handling and reduces CPU load.
- index.css から Rei no Are Mincho の @font-face を削除し main.css を軽量化 - public/styles/terms-font.css を追加し TermContainer で link 注入 Made-with: Cursor
- webpack-bundle-analyzer を devDependency に追加、make analyze で起動 - @ffmpeg/core の asset/bytes → asset/resource に変更してメインバンドルから分離 - loadFFmpeg を blob URL 生成なしで直接 URL を渡す形に簡略化 - SoundWaveSVG の波形計算を lodash 多段パス → native TypedArray 単一ループに置換(56x 高速化) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
## クライアント (webpack/babel)
- devtool: inline-source-map → false(main.js 108MB → 425KB)
- mode: none → production(minify・tree shaking有効)
- babel targets: ie11 → モダンブラウザ、modules: commonjs → false
- chunkFormat: false 削除、runtimeChunk: single 追加
- core-js/regenerator-runtime をエントリから削除
- index.html に runtime.js・defer 追加
## クライアント (コード分割・遅延読み込み)
- AppContainer: 全ルートを React.lazy() で遅延読み込み
(初期エントリーポイント 13.4MB → 438KB)
- @mlc-ai/web-llm を動的 import() に変更
- CoveredImage: IntersectionObserver で fetchBinary を遅延化
(ビューポート外の投稿画像を起動時に取得しない)
- useFetch: null を渡すと fetch をスキップするよう対応
- img[loading=lazy] を TimelineItem・CommentItem・DirectMessageListPage に追加
## サーバー
- Sharp ミドルウェア追加: 画像を JPEG resize(1200px) + mozjpeg q80 に変換
(5MB JPEG → 155KB、97%削減、インメモリキャッシュで2回目1ms)
- Cache-Control: 静的ファイルを immutable 1年、API を no-store に分離
- etag・lastModified を有効化
- server/index.ts: PORT解析を堅牢化、server.once("listening") でログ
- express_websocket_support: url.parse → WHATWG URL API (withWsSuffix)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GIF→H.264 MP4: ffmpegでサーバーサイド変換(98%削減)、video要素でネイティブ再生 - アイコン/プロフィール画像を512px WebPに変換(74%削減) - PausableMovieをIntersectionObserverで遅延ロード(rootMargin 200px) - canvasをDOM常駐させてe2eテスト要件を満たす - Dockerfileにffmpegインストールを追加 - webpackからjqueryとProvidePlugin不要設定を削除 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Made-with: Cursor
Made-with: Cursor
- Added TARGETPLATFORM argument to ensure compatibility with Linux amd64 and prevent discrepancies during builds on Apple Silicon. - Updated FROM instruction to utilize the specified platform.
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.
No description provided.