Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa
#3,923 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
24/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
36.1k
Fork
1.1k
Merge medio
10h 44m
PR unite (30g)
339

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di solidjs/solid

Tutte le issue di solidjs/solid

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.