hx-preload (htmx 4): an expired preload blocks re-preloading until the element is clicked
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- frontend
調査の方向性
issue では、four ブランチの src/ext/hx-preload.js と、elt._htmx?.preload をチェックする早期リターンが示されています。まず、その preload リスナーと htmx_before_request の有効期限処理を読んでください。要素にマウスを合わせ、5秒以上待ってから、もう一度マウスを合わせて再現します。前の preload の期限切れ後、次にマウスを合わせたときに新しい preload が開始されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Version: htmx 4.0.0 (dist/ext/hx-preload.js; also current on the four branch, src/ext/hx-preload.js)
What happens
The preload listener returns early whenever a preload is stored on the element, without checking whether it has expired:
if (elt._htmx?.preload) return;
An expired entry is only removed in htmx_before_request, i.e. by the next real request. So once the preload window has passed (5 s by default), hovering the element never preloads again until it has been clicked once.
Repro
<button hx-get="/page" hx-target="#main" hx-preload="mouseover">Page</button>
- Hover the button: a preload request is made. ✅
- Wait more than 5 s without clicking.
- Hover again: no request. ❌ (expected: a new preload)
- Click: a normal request is made (the expired preload is discarded).
- Hover again: preload fires again.
Expected
An expired preload should be replaced on the next trigger, as expiresAt suggests (htmx_before_request already ignores an expired preload).
Suggested fix
if (elt._htmx?.preload && Date.now() < elt._htmx.preload.expiresAt) return;
(Optionally also delete elt._htmx.preload before starting the new prefetch.)
- 主要言語
- JavaScript
- スター
- 49.6k
- フォーク
- 1.7k
- 平均マージ
- 10日 5時間
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bigskysoftware/htmx のほかの issue
-
[htmx4] Swap style for boosted elements is not outerSync対応中かも @1cg が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
bigskysoftware/htmx#4138 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
-
[htmx4] HTMX errors if HX-Trigger Event Detail is null対応中かも @MichaelWest22 が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
bigskysoftware/htmx#4135 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
-
[htmx4]: an `hx-trigger` filter throws a SyntaxError when the event has a property that isn't an identifier対応中かも @MichaelWest22 が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
bigskysoftware/htmx#4123 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
-
[htmx4] When importing and configuring htmx with JS, you can't turn off indicator CSS対応中かも @MichaelWest22 が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
bigskysoftware/htmx#4122 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
-
No GitHub Release for version 2.0.11対応中かも @1cg が 6 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
bigskysoftware/htmx#4117 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
bigskysoftware/htmx の issue をすべて見る
似ている issue
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offline対応中かも @r2jaff が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ComposioHQ/composio#5054 ·
メンテナーはふだん 1 日以内に返信
-
W3cオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
web-platform-tests/wpt#64017 ·
メンテナーはふだん 1 日以内に返信
-
routine:ci-review
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
harlan-zw/unlighthouse#456 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
beginner enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
philaconvalley/website#217 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] xiaohongshu search_input_not_available on accounts with new AI-search layout (gray rollout)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信