[RENDERER]: keyed lists with a repeat() directive
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- frontend
Línea de trabajo
Start with diffChildNodes() and parseArray() to understand how child node parts and index-based array parts are updated; this issue depends on #184. Then trace how template parts handle rendering, hydration, and toString(). Done means keyed rows keep their DOM state through sorting, the benchmark includes keyed swap and remove cases, and docs/features/templates.md documents the directive.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Goal
A list whose items move keeps the DOM nodes of each item, so focus, input values, scroll position and running animations survive a sort or an insert at the front.
Context
diffChildNodes() works on node identity and parseArray() reuses the template part at each index when the literal is the same. A sort therefore updates every row in place with the values of another item instead of moving the rows. That is fast (swap rows is under a millisecond in the benchmark), but any state that lives in the DOM ends up on the wrong item.
Design
html`<ul>${repeat(items, (item) => item.id, (item) => html`<li>${item.name}</li>`)}</ul>`
repeat()is a directive on a child node part, it returns a value the part recognises- the part keeps a
Map<key, TemplatePart>instead of the index basedarrayParts - a key that exists gets its part updated and its nodes moved to the new position, a new key gets a new part, a missing key has its nodes removed
toString()renders the items in order, nothing else to do on the server- hydration binds the parts to the server rendered template markers in order, like arrays do today
Builds on the array handling of #184, do it after that one.
Done when
- a sort of 1000 rows moves nodes instead of rewriting them: a focused input in a row stays focused and keeps its value
- the benchmark gets a keyed variant of swap rows and remove row
- documented in
docs/features/templates.mdnext to the other directives
- Lenguaje dominante
- JavaScript
- Estrellas
- 30
- Forks
- 5
- Merge medio
- 1 h 57 min
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de webtides/element-js
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
webtides/element-js#201 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
webtides/element-js#198 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
webtides/element-js#194 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
webtides/element-js#193 ·
Los mantenedores suelen responder en 1 día
-
[RENDERER]: only the first raw text element with interpolations is handled, a line break inside one breaks it tooPosiblemente ocupada @eddyloewen la tomó hace 28 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
webtides/element-js#185 ·
Los mantenedores suelen responder en 1 día
Todos los issues de webtides/element-js
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
directus/directus#28558 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
cloudflare/workers-sdk#17189 ·
Los mantenedores suelen responder en 1 día
-
AWS Lambda Waiting for: Product Owner
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
getsentry/sentry-javascript#26910 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[🐛 Bug]: @wdio/reporter drops the function name of a string script in command outputPosiblemente ocupada @dhananjay6561 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
webdriverio/webdriverio#16507 · 1 comentario ·
Los mantenedores suelen responder en 1 día