Skip to content

N0BU0x エントリー#268

Open
N0BU0x wants to merge 21 commits intoCyberAgentHack:mainfrom
N0BU0x:main
Open

N0BU0x エントリー#268
N0BU0x wants to merge 21 commits intoCyberAgentHack:mainfrom
N0BU0x:main

Conversation

@N0BU0x
Copy link
Copy Markdown

@N0BU0x N0BU0x commented Mar 20, 2026

N0BU0x エントリー用PR

N0BU0x added 4 commits March 20, 2026 12:17
- webpack: mode production, minify, tree shaking 有効化, ソースマップ除去
- babel: IE11→モダンブラウザ, ESモジュール化, React production
- entry: 不要なポリフィル除去 (core-js, regenerator-runtime, jquery-binarytransport)
- EnvironmentPlugin NODE_ENV を production に修正

main.js: 108MB → 31MB / Score: 2 → 4
- fetchers.ts: async:false 除去(メインスレッドブロック解消)
- index.tsx: window.load → DOMContentLoaded(描画開始を早期化)
- InfiniteScroll.tsx: 2^18回ループ削除 + passive:true
- AspectRatioBox.tsx: 500ms遅延削除 + passive:true

Score: 4 → 44 / TBT: 7,530ms → 430ms / CLS: 0.484 → 0
- サーバーにcompression middlewareを追加(gzip圧縮)
- Cache-Control: max-age=0, no-transform / Connection: close ヘッダーを除去
- webpack: asset/bytes → asset/resource でWASM/FFmpegを別ファイルに分離
- convert_image.ts: WASM URLをfetchしてUint8Arrayで渡す方式に変更
- load_ffmpeg.ts: Blob URL生成を廃止し直接URLを渡す方式に変更
- main.js 31MB → 12.3MB、FCP 160.6s → 66.0s (-59%)
- moment.js → Intl.DateTimeFormat / Intl.RelativeTimeFormat に置換 (-0.67MB)
- lodash → ネイティブJS に置換 (-0.53MB)
- standardized-audio-context → ネイティブAudioContext に置換 (-0.52MB)
- CrokContainer / SearchContainer / NewPostModalContainer を React.lazy化
- web-llm / negaposi-analyzer-ja を dynamic import化
- main.js 11.89MB → 700KB (94%削減)、FCP 63.6s → 5.2s
- SearchContainerをReact.lazyから通常importに戻す(スコアリングテスト対応)
- fetchBinaryをjQuery.ajaxからネイティブfetch()に変更(画像表示修正)
- jQuery + pako を完全除去、全API呼び出しをネイティブfetch()に置換 (-308KB)
- DM詳細のsetInterval(1ms)をMutationObserverに置換 (TBT改善)
- font-display: block → swap (FCP/LCP改善)
- script defer属性追加 (レンダリングブロック解消)
- 静的ファイルにCache-Control追加 (etag:false → maxAge+immutable)
- ProvidePluginからjQuery除去
- main.js 702KB → 573KB
- @tailwindcss/browser CDNスクリプト除去(ランタイムCSS処理を消滅)
- @tailwindcss/postcss でビルド時CSS生成に移行
- index.html 180行→14行(インラインstyle 174行をindex.cssに移動)
- OTFフォント→WOFF2変換(12.6MB→7.3MB, 42%削減)
N0BU0x added 2 commits March 21, 2026 10:59
- AspectRatioBox: JS計算→CSS aspect-ratio(CLS修正)
- CoveredImage: バイナリ取得+image-size除去→<img>直接表示+object-fit:cover
- piexifjs動的import化、Bufferポリフィル除去
- useInfiniteFetch: 全件取得→limit/offsetペジネーション
- /posts,/commentsにデフォルトLIMIT 30追加
- DBインデックス追加(Post,Comment,DM,Conversation,PostsImages)
- フォントサブセット化: 7.3MB→46KB(99%削減)
- main.js: 573KB→506KB
- webpack splitChunks有効化: entry 539KB→377KB
- 全ルートをReact.lazy化: main.js 506KB→31KB
- HtmlWebpackPlugin inject:true + defer
- AppContainer: isLoadingActiveUser gate除去 → FCP改善
- HTML Invoker API (command/commandfor) polyfill追加
- DM routes: unscoped + separate:true最適化
- index.html: FCP向上のためローディングスケルトン追加
- app.ts: session/bodyParserをAPIルートのみに適用(静的ファイル配信高速化)
- Post.ts: images関連をseparate:trueに変更しJOINを回避
- CoveredImage: EXIF alt取得をボタンクリック時のみに変更(TBT大幅改善)
- PausableMovie: IntersectionObserverで遅延読込+gifler/omggif動的import
- SoundPlayer: fetchBinary廃止→ネイティブaudio srcに変更(TBT改善)
- static.ts: sharp導入で画像をWebP/AVIF変換+リサイズ(6.7MB→138KB)
- webpack: KaTeXフォントをWOFF2のみに(TTF/WOFF除外)
- Post.ts: separate:true削除(BelongsToMany非対応のため)
- index.tsx: defer属性のためDOMContentLoaded不要→即座にレンダリング開始
- index.html: フォントpreloadヒント追加(LCP改善)
- TimelineItem/PostItem/CommentItem: プロフィール画像にloading="lazy"追加
- DateTimeFormatインスタンスをモジュールレベルでキャッシュ(TBT改善)
- index.html: APIプリフェッチスクリプト追加(JS解析前にデータ取得開始)
- TranslatableText: createTranslator動的import化(common-tags/langs初期ロード削除)
- fetchers.ts: __PREFETCH__からプリフェッチ済みデータを利用
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