[2.0 / next] A first-load <Loading> reveals content for a write still held outside it (F-7)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, typescript
- 領域
- frontend
調査の方向性
The reproduction is a vitest spec to add under packages/web/test/, and the third frame is where it fails. The question is how a Loading boundary's first-load reveal interacts with a write still held by a memo read outside it, which needs familiarity with the reactive scheduler's hold and flush logic. Done means the spec's frames match the expected array, with the boundary keeping its fallback until the held s = 1 write commits.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
a and b both ask by s. a and s are read outside a <Loading>, and b is read inside it, on its first load. Writing s is held on a:1, so the outside still shows a=10s=0. When b:1 resolves, the boundary reveals b=21, the answer for s = 1, beside s=0. The frame becomes whole only when a:1 lands.
Found by checking every frame of generated ryansolid/reactivescript programs, compiled onto Solid, against F-1.
Your Example Website or App
The vitest spec below (in packages/web/test/), on next @ 77be406ca.
Steps to Reproduce the Bug or Issue
import { render } from "@solidjs/web";
import { createMemo, createSignal, Errored, flush, Loading } from "solid-js";
import { expect, it } from "vitest";
const tick = async () => { for (let i = 0; i < 2; i++) { await new Promise(r => setTimeout(r, 0)); flush(); } };
it("a first-load <Loading> does not reveal content derived from a write still held outside it", async () => {
const flights = new Map<string, (v: number) => void>();
const ask = (key: string) => new Promise<number>(resolve => flights.set(key, resolve));
const [s, setS] = createSignal(0);
const el = document.createElement("div");
const frames: string[] = [];
const dispose = render(() => {
const a = createMemo(() => ask("a:" + s())); // read outside the boundary: holds the write
const b = createMemo(() => ask("b:" + s())); // read inside the boundary, on its first load
return (
<Errored fallback={<p>error</p>}>
<p>a={a()}</p>
<p>s={s()}</p>
<Loading fallback={<p>loading b</p>}><p>b={b()}</p></Loading>
</Errored>
);
}, el);
await tick();
flights.get("a:0")!(10); await tick(); frames.push(el.textContent!);
setS(1); flush(); await tick(); frames.push(el.textContent!); // a:1 and b:1 asked; the write is held on a:1
flights.get("b:1")!(21); await tick(); frames.push(el.textContent!); // b's answer for s = 1
flights.get("a:1")!(11); await tick(); frames.push(el.textContent!);
dispose();
expect(frames).toEqual([
"a=10s=0loading b",
"a=10s=0loading b",
"a=10s=0loading b", // received "a=10s=0b=21": b for s = 1 beside s = 0
"a=11s=1b=21",
]);
});
npx vitest run in packages/web. The third frame is a=10s=0b=21.
Expected behavior
The boundary keeps its fallback until the held s = 1 write commits, then reveals b=21 together with a=11s=1. Nothing reveals ahead of the hold it belongs to (F-7), and the screen stays whole (F-1).
Platform
- OS: macOS
- Browser: n/a (jsdom)
- Version: solid-js 2.0.0-rc.20,
next@ 77be406ca
- 主要言語
- TypeScript
- スター
- 36.2k
- フォーク
- 1.1k
- 平均マージ
- 11時間 5分
- マージ済み PR(30日)
- 475
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
solidjs/solid のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 12/100
メンテナーはふだん 1 日以内に返信
-
[2.0 / next] <Errored> recovery shows a pending memo's answer to an older input beside the new inputオープン
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JuliusBrussee/caveman#1449 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
linagora/twake-calendar-frontend#1924 ·
メンテナーはふだん 1 日以内に返信
-
Add: Class TV Modaオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libnativeapi/nativeapi#21 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
GiganticMinecraft/seichi-playguide#183 ·
メンテナーはふだん 1 日以内に返信