Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Client element claims fire before dynamic attributes are applied, and only `href`/`action` writes re-claim

クローズ
#3,923 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
24/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

Start with the claim ordering in packages/compiler/tests/fixtures/dom-source-names/bindings/output.js, where _$claimElement runs before _$spread sets href and title, then read setAttribute in packages/web/src/client.ts for the claimed-attribute check. The issue offers two fixes, claiming after initial bindings or re-claiming on target, rel, download and similar writes, and a maintainer has to pick one first. Done means a claim consumer sees final initial attributes and is notified of later changes, with the compiler fixture updated to match.

索引モデルが issue の本文から書いたものです。

説明

Context

Compiled DOM output calls claimElement(node) at element creation for a[href] / form[action] so consumers (e.g. @solidjs/router link state) can manage navigation-relevant elements. Related: #3878 (server-side claim hole).

Problem

The claim fires before the element's dynamic attribute bindings are first applied — see packages/compiler/__tests__/fixtures/dom-source-names/bindings/output.js, where _$claimElement(_el$22) precedes the _$spread(_el$22, …) that sets href/title. Afterwards, setAttribute in packages/web/src/client.ts re-claims only on href/action writes (including via spread, which routes through assignProp → setAttribute). So a consumer sees the anchor without its final attributes and is never told when they arrive. Writes to target, rel, download, link (router's opt-in attribute), prop:href (property path) and xlink:href (setAttributeNS) don't re-claim.

Consequence (router)

<a href="/x" target={t()}>, download={…}, rel={…} get link state (aria-current / data-active) and interception treatment as if those attributes were absent — on initial mount and late mounts (<Show>) — until the next navigation. The router currently compensates by re-processing every anchor in its location-change sweep, including newly mounted anchors a second time in the same navigation, purely to correct claim timing.

Proposal (either)

  • (a) Claim after the element's initial attribute bindings are applied, so the claim sees final initial attributes.
  • (b) Also re-claim on writes to target, rel, download (ideally a consumer-declared set, e.g. link).

(a) fixes mount; (b) also covers later toggles. Server side has no ordering problem since SSR emits all attributes together.

Cost

None without a registered claim consumer (claims are dormant null checks); for (b), a few extra name comparisons in setAttribute's claimed-attribute check.

主要言語
TypeScript
スター
36.1k
フォーク
1.1k
平均マージ
10時間 44分
マージ済み PR(30日)
339

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

solidjs/solid のほかの issue

solidjs/solid の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。