App builds call the harness's `__rt.reg` for every binding; the registry is never pruned and grows with each mount (CP-4c)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 54/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- build-system
Direção de pesquisa
Start with spec/11-compiler.md CP-4c and trace compile_linked and the reg emission sites in compiler/src/emit.rs; compare how app builds and conformance builds are selected. Then inspect ref/compile/rt-web.ts and the Vite plugin’s app path. Done means app builds no longer emit harness registry calls, with conformance builds retaining them as specified.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Every module app() compiles (the Vite front end, rxc app) calls the conformance harness's __rt.reg(name, …) for every binding. The runtime's reg appends to a registry that nothing ever removes from, so an app that keeps mounting components grows that registry without bound.
Versions: @reactivescript/compiler, @reactivescript/runtime 0.3.1; solid-js / @solidjs/web 2.0.0-rc.21; @solidjs/vite-plugin 3.0.0-next.57.
Repro
main.rx:
component Row({ label }: { label: string }) {
upper = label + "!"
<li>{upper}</li>
}
export default component App() {
source items := ["a", "b", "c"]
<ul>{for item in items { <Row label={item} /> }}</ul>
}
Compiled with app("main.rx", "dom"), Row contains:
__rt.reg("label", { get: v$label });
__rt.reg("upper", { get: v$upper });
Mounting it with createApp from @reactivescript/runtime/web, counting calls to app.reg, and replacing items with three new strings 1000 times (app.dset("items", [], [...]) then flush()):
after mount: rows 3 reg calls 7
after 1000 replacements: rows 3 reg calls 6007
The DOM holds three rows at the end, but the registry holds 6007 entries. Each entry keeps the disposed rows' accessors (and through them their nodes) reachable for the life of the app.
Expected
spec/11-compiler.md CP-4c: reg, lookup, dget, dset, api, jsError, B.fetch/B.fail, … are the harness's, and "Compiled code calls them only in a conformance build — the compiler's option for running scenarios/". The app build (app(), the product path the Vite plugin uses) should not emit __rt.reg, or the module-level reg for imports. If a registry stays in the runtime for some other reason, an entry should be removed when its owner is disposed.
Cause
- The crate has no conformance switch.
compile_linked(compiler/src/emit.rs:194) takes onlyby_source, and theregstatements are emitted unconditionally:compiler/src/emit.rs:696,:739,:761, andfn regat:893-899, which every source, equation and prop goes through. ref/compile/rt-web.ts:154(publisheddist/web.jsreg) only ever doesl.push(e). There is noonCleanupand no removal.
Related: #74 is another case of harness-only code (the scenario prelude __B.*) reaching app builds.
- Linguagem predominante
- TypeScript
- Estrelas
- 127
- Forks
- 7
- Merge médio
- 15h 42min
- PRs com merge (30d)
- 63
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de solidjs/reactivescript
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
solidjs/reactivescript#96 ·
Mantenedores costumam responder em até 1 dia
-
Vite front end keeps serving a failed build after the missing/broken imported module is fixedTalvez já em andamento @cgaaf assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
solidjs/reactivescript#84 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
solidjs/reactivescript#77 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
solidjs/reactivescript#74 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 62/100
solidjs/reactivescript#97 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de solidjs/reactivescript
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
GetStream/stream-chat-react#3467 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
vercel-labs/ui#1139 ·
Mantenedores costumam responder em até 1 dia
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Talvez já em andamento @goranai assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
bot:ai-assisted component:platform-js status:untriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
midnightntwrk/platform-js#93 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100