[CONTEXT]: provided values are handed over on connect only, consumers do not follow later provider updates
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- frontend
调研方向
Read BaseElement.update() and verifyProvidedProperties() to assess the proposed update hook and its subtree walk; compare the behavior with the context example in examples/showcase/ and the current context documentation. The issue needs a maintainer decision between documenting connect-time values and updating consumers after provider changes; done means that decision is reflected consistently in the implementation or docs, showcase, and treatment of manual requestContext() callbacks.
由索引模型根据 Issue 内容生成。
描述
Observation
A provider lists a plain value in provideProperties():
class Provider extends TemplateElement {
properties() {
return { theme: 'light' };
}
provideProperties() {
return { theme: this.theme };
}
}
class Consumer extends TemplateElement {
injectProperties() {
return { theme: '' };
}
}
The consumer gets light when it connects. When the provider sets this.theme = 'dark' later, the consumer keeps light. A Store in provideProperties() behaves differently: it is handed over by reference, the consumer subscribes to it, so changes in the store render the consumer.
The context section of examples/showcase/ (#171) shows both behaviours side by side.
Cause
verifyProvidedProperties() replays missed requests and compares customChild[key] !== providedProperties[key], but it only runs in connectedCallback() (both branches). Nothing runs it after a provider update.
Options
- Document it: a provided value is handed over when the consumer connects, values that change are provided as a
Store. No code. - Run
this.verifyProvidedProperties()at the end ofBaseElement.update(). Three lines, consumers then follow every provided value. Costs a subtree walk (getAllComposedElementChildren) on every render of an element that provides something, and manualrequestContext()callbacks still fire once only, which should be stated either way.
The docs currently say the injected value "will be just there at some point", which does not decide this. A maintainer decision, the showcase and the docs follow it.
- 主要语言
- JavaScript
- 星标
- 30
- 派生
- 5
- 平均合并
- 1 小时 57 分钟
- 30 天内合并 PR
- 10
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
webtides/element-js 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
webtides/element-js#201 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
webtides/element-js#198 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
webtides/element-js#194 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
webtides/element-js#193 ·
维护者通常 1 天内回复
-
[RENDERER]: only the first raw text element with interpolations is handled, a line break inside one breaks it too可能已有人在做 @eddyloewen 于 28 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 88/100
webtides/element-js#185 ·
维护者通常 1 天内回复
查看 webtides/element-js 的全部 Issue
相似的 Issue
-
area:testing bug effort:low model:light plan planner:gpt-6-2-sol tests
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 86/100
Agent360dk/browser-mcp#124 ·
维护者通常 2 天内回复
-
area:site feature good first issue help wanted
难度 2/5 1-3 小时 新手友好度 84/100
pacocartones/free-llm-api-hub#829 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 1/5 1-3 小时 新手友好度 78/100
Jason-Vaughan/TangleClaw#3270 ·
维护者通常 1 天内回复