Document untrack behavior with uninitialized async reads (NotReady propagation)

未关闭 适合新手
#1,635 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
冷清
技术栈
javascript
领域
documentation

调研方向

从 issue 中链接的 untrack 参考页面开始,结合 solidjs/solid#3007 的上下文,审查其中描述的异步读取行为。更新该页面,以区分依赖跟踪和 NotReady 的结算,解释 owner 的暂停与重新运行,并展示一个使用 isPending/latest、真正不会暂停的就绪状态检查。

由索引模型根据 Issue 内容生成。

描述

From solidjs/solid#3007 (reported by @mizulu).

The untrack reference page (https://v2.solidjs.com/reference/solid-js/reactivity/untrack) should document how untrack interacts with async reads in 2.0:

  • untrack stops dependency tracking — reads inside it do not subscribe the surrounding computation.
  • It does not opt out of async settlement. Reading an async source that is not yet ready inside untrack still throws NotReadyError, which propagates to the owning computation: the owner suspends (participates in Loading boundaries) and re-runs once the source first resolves.

In other words, untrack(() => getColor()) where getColor is a pending async memo will still cause the owner to re-run when getColor first settles — the read is untracked, but the not-ready suspension is part of async graph resolution, not tracking.

The page should spell out this distinction (tracking vs. settlement) and show the pattern for a genuinely non-suspending read of a possibly-pending source (e.g. checking readiness with isPending/latest as appropriate) so users aren't surprised that untrack alone doesn't provide a fallback-value escape hatch. A fallback-value overload for untrack was considered in solidjs/solid#3007 and rejected — the docs are the fix.

主要语言
MDX
星标
292
派生
361
平均合并
7 小时 51 分钟
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

solidjs/solid-docs 的其他 Issue

查看 solidjs/solid-docs 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。