[CONTEXT]: provided values are handed over on connect only, consumers do not follow later provider updates
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- frontend
Línea de trabajo
Read BaseElement.update() and verifyProvidedProperties() to assess the proposed update hook and its subtree walk; compare the behavior with the context example in examples/showcase/ and the current context documentation. The issue needs a maintainer decision between documenting connect-time values and updating consumers after provider changes; done means that decision is reflected consistently in the implementation or docs, showcase, and treatment of manual requestContext() callbacks.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Observation
A provider lists a plain value in provideProperties():
class Provider extends TemplateElement {
properties() {
return { theme: 'light' };
}
provideProperties() {
return { theme: this.theme };
}
}
class Consumer extends TemplateElement {
injectProperties() {
return { theme: '' };
}
}
The consumer gets light when it connects. When the provider sets this.theme = 'dark' later, the consumer keeps light. A Store in provideProperties() behaves differently: it is handed over by reference, the consumer subscribes to it, so changes in the store render the consumer.
The context section of examples/showcase/ (#171) shows both behaviours side by side.
Cause
verifyProvidedProperties() replays missed requests and compares customChild[key] !== providedProperties[key], but it only runs in connectedCallback() (both branches). Nothing runs it after a provider update.
Options
- Document it: a provided value is handed over when the consumer connects, values that change are provided as a
Store. No code. - Run
this.verifyProvidedProperties()at the end ofBaseElement.update(). Three lines, consumers then follow every provided value. Costs a subtree walk (getAllComposedElementChildren) on every render of an element that provides something, and manualrequestContext()callbacks still fire once only, which should be stated either way.
The docs currently say the injected value "will be just there at some point", which does not decide this. A maintainer decision, the showcase and the docs follow it.
- 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
-
area:testing bug effort:low model:light plan planner:gpt-6-2-sol tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Agent360dk/browser-mcp#124 ·
Los mantenedores suelen responder en 2 días
-
area:site feature good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
pacocartones/free-llm-api-hub#829 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
Jason-Vaughan/TangleClaw#3270 ·
Los mantenedores suelen responder en 1 día