Conversation
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.
変更内容
Honoを使ったローカル用のPerformance API確認サンプルを追加します。各ディレクトリで
npm ci && npm startを実行し、http://127.0.0.1:3000/を開いて利用できます。try-empty-html-performance-api: 空のHTMLを配信try-devtools-performance-api: HTMLのimgタグでsample.pngを表示。提供された画像をそのまま格納し、画像専用の配信ルートを追加。さらにJSON API/fooをHTMLからfetchし、performance.markとperformance.measureでJSON解析完了までを計測両サンプルともループバックアドレスのみで待ち受けます。同じポートを使うため、個別に起動します。READMEに起動・停止手順と開発者ツールからPerformance APIを確認する例を記載しています。
新しいディレクトリは、空HTMLサンプルの複製と画像追加を別々のコミットにしています。
動作確認
Node.js v22.23.2で両サンプルの
npm ciとnode --check server.jsが成功両サンプルでGET
/が200・text/htmlでindex.htmlと一致する内容を返すことを確認画像サンプルのGET
/sample.pngが200・image/pngで元の添付画像とバイト単位で一致することを確認空HTMLサンプルの存在しないパス、および画像サンプルの
/server.jsが404を返すことを確認git diff --cached --checkが成功追加した
/fooのJSONレスポンスをHTTPで検証HTML内JavaScriptをNode.jsで実行し、成功時のmark/measure作成とHTTPエラー時の処理を確認(ブラウザ実行は未確認)