[2.0 rc.15] Reading lazy memo in both side of conditional expression causes infinite computation loop
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
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Start by reading the createMemo documentation linked in the issue and tracing how lazy memo subscriptions behave when a memo is read in both a conditional expression's condition and its selected value. Reproduce the loop with the linked playground and inspect the relevant reactivity implementation and tests. Done means the memo does not recompute repeatedly after yielding a value, while still recomputing when unused or when a dependency changes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Conditions:
- The memo should be
lazy. - The expression should be conditional.
[memo().a, memo().b]works normally. - The memo should be read in both side(condition and conditionally evaluated value) of the expression.
Then the memo gets recomputed automatically when the compute function yielded a value, leading to infinite loading.
The document for createMemo says:
lazy—boolean
When true, defers the initial computation until the value is first read, and opts the memo into autodisposal — once it has no remaining subscribers it is torn down and recomputed from scratch on the next read.
My naive guess is that the memo gets disposed before the conditionally evaluated value subscribes the memo so recomputation occurs.
Your Example Website or App
https://solid2.netlify.app/#solidjs-repl:SRn7SNNPTRCRKF9GzAEvTg
Steps to Reproduce the Bug or Issue
- Open the playground.
- Check the checkbox to start computation.
- See console, messages keep logging.
Expected behavior
The memo should not be computed again unless either it is completely unused or any of its dependencies is changed.
Screenshots or Videos
https://github.com/user-attachments/assets/1424b6c3-b7e2-4b3a-b338-34bfe45a1a6f
Platform
- OS: Windows
- Browser: Chrome 155.0.8059.40
- Solid: 2.0.0 rc.14 and rc.15
Additional context
It seems the problem exists since @solidjs/[email protected].
- Lingua principale
- TypeScript
- Stelle
- 36.1k
- Fork
- 1.1k
- Merge medio
- 11h 37m
- PR unite (30g)
- 344
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di solidjs/solid
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14Forse già presa @itisrmk l’ha presa 3 giorni fa. Aperta1.x
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 51/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
`createRoot`'s dispose function keeps `fn` alive, so `<For>`/`<Index>` rows retain removed list itemsForse già presa @boombang l’ha presa 5 giorni fa. Aperta1.x
Difficoltà 4/5 1-2 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid
Issue simili
-
engine-rs P3 review-deferral wasm
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
maniator/verticopolis#1154 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
telerik/kendo-react#3861 ·
I maintainer di solito rispondono entro 1 giorno
-
[bug]: use-mobile.ts uses pixel logic, causing UI state de-sync with Tailwind CSS rem breakpointsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
task
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100