ecs: let a changes finalizer learn that components with a trait were written through a row
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 15/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- typescript
- Domaine
- devtools
Piste de recherche
The request is a design change to the changes finalizer in the ECS layer, so start by locating how Finalizer.changes and its watch option are implemented and how row assignment (row[component] = value) is tracked versus command-based structural changes. Decide whether a per-table dirty bit or a changes.written field is the right shape, and agree the API with maintainers before writing code. Done means a finalizer watching a trait is notified when a row system writes one of its components, without scanning rows.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
A changes finalizer can't see a component's value being written through a row (row[component] = value in a row system), only structural changes (added, removed, spawned, despawned). So state that lives in a component and is moved by a row system (a camera's position and look, moved every frame by the control) can't be saved on change by a finalizer that watches a trait, and has to be polled.
Where this came from (mecs)
mecs keeps per-tab state (the camera's cameraPosition and cameraLook, plus resources like the selected tool) under a trait of the app's own (inTab). With 0.3.0 trait watches (#242) the resources are noticed by Finalizer.changes({ watch: [inTab] }), which is what I wanted. But the camera is a component of an entity and controlCamera moves it with row assignments:
System.create({ components: { with: [cameraPosition, cameraLook, ...] } }, row => {
row[cameraPosition] = next.position; // not reported to a changes finalizer
});
A finalizer watching inTab never fires for that. So the tab's state is polled four times a second (take a snapshot, encode it, compare bytes) which is correct but does the encode work 240 times a minute while nothing changes.
What I need
Some way for a finalizer (or a system) to learn that components with a trait were written this tick, by row or by command, without scanning every row:
- a
changes.written(or the existingchanges.groupscarryingreplacedfor row writes) per table for watched components; or - a
Finalizer.changesoption that also reports "this table's column was written", coarse is fine (a table-level dirty bit per watched column, set by row assignment, cleared when finalizers have run). I don't need which row or the values, only that something changed, because the consumer re-snapshots.
The changed: [component] filter of a system already has this information per row (it is how deriveCells runs only on moved voxels), so the world already tracks a version per column or row; this is asking for it to be reachable from a finalizer's watch, including by trait.
Why a coarse signal is enough
The consumer is "save the tab's state soon after it changes": a timer then a snapshot. A dirty flag per watched table, read once per tick, replaces the 4 Hz byte-comparing poll with nothing at all while idle.
- Langage dominant
- TypeScript
- Étoiles
- 12
- Forks
- 8
- Merge moyen
- 11 h 36 min
- PR mergées (30 j)
- 21
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de adobe/data
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 22/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
Les mainteneurs répondent en général sous 1 jour
-
Need an archetype clear functionOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de adobe/data
Issues similaires
-
area: cli bug flake ready-for-agent
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
gazetta-studio/gazetta-studio#1772 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
microsoft/playwright#43875 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
README translations: ja, ko, deOuvertedocumentation good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
feature
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
calagopus/panel#285 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour