Repository navigation
fix: Animate UI バンドルの識別子名を決定的にする - #79
Merged
Merged
Conversation
esbuild's minifyIdentifiers step assigns names from a character-frequency histogram, so the same program structure can still produce different minified names. Keep pinned esbuild 0.28.2 for bundling and syntax minification, and mangle bindings with pinned terser 5.51.2 in scope order. Co-authored-by: g-kari <g-kari@users.noreply.github.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.
概要
committed Animate UI bundle is reproducible and boundedが、esbuild の短縮識別子名の揺れで失敗する問題を直します。再現性のバイト比較と gzip 140KB 未満の上限は弱めていません。PR #78 と #70 の内容は変更していません。マージも、share.0g0.xyz へのデプロイもしていません。
原因
esbuild 0.28.2 の
minifyIdentifiersは、入力ソースの文字頻度ヒストグラムから短縮名を割り当てます(ShuffleByCharFreq)。実行後の構造に残らない 1 バイトの差でも、束縛名がまとめて入れ替わります。そのため、同じui/site-guide.jsxとロックファイルでも、環境によってpublic/assets/site-guide-v1.jsのバイト列がコミット済みファイルと一致しません。このリポジトリの Linux(Node 22 / 26、npm 10 / 11、作業ディレクトリの違い、
framer-motionのネスト、esbuild ネイティブと wasm)では、現行の単一パス minify はコミット済みファイルと一致しました。GitHub Actions の main でもこのテストは通っています。失敗は、頻度ヒューリスティックが環境差に弱いこと自体です。#78 の説明どおり main でも再現し、依存を更新する #51 やバンドルを再生成する #70 でも同じ比較が落ちます。対応
0.28.2のまま。空白と構文の minify、charset: 'ascii'、legalComments: 'inline'、リポジトリ直下のabsWorkingDirに固定するterser@5.51.2のスコープ順 mangle のみ(compress: false、ascii_only: true)public/assets/site-guide-v1.jsをその出力で再生成するライセンス注記ファイルの中身は変わっていません。React の
@licenseコメントと Animate UI のバナーは残しています。検証
node --test tests/*.test.mjs: 287 passed / 0 failedtests/site-guide-dom.test.mjs: 開閉、フォーカス、キーボード、マウント失敗時のネイティブガイド復帰を確認/tmpから再ビルドしてもコミット済みバンドルと一致