Client element claims fire before dynamic attributes are applied, and only `href`/`action` writes re-claim
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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
- 平均合并
- 11 小时 49 分钟
- 30 天内合并 PR
- 346
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 18/100
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 55/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 22/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 14/100
维护者通常 1 天内回复
相似的 Issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 90/100
lingdojo/kana-dojo#32663 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
Admin: Title Separator field can't be cleared (input falls back to "|")可能已有人在做 @emdashbot 今天认领。 未关闭bot:bug bot:in-review
难度 2/5 1-3 小时 新手友好度 80/100
emdash-cms/emdash#4236 · 3 条评论 ·
维护者通常 1 天内回复
-
PHP workflow streaming requests buffer the full SSE response可能已有人在做 @Winoren 今天认领。 未关闭review: medium
难度 2/5 1-3 小时 新手友好度 84/100
langgenius/dify#44270 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
area:holodeck review-finding
难度 2/5 1-3 小时 新手友好度 62/100
hyperdrive-technology/holodeck#142 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
code-yeongyu/senpi#3573 ·
维护者通常 1 天内回复